ky0ko has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44845 )
Change subject: mtrr.h: refine _POW2_MASK ......................................................................
mtrr.h: refine _POW2_MASK
this patch adjusts _POW2_MASK to work with rom sizes between 64KiB and 512MiB, additionally fixing incorrectness for sizes 128MiB and above that previously were present.
Change-Id: I0272c0c43cba44f6fbfb5dc539509b4ed9b92e75 Signed-off-by: ky0ko ky0ko@disroot.org --- M src/include/cpu/x86/mtrr.h 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/44845/1
diff --git a/src/include/cpu/x86/mtrr.h b/src/include/cpu/x86/mtrr.h index 42964b0..fd4159d 100644 --- a/src/include/cpu/x86/mtrr.h +++ b/src/include/cpu/x86/mtrr.h @@ -176,9 +176,11 @@ #endif /* !defined(__ASSEMBLER__) */
/* Align up/down to next power of 2, suitable for assembler - too. Range of result 256kB to 128MB is good enough here. */ + too. Range works from 64kB to 512MB. */ #define _POW2_MASK(x) ((x>>1)|(x>>2)|(x>>3)|(x>>4)|(x>>5)| \ - (x>>6)|(x>>7)|(x>>8)|((1<<18)-1)) + (x>>6)|(x>>7)|(x>>8)|(x>>9)|(x>>10)| \ + (x>>11)|(x>>12)|(x>>13)|((1<<16)-1)) + #define _ALIGN_UP_POW2(x) ((x + _POW2_MASK(x)) & ~_POW2_MASK(x)) #define _ALIGN_DOWN_POW2(x) ((x) & ~_POW2_MASK(x))
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44845 )
Change subject: mtrr.h: refine _POW2_MASK ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/44845/1/src/include/cpu/x86/mtrr.h File src/include/cpu/x86/mtrr.h:
https://review.coreboot.org/c/coreboot/+/44845/1/src/include/cpu/x86/mtrr.h@... PS1, Line 182: (x>>11)|(x>>12)|(x>>13)|((1<<16)-1)) code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/44845/1/src/include/cpu/x86/mtrr.h@... PS1, Line 182: (x>>11)|(x>>12)|(x>>13)|((1<<16)-1)) please, no spaces at the start of a line
ky0ko has uploaded a new patch set (#2). ( https://review.coreboot.org/c/coreboot/+/44845 )
Change subject: mtrr.h: refine _POW2_MASK ......................................................................
mtrr.h: refine _POW2_MASK
this patch adjusts _POW2_MASK to work with rom sizes between 64KiB and 512MiB, additionally fixing incorrectness for sizes 128MiB and above that previously were present.
Change-Id: I0272c0c43cba44f6fbfb5dc539509b4ed9b92e75 Signed-off-by: ky0ko ky0ko@disroot.org --- M src/include/cpu/x86/mtrr.h 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/44845/2
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44845 )
Change subject: mtrr.h: refine _POW2_MASK ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/c/coreboot/+/44845/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/44845/2//COMMIT_MSG@2 PS2, Line 2: ky0ko I’d be great if you used a pseudonym instead of a nickname/username.
https://review.coreboot.org/c/coreboot/+/44845/2//COMMIT_MSG@11 PS2, Line 11: above that previously were present. Please explicitly list the incorrect result.
Stefan Reinauer has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/44845?usp=email )
Change subject: mtrr.h: refine _POW2_MASK ......................................................................
Abandoned