Date: Tue, 23 Feb 2016 02:28:19 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295908 - head/sys/powerpc/mpc85xx Message-ID: <201602230228.u1N2SJql000478@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602230228.u1N2SJql000478>