svn commit: r295908 - head/sys/powerpc/mpc85xx

Justin Hibbits jhibbits at FreeBSD.org
Tue Feb 23 02:28:20 UTC 2016


Author: jhibbits
Date: Tue Feb 23 02:28:19 2016
New Revision: 295908
URL: https://svnweb.freebsd.org/changeset/base/295908

Log:
  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.

Modified:
  head/sys/powerpc/mpc85xx/mpc85xx.c

Modified: head/sys/powerpc/mpc85xx/mpc85xx.c
==============================================================================
--- head/sys/powerpc/mpc85xx/mpc85xx.c	Tue Feb 23 01:56:58 2016	(r295907)
+++ head/sys/powerpc/mpc85xx/mpc85xx.c	Tue Feb 23 02:28:19 2016	(r295908)
@@ -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)


More information about the svn-src-all mailing list