coreboot-kgpe-d16/util
Carl-Daniel Hailfinger ac12ecd27a flashrom: Use helper functions to access flash chips.
Right now we perform direct pointer manipulation without any abstraction
to read from and write to memory mapped flash chips. That makes it
impossible to drive any flasher which does not mmap the whole chip.

Using helper functions readb() and writeb() allows a driver for external
flash programmers like Paraflasher to replace readb and writeb with
calls to its own chip access routines.

This patch has the additional advantage of removing lots of unnecessary
casts to volatile uint8_t * and now-superfluous parentheses which caused
poor readability.

I used the semantic patcher Coccinelle to create this patch. The
semantic patch follows:
@@
expression a;
typedef uint8_t;
volatile uint8_t *b;
@@
- *(b) = (a);
+ writeb(a, b);
@@
volatile uint8_t *b;
@@
- *(b)
+ readb(b)
@@
type T;
T b;
@@
(
 readb
|
 writeb
)
 (...,
- (T)
- (b)
+ b
 )

In contrast to a sed script, the semantic patch performs type checking
before converting anything.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: FENG Yu Ning <fengyuning1984@gmail.com>
Tested-by: Joe Julian


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3971 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-03-05 19:24:22 +00:00
..
ADLO Changes Makefile generation so that recursive "make" calls read 2008-06-08 23:05:24 +00:00
abuild Add an abuild command line option for -fno-stack-protect for toolchains that might require it. 2008-09-30 17:09:44 +00:00
analysis Rename almost all occurences of LinuxBIOS to coreboot. 2008-01-18 15:08:58 +00:00
buildrom fix build warnings for buildrom (trivial) 2008-08-01 11:20:33 +00:00
dump_mmcr small ts5300 update, fix endian problem in dummmcr. 2006-03-18 00:10:29 +00:00
flashrom flashrom: Use helper functions to access flash chips. 2009-03-05 19:24:22 +00:00
getpir cosmetic update for getpir. 2008-11-10 13:52:14 +00:00
inteltool Patch to util/inteltool: 2008-12-04 15:18:20 +00:00
k8resdump K8 resource dump utility from Rudolf Marek 2007-10-30 01:12:20 +00:00
lbtdump Fix a typo in lbtdump output (trivial). 2008-05-07 19:21:18 +00:00
mkelfImage Add the contents of buildrom's 2008-08-06 20:37:38 +00:00
mptable fix typo 2008-03-15 16:30:39 +00:00
msrtool msrtool: Allow MSR symbols (names) to also be used as addresses. 2009-01-26 17:18:31 +00:00
newconfig coreboot-v2: drop this ugly historic union name in v2 that was dropped in v3 2009-02-28 20:10:20 +00:00
nrv2b - Minor mod to reset16.inc to work with newer binutils hopefully this works with older ones... 2003-06-17 08:42:17 +00:00
nvramtool Move the nvramtool manpage to section 8 (as it's only really usable as root), 2008-10-31 05:40:04 +00:00
optionlist Rename almost all occurences of LinuxBIOS to coreboot. 2008-01-18 15:08:58 +00:00
options build_opt_tbl: 2008-12-02 12:26:17 +00:00
resetcf epia-m support 2004-10-06 17:33:54 +00:00
romcc Rename almost all occurences of LinuxBIOS to coreboot. 2008-01-18 15:08:58 +00:00
superiotool This adds register map based on NSC PC87392 datasheet. LDN#2 can be 2008-12-20 19:35:54 +00:00
vgabios Change 0x%p to %p. Thanks Stefan for catching the one I introduced in 3931. 2009-02-10 03:02:05 +00:00