summaryrefslogtreecommitdiffstats
path: root/internal.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-12-18 15:01:24 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-12-18 15:01:24 +0000
commit8a3c60cdd0e5632173567923ae1927763e31e857 (patch)
tree3a5514d022392cf4d8fa368f9f02653da21a93ca /internal.c
parent63fd9026f1e82b67a65072fda862ba7af35839e1 (diff)
downloadflashrom-8a3c60cdd0e5632173567923ae1927763e31e857.tar.gz
flashrom-8a3c60cdd0e5632173567923ae1927763e31e857.tar.bz2
flashrom-8a3c60cdd0e5632173567923ae1927763e31e857.zip
Add struct flashctx * parameter to all functions accessing flash chips
All programmer access function prototypes except init have been made static and moved to the respective file. A few internal functions in flash chip drivers had chipaddr parameters which are no longer needed. The lines touched by flashctx changes have been adjusted to 80 columns except in header files. Corresponding to flashrom svn r1474. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Diffstat (limited to 'internal.c')
-rw-r--r--internal.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/internal.c b/internal.c
index 215ce6f36..386b84284 100644
--- a/internal.c
+++ b/internal.c
@@ -127,6 +127,20 @@ int register_superio(struct superio s)
int is_laptop = 0;
int laptop_ok = 0;
+static void internal_chip_writeb(const struct flashctx *flash, uint8_t val,
+ chipaddr addr);
+static void internal_chip_writew(const struct flashctx *flash, uint16_t val,
+ chipaddr addr);
+static void internal_chip_writel(const struct flashctx *flash, uint32_t val,
+ chipaddr addr);
+static uint8_t internal_chip_readb(const struct flashctx *flash,
+ const chipaddr addr);
+static uint16_t internal_chip_readw(const struct flashctx *flash,
+ const chipaddr addr);
+static uint32_t internal_chip_readl(const struct flashctx *flash,
+ const chipaddr addr);
+static void internal_chip_readn(const struct flashctx *flash, uint8_t *buf,
+ const chipaddr addr, size_t len);
static const struct par_programmer par_programmer_internal = {
.chip_readb = internal_chip_readb,
.chip_readw = internal_chip_readw,
@@ -324,37 +338,44 @@ int internal_init(void)
}
#endif
-void internal_chip_writeb(uint8_t val, chipaddr addr)
+static void internal_chip_writeb(const struct flashctx *flash, uint8_t val,
+ chipaddr addr)
{
mmio_writeb(val, (void *) addr);
}
-void internal_chip_writew(uint16_t val, chipaddr addr)
+static void internal_chip_writew(const struct flashctx *flash, uint16_t val,
+ chipaddr addr)
{
mmio_writew(val, (void *) addr);
}
-void internal_chip_writel(uint32_t val, chipaddr addr)
+static void internal_chip_writel(const struct flashctx *flash, uint32_t val,
+ chipaddr addr)
{
mmio_writel(val, (void *) addr);
}
-uint8_t internal_chip_readb(const chipaddr addr)
+static uint8_t internal_chip_readb(const struct flashctx *flash,
+ const chipaddr addr)
{
return mmio_readb((void *) addr);
}
-uint16_t internal_chip_readw(const chipaddr addr)
+static uint16_t internal_chip_readw(const struct flashctx *flash,
+ const chipaddr addr)
{
return mmio_readw((void *) addr);
}
-uint32_t internal_chip_readl(const chipaddr addr)
+static uint32_t internal_chip_readl(const struct flashctx *flash,
+ const chipaddr addr)
{
return mmio_readl((void *) addr);
}
-void internal_chip_readn(uint8_t *buf, const chipaddr addr, size_t len)
+static void internal_chip_readn(const struct flashctx *flash, uint8_t *buf,
+ const chipaddr addr, size_t len)
{
memcpy(buf, (void *)addr, len);
return;