summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2016-02-23 02:28:19 +0000
committerjhibbits <jhibbits@FreeBSD.org>2016-02-23 02:28:19 +0000
commit580950437f2f3ad9b6b6adac3400bf3b0ffe9423 (patch)
treecbdafa6a20f9be7221565ca68139c1dd5b160917 /sys/powerpc
parentbd90256ab303b620281cdbaf1182a282471b550b (diff)
downloadFreeBSD-src-580950437f2f3ad9b6b6adac3400bf3b0ffe9423.zip
FreeBSD-src-580950437f2f3ad9b6b6adac3400bf3b0ffe9423.tar.gz
Allow the size argument for law_enable() to be non-power-of-2.
Although the local access windows are powers of 2 in size, allow arguments that aren't power of 2, and round up.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/mpc85xx/mpc85xx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/powerpc/mpc85xx/mpc85xx.c b/sys/powerpc/mpc85xx/mpc85xx.c
index 717e98a..f67aa29 100644
--- a/sys/powerpc/mpc85xx/mpc85xx.c
+++ b/sys/powerpc/mpc85xx/mpc85xx.c
@@ -157,7 +157,8 @@ law_find_free(void)
return (i);
}
-#define _LAW_SR(trgt,size) (0x80000000 | (trgt << 20) | (ffsl(size) - 2))
+#define _LAW_SR(trgt,size) (0x80000000 | (trgt << 20) | \
+ (flsl(size + (size - 1)) - 2))
int
law_enable(int trgt, uint64_t bar, uint32_t size)
OpenPOWER on IntegriCloud