summaryrefslogtreecommitdiff
path: root/sys/src/9/port/sd.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-01-26 17:06:28 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2013-01-26 17:06:28 +0100
commit14d663b1695df1144ee19b6481f9c68bb8be21b2 (patch)
tree0ebcf5eede003803f7fd8d42911de5f0de28c55d /sys/src/9/port/sd.h
parentae116c94460e3b3e0eab82f06bf1c92c425ee1ac (diff)
kernel: add portable sd mmc interface (from sources)
Diffstat (limited to 'sys/src/9/port/sd.h')
-rw-r--r--sys/src/9/port/sd.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/src/9/port/sd.h b/sys/src/9/port/sd.h
index 2d11ffef5..97894f922 100644
--- a/sys/src/9/port/sd.h
+++ b/sys/src/9/port/sd.h
@@ -4,6 +4,7 @@
typedef struct SDev SDev;
typedef struct SDfile SDfile;
typedef struct SDifc SDifc;
+typedef struct SDio SDio;
typedef struct SDpart SDpart;
typedef struct SDperm SDperm;
typedef struct SDreq SDreq;
@@ -143,8 +144,32 @@ enum {
SDcdb = 2,
};
+/*
+ * Allow the default #defines for sdmalloc & sdfree to be overridden by
+ * system-specific versions. This can be used to avoid extra copying
+ * by making sure sd buffers are cache-aligned (some ARM systems) or
+ * page-aligned (xen) for DMA.
+ */
+#ifndef sdmalloc
#define sdmalloc(n) malloc(n)
#define sdfree(p) free(p)
+#endif
+
+/*
+ * mmc/sd/sdio host controller interface
+ */
+
+struct SDio {
+ char *name;
+ int (*init)(void);
+ void (*enable)(void);
+ int (*inquiry)(char*, int);
+ int (*cmd)(u32int, u32int, u32int*);
+ void (*iosetup)(int, void*, int, int);
+ void (*io)(int, uchar*, int);
+};
+
+extern SDio sdio;
/* devsd.c */
extern void sdadddevs(SDev*);