coreboot-kgpe-d16/src/include
Hung-Te Lin 85ecdb1471 mmio: Fix failure in bit field macro when accessing >30 bits
For bit fields with 31 bits (e.g: DEFINE_BITFIELD(MYREG, 30, 0) ),
the calculation of mask value will go overflow:
 "error: integer overflow in expression '-2147483648 - 1' of
  type 'int' results in '2147483647'".

And for bit fields with 32 bits (e.g: DEFINE_BITFIELD(MYREG, 31, 0) ),
the error will be:
 "error: left shift count >= width of type [-Werror=shift-count-overflow]"

To fix these issues, the bit field macros should always use unsigned
integers, and use 64bit integer when creating mask value.

Change-Id: Ie3cddf9df60b83de4e21243bfde6b79729fb06ef
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40404
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2020-04-20 06:20:50 +00:00
..
boot src: Use 'include <boot/coreboot_tables.h>' when appropriate 2019-10-27 17:48:30 +00:00
console drivers/pc80/rtc: Reorganize prototypes 2020-04-20 06:16:54 +00:00
cpu cpu/x86/smm.h: Add SW SMI for PSP SMM Info 2020-04-13 12:39:25 +00:00
device mmio: Fix failure in bit field macro when accessing >30 bits 2020-04-20 06:20:50 +00:00
efi src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
pc80 drivers/pc80/rtc: Reorganize prototypes 2020-04-20 06:16:54 +00:00
smp
superio src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
sys
adainit.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
assert.h assert.h: Simplify dead_code() 2020-04-10 00:10:58 +00:00
b64_decode.h src/include: Fix typos 2020-01-08 12:57:31 +00:00
base3.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
bcd.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
boardid.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
boot_device.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
bootblock_common.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
bootmem.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
bootmode.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
bootsplash.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
bootstate.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
cbfs.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
cbmem.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
cper.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
crc_byte.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
ctype.h add ctype.h header 2019-06-24 21:15:14 +00:00
delay.h cpu/x86/lapic: Refactor timer_fsb() 2019-09-19 09:28:55 +00:00
device_tree.h src/include: Fix typos 2020-01-18 10:55:45 +00:00
dimm_info_util.h src (minus soc and mainboard): Remove copyright notices 2020-03-17 18:26:34 +00:00
edid.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
elog.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
endian.h Drop ROMCC code and header guards 2019-12-19 03:25:05 +00:00
fallback.h drivers/pc80/rtc: Clean up some headers 2020-01-07 18:40:02 +00:00
fit.h
fit_payload.h
fmap.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
gic.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
gpio.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
halt.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
imd.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
input-event-codes.h include/input-event-codes.h: Add Linux input key codes header file 2020-04-13 19:54:30 +00:00
inttypes.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
ip_checksum.h
kconfig.h
lib.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
list.h
main_decl.h
memlayout.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
memory_info.h
memrange.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
mrc_cache.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
nhlt.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
option.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
post.h drivers/pc80/rtc: Reorganize prototypes 2020-04-20 06:16:54 +00:00
program_loading.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
ramdetect.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
random.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
reg_script.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
region_file.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
reset.h
rmodule.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
romstage_handoff.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
rtc.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
rules.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
sar.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
sdram_mode.h src (minus soc and mainboard): Remove copyright notices 2020-03-17 18:26:34 +00:00
smbios.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
smmstore.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
spd.h src (minus soc and mainboard): Remove copyright notices 2020-03-17 18:26:34 +00:00
spd_bin.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
spd_ddr2.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
spi-generic.h src/include: Fix typos 2020-01-18 10:55:45 +00:00
spi_bitbang.h src (minus soc and mainboard): Remove copyright notices 2020-03-17 18:26:34 +00:00
spi_flash.h drivers/spi/spi_flash: remove spi flash names 2020-01-28 14:44:37 +00:00
spi_sdcard.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
stage_cache.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
stdarg.h create stdio.h and stdarg.h for {,v}snprintf 2020-03-25 23:38:46 +00:00
stdbool.h Drop ROMCC code and header guards 2019-12-19 03:25:05 +00:00
stddef.h Drop ROMCC code and header guards 2019-12-19 03:25:05 +00:00
stdint.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
stdio.h create stdio.h and stdarg.h for {,v}snprintf 2020-03-25 23:38:46 +00:00
stdlib.h lib/malloc: Implement a simple free() only for last malloc() 2020-01-02 18:22:53 +00:00
string.h create stdio.h and stdarg.h for {,v}snprintf 2020-03-25 23:38:46 +00:00
swab.h Drop ROMCC code and header guards 2019-12-19 03:25:05 +00:00
symbols.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
thread.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
timer.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
timestamp.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
trace.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
types.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
uuid.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00
vbe.h src: Use 'include <boot/coreboot_tables.h>' when appropriate 2019-10-27 17:48:30 +00:00
version.h
watchdog.h
wrdd.h src/include: Use SPDX for GPL-2.0-only files 2020-04-05 17:45:17 +00:00