coreboot/src/include/cpu
Nico Huber 540a664045 cpu/x86/mtrr: Fix _FROM_4G_TOP() macro
This macro was unnecessarily complex. Trying to avoid an overflow
for unknown reasons, and instead shifted the result into the sign
bit in C. Using a plain number literal that forces C to use an
adequate integer type seems to be safe. We start with 0xffffffff,
subtract `x` and add 1 again. Turned out to be a common pattern
and can't overflow for any positive 32-bit `x`.

Change-Id: Ibb0c5b88a6e42d3ef2990196a5b99ace90ea8ee8
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/31322
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2019-02-12 22:43:21 +00:00
..
amd amdfam10 boards: Use defaults for get_pci1234() 2019-01-04 17:23:56 +00:00
intel src/cpu/intel: Set get_ia32_fsb function common 2019-01-27 12:13:09 +00:00
x86 cpu/x86/mtrr: Fix _FROM_4G_TOP() macro 2019-02-12 22:43:21 +00:00
cpu.h Rename __attribute__((packed)) --> __packed 2017-07-13 19:45:59 +00:00