>From 654723d4ff7d615e2cc99e62718315609a05b044 Mon Sep 17 00:00:00 2001
From: Tadas Slotkus <devtadas@gmail.com>
Date: Fri, 19 Aug 2011 18:03:06 +0300
Subject: [carFl mem 40/65] Globalisation pass 1: fixes flash.h

This commit adjusts headers according to previous patches.

Signed-off-by: Tadas Slotkus <devtadas@gmail.com>
---
 flash.h |   50 +++++++++++++++++++++++++-------------------------
 1 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/flash.h b/flash.h
index b1e9af8..becaec8 100644
--- a/flash.h
+++ b/flash.h
@@ -42,18 +42,18 @@ typedef unsigned long chipaddr;
 typedef struct globals globals;
 
 int register_shutdown(int (*function) (void *data), void *data);
-void *programmer_map_flash_region(const char *descr, unsigned long phys_addr,
+void *programmer_map_flash_region(globals *g, const char *descr, unsigned long phys_addr,
 				  size_t len);
-void programmer_unmap_flash_region(void *virt_addr, size_t len);
-void chip_writeb(uint8_t val, chipaddr addr);
-void chip_writew(uint16_t val, chipaddr addr);
-void chip_writel(uint32_t val, chipaddr addr);
-void chip_writen(uint8_t *buf, chipaddr addr, size_t len);
-uint8_t chip_readb(const chipaddr addr);
-uint16_t chip_readw(const chipaddr addr);
-uint32_t chip_readl(const chipaddr addr);
-void chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
-void programmer_delay(int usecs);
+void programmer_unmap_flash_region(globals *g, void *virt_addr, size_t len);
+void chip_writeb(globals *g, uint8_t val, chipaddr addr);
+void chip_writew(globals *g, uint16_t val, chipaddr addr);
+void chip_writel(globals *g, uint32_t val, chipaddr addr);
+void chip_writen(globals *g, uint8_t *buf, chipaddr addr, size_t len);
+uint8_t chip_readb(globals *g, const chipaddr addr);
+uint16_t chip_readw(globals *g, const chipaddr addr);
+uint32_t chip_readl(globals *g, const chipaddr addr);
+void chip_readn(globals *g, uint8_t *buf, const chipaddr addr, size_t len);
+void programmer_delay(globals *g, int usecs);
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 
@@ -127,7 +127,7 @@ struct flashchip {
 	 */
 	uint32_t tested;
 
-	int (*probe) (struct flashchip *flash);
+	int (*probe) (globals *g, struct flashchip *flash);
 
 	/* Delay after "enter/exit ID mode" commands in microseconds. */
 	int probe_timing;
@@ -146,13 +146,13 @@ struct flashchip {
 		} eraseblocks[NUM_ERASEREGIONS];
 		/* a block_erase function should try to erase one block of size
 		 * 'blocklen' at address 'blockaddr' and return 0 on success. */
-		int (*block_erase) (struct flashchip *flash, unsigned int blockaddr, unsigned int blocklen);
+		int (*block_erase) (globals *g, struct flashchip *flash, unsigned int blockaddr, unsigned int blocklen);
 	} block_erasers[NUM_ERASEFUNCTIONS];
 
-	int (*printlock) (struct flashchip *flash);
-	int (*unlock) (struct flashchip *flash);
-	int (*write) (struct flashchip *flash, uint8_t *buf, int start, int len);
-	int (*read) (struct flashchip *flash, uint8_t *buf, int start, int len);
+	int (*printlock) (globals *g, struct flashchip *flash);
+	int (*unlock) (globals *g, struct flashchip *flash);
+	int (*write) (globals *g, struct flashchip *flash, uint8_t *buf, int start, int len);
+	int (*read) (globals *g, struct flashchip *flash, uint8_t *buf, int start, int len);
 	struct {
 		uint16_t min;
 		uint16_t max;
@@ -209,23 +209,23 @@ extern enum chipbustype buses_supported;
 extern int verbose;
 extern const char flashrom_version[];
 extern char *chip_to_probe;
-void map_flash_registers(struct flashchip *flash);
-int read_memmapped(struct flashchip *flash, uint8_t *buf, int start, int len);
+void map_flash_registers(globals *g, struct flashchip *flash);
+int read_memmapped(globals *g, struct flashchip *flash, uint8_t *buf, int start, int len);
 int erase_flash(struct flashchip *flash);
-int probe_flash(int startchip, struct flashchip *fill_flash, int force);
-int read_flash_to_file(struct flashchip *flash, const char *filename, uint8_t *buf);
+int probe_flash(globals *g, int startchip, struct flashchip *fill_flash, int force);
+int read_flash_to_file(globals *g, struct flashchip *flash, const char *filename, uint8_t *buf);
 int min(int a, int b);
 int max(int a, int b);
 void tolower_string(char *str);
 char *extract_param(char **haystack, const char *needle, const char *delim);
-int verify_range(struct flashchip *flash, uint8_t *cmpbuf, int start, int len, const char *message);
+int verify_range(globals *g, struct flashchip *flash, uint8_t *cmpbuf, int start, int len, const char *message);
 int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gran);
 char *strcat_realloc(char *dest, const char *src);
 void print_version(void);
 void print_banner(void);
 void list_programmers_linebreak(int startcol, int cols, int paren);
 int selfcheck(void);
-int doit(struct flashchip *flash, int force, const char *filename, int read_it, int write_it);
+int doit(globals *g, struct flashchip *flash, int force, const char *filename, int read_it, int write_it);
 int read_buf_from_file(unsigned char *buf, unsigned long size, const char *filename);
 int write_buf_to_file(unsigned char *buf, unsigned long size, const char *filename);
 
@@ -274,9 +274,9 @@ struct spi_command {
 	const unsigned char *writearr;
 	unsigned char *readarr;
 };
-int spi_send_command(unsigned int writecnt, unsigned int readcnt,
+int spi_send_command(globals *g, unsigned int writecnt, unsigned int readcnt,
 		const unsigned char *writearr, unsigned char *readarr);
-int spi_send_multicommand(struct spi_command *cmds);
+int spi_send_multicommand(globals *g, struct spi_command *cmds);
 uint32_t spi_get_valid_read_addr(void);
 
 struct globals {
-- 
1.7.6

