diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-03-06 16:16:45 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-03-06 16:16:45 +0100 |
commit | 374d4ec2c154cbec0094f124f2173b685adbabd5 (patch) | |
tree | 59e11e7381d0bbdada3c31b3c413a2a15ff006db /sys/src/9/port/sd.h | |
parent | fadbb92afaa7530121a13306aad4224692f1d6ee (diff) |
devsd: always page align sd buffers
sdbio() tests if it can pass the buffer pointer directly to
the driver when it is already in kernel memory. we also need
to check if the buffer is properly aligned but alignment
requirement is handled in system specific sdmalloc() and
was not known to devsd.
to solve this, we *always* page align sd buffers and get rid
of the system specific sdmalloc() macro (was only used in bcm
kernel).
Diffstat (limited to 'sys/src/9/port/sd.h')
-rw-r--r-- | sys/src/9/port/sd.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/src/9/port/sd.h b/sys/src/9/port/sd.h index 97894f922..685d1c7c4 100644 --- a/sys/src/9/port/sd.h +++ b/sys/src/9/port/sd.h @@ -145,15 +145,10 @@ enum { }; /* - * 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. + * Avoid extra copying by making sd buffers page-aligned for DMA. */ -#ifndef sdmalloc -#define sdmalloc(n) malloc(n) +#define sdmalloc(n) mallocalign(n, BY2PG, 0, 0) #define sdfree(p) free(p) -#endif /* * mmc/sd/sdio host controller interface |