coreboot/src/include
Alexandru Gagniuc 299c265102 Refactor usage of walkcbfs to permit access to CBFS headers
walkcbfs() is used only with ROMCC. Besides finding stages during the
bootblock, it's also used when applying microcode updates during the
bootblock phase. The function used to return only a pointer to the data of
the CBFS file, while making the header completely inaccessible. Since the
header contains the length of the CBFS file, the caller did not have a way
to know how long the data was. Then, other conventions had to be used to
determine the EOF, which might present problems if the user replaces the
CBFS file. This is not an issue when jumping to a stage (romstage), but can
present problems when accessing a microcode file which has not been
NULL-terminated.

Refactor walkcbfs_asm to return a pointer to the CBFS file header rather
than the data. Rename walkcbfs() to walkcbfs_head(), and reimplement a new
walkcbfs() based on walkcbfs_head(). Thus current usage of walkcbfs()
remains unaffected.
The code has been verified to run successfully under qemu.

Subsequent patches will change usage of walkcbfs() to walkcbfs_head where
knowing the length of the data is needed.

Change-Id: I21cbf19e130e1480e2749754e5d5130d36036f8e
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: http://review.coreboot.org/4504
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2013-12-09 19:56:57 +01:00
..
boot Drop obsolete CONSOLE_LOGBUF 2013-12-03 02:36:02 +01:00
console vtxprintf: Introduce vtxdprintf for the ease of closures 2013-12-07 19:27:34 +01:00
cpu smi: Update mainboard_smi_gpi() to have 32bit argument 2013-11-24 07:40:22 +01:00
device Correct file permissions. 2013-12-07 00:39:09 +01:00
pc80 Log device path into CMOS during probe stages 2013-11-26 19:10:31 +01:00
smp Clean up #ifs 2012-05-08 00:34:34 +02:00
superio pnp: Add some default functions to enter/exit config state 2013-07-03 16:13:11 +02:00
assert.h We call this cache as ram everywhere, so let's call it the same in Kconfig 2010-08-30 17:53:13 +00:00
bootstate.h include: Fix spelling 2013-07-11 22:36:19 +02:00
cbfs.h cbfs: remove unused code and prototype 2013-11-18 18:41:57 +01:00
cbfs_core.h Refactor usage of walkcbfs to permit access to CBFS headers 2013-12-09 19:56:57 +01:00
cbmem.h Add Intel FSP northbridge support Sandybridge and Ivybridge 2013-12-04 18:45:13 +01:00
delay.h Drop prototype guarding for romcc 2013-05-10 00:06:46 +02:00
edid.h FUI: reorganize include files 2013-07-10 02:39:42 +02:00
ehci.h include: Fix spelling 2013-07-11 22:36:19 +02:00
elog.h Extend CMOS POST code logging to store extra data 2013-11-26 19:10:20 +01:00
endian.h Extend CBFS to support arbitrary ROM source media. 2013-01-30 17:58:32 +01:00
fallback.h Make set_boot_successful depend on PC80_SYSTEM 2012-11-30 21:33:35 +01:00
inttypes.h x86: provide more C standard environment 2013-03-20 04:20:25 +01:00
ip_checksum.h Drop prototype guarding for romcc 2013-05-10 00:06:46 +02:00
kconfig.h Add config_enabled() from Linux 2012-05-08 00:36:09 +02:00
lib.h ramtest.c: Add silent ram_check 2013-06-10 22:30:39 +02:00
memrange.h memrange: add 2 new range_entry routines 2013-03-29 20:11:28 +01:00
reset.h Drop prototype guarding for romcc 2013-05-10 00:06:46 +02:00
rmodule.h include: Fix spelling 2013-07-11 22:36:19 +02:00
romstage_handoff.h include: Fix spelling 2013-07-11 22:36:19 +02:00
sdram_mode.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
smbios.h smbios: Add generic type41 write function 2013-11-25 23:38:21 +01:00
spd.h spd.h: Add all known SPD_MEMORY_TYPE definitions. 2013-06-03 22:35:21 +02:00
spd_ddr2.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
spi-generic.h spi-generic.h: Adapt include guard 2013-02-11 22:34:17 +01:00
spi_flash.h Whitespace: Replace tab character in license text with two spaces 2013-02-20 23:30:45 +01:00
stddef.h Make ssize_t an actual ssize_t 2013-11-25 23:13:50 +01:00
stdlib.h stdlib: add ALIGN_UP and ALIGN_DOWN macros 2013-03-29 19:54:47 +01:00
string.h string: Add STRINGIFY macro 2013-05-01 03:25:04 +02:00
swab.h include: Fix spelling 2013-07-11 22:36:19 +02:00
thread.h include: Fix spelling 2013-07-11 22:36:19 +02:00
timer.h include: Fix spelling 2013-07-11 22:36:19 +02:00
timestamp.h Have option of timestamps, CBMEM console and usbdebug for most boards 2013-10-15 13:15:18 +02:00
trace.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
types.h pc80/mc146818rtc: Return an error code rather than an integer 2013-11-25 23:59:59 +01:00
uart.h Drop prototype guarding for romcc 2013-05-10 00:06:46 +02:00
uart8250.h include: Fix spelling 2013-07-11 22:36:19 +02:00
usb_ch9.h USB Debug Port related license header fixes (trivial). 2010-09-23 18:16:46 +00:00
usbdebug.h usbdebug: Support choice of EHCI controller 2013-08-29 18:36:20 +02:00
vbe.h Provide support for setting up the framebuffer from EDID 2013-07-10 02:39:28 +02:00
version.h Rename almost all occurences of LinuxBIOS to coreboot. 2008-01-18 15:08:58 +00:00
watchdog.h watchdog.h: Fix compile time error on disabling watchdog handling 2013-03-12 12:06:43 +01:00