From 374d4ec2c154cbec0094f124f2173b685adbabd5 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 6 Mar 2015 16:16:45 +0100 Subject: 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). --- sys/src/9/port/devsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/src/9/port/devsd.c') diff --git a/sys/src/9/port/devsd.c b/sys/src/9/port/devsd.c index 6474a68f0..049338e90 100644 --- a/sys/src/9/port/devsd.c +++ b/sys/src/9/port/devsd.c @@ -843,7 +843,7 @@ sdbio(Chan* c, int write, char* a, long len, uvlong off) len = nb*unit->secsize - offset; hard = offset || write && len%unit->secsize; - if(iskaddr(a) && !hard) { + if(iskaddr(a) && ((uintptr)a & (BY2PG-1))==0 && !hard) { b = (uchar*)a; allocd = 0; }else{ -- cgit v1.2.3