>From 27e1ec3afa3d569eabc936d021580c12ff3538aa Mon Sep 17 00:00:00 2001
From: Tadas Slotkus <devtadas@gmail.com>
Date: Sun, 21 Aug 2011 11:24:40 +0300
Subject: [carFl mem 48/65] Globalisation pass 3: cbtable...

Also does nothing just passes globals forth
acros funcion calls.

Signed-off-by: Tadas Slotkus <devtadas@gmail.com>
---
 board_enable.c |    4 ++--
 cbtable.c      |   12 ++++++------
 cli_classic.c  |    2 +-
 internal.c     |    2 +-
 layout.c       |    2 +-
 programmer.h   |    6 +++---
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/board_enable.c b/board_enable.c
index 6270b80..4b1bbfc 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -2098,7 +2098,7 @@ const struct board_pciid_enable board_pciid_enables[] = {
  * Match boards on coreboot table gathered vendor and part name.
  * Require main PCI IDs to match too as extra safety.
  */
-static const struct board_pciid_enable *board_match_coreboot_name(
+static const struct board_pciid_enable *board_match_coreboot_name(globals *g,
 					const char *vendor, const char *part)
 {
 	const struct board_pciid_enable *board = board_pciid_enables;
@@ -2262,7 +2262,7 @@ int board_flash_enable(globals *g, const char *vendor, const char *part)
 	int ret = 0;
 
 	if (part)
-		board = board_match_coreboot_name(vendor, part);
+		board = board_match_coreboot_name(g, vendor, part);
 
 	if (!board)
 		board = board_match_pci_card_ids(g, P3);
diff --git a/cbtable.c b/cbtable.c
index ea8964a..89abbfc 100644
--- a/cbtable.c
+++ b/cbtable.c
@@ -33,7 +33,7 @@
 char *lb_part = NULL, *lb_vendor = NULL;
 int partvendor_from_cbtable = 0;
 
-void lb_vendor_dev_from_string(char *boardstring)
+void lb_vendor_dev_from_string(globals *g, char *boardstring)
 {
 	char *tempstr2 = NULL;
 	strtok(boardstring, ":");
@@ -144,7 +144,7 @@ static struct lb_header *find_lb_table(void *base, unsigned long start,
 	return NULL;
 }
 
-static void find_mainboard(struct lb_record *ptr, unsigned long addr)
+static void find_mainboard(globals *g, struct lb_record *ptr, unsigned long addr)
 {
 	struct lb_mainboard *rec;
 	int max_size;
@@ -176,7 +176,7 @@ static struct lb_record *next_record(struct lb_record *rec)
 	return (struct lb_record *)(((char *)rec) + rec->size);
 }
 
-static void search_lb_records(struct lb_record *rec, struct lb_record *last,
+static void search_lb_records(globals *g, struct lb_record *rec, struct lb_record *last,
 			      unsigned long addr)
 {
 	struct lb_record *next;
@@ -188,14 +188,14 @@ static void search_lb_records(struct lb_record *rec, struct lb_record *last,
 		next = next_record(rec);
 		count++;
 		if (rec->tag == LB_TAG_MAINBOARD) {
-			find_mainboard(rec, addr);
+			find_mainboard(g, rec, addr);
 			break;
 		}
 	}
 }
 
 #define BYTES_TO_MAP (1024*1024)
-int coreboot_init(void)
+int coreboot_init(globals *g)
 {
 	uint8_t *table_area;
 	unsigned long addr, start;
@@ -250,7 +250,7 @@ int coreboot_init(void)
 	     lb_table->header_bytes, lb_table->header_checksum,
 	     lb_table->table_bytes, lb_table->table_checksum,
 	     lb_table->table_entries);
-	search_lb_records(rec, last, addr + lb_table->header_bytes);
+	search_lb_records(g, rec, last, addr + lb_table->header_bytes);
 
 	return 0;
 }
diff --git a/cli_classic.c b/cli_classic.c
index fa961cc..30afee6 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -208,7 +208,7 @@ int cli_classic(globals *g, int argc, char *argv[])
 		case 'm':
 #if CONFIG_INTERNAL == 1
 			tempstr = strdup(optarg);
-			lb_vendor_dev_from_string(tempstr);
+			lb_vendor_dev_from_string(g, tempstr);
 #else
 			fprintf(stderr, "Error: Internal programmer support "
 				"was not compiled in and --mainboard only\n"
diff --git a/internal.c b/internal.c
index 4dea240..d237bce 100644
--- a/internal.c
+++ b/internal.c
@@ -208,7 +208,7 @@ int internal_init(globals *g)
 	/* We look at the cbtable first to see if we need a
 	 * mainboard specific flash enable sequence.
 	 */
-	coreboot_init();
+	coreboot_init(g);
 
 	dmi_init(g);
 
diff --git a/layout.c b/layout.c
index d719a05..6f25e69 100644
--- a/layout.c
+++ b/layout.c
@@ -46,7 +46,7 @@ static romlayout_t rom_entries[MAX_ROMLAYOUT];
 #if CONFIG_INTERNAL == 1 /* FIXME: Move the whole block to cbtable.c? */
 static char *def_name = "DEFAULT";
 
-int show_id(uint8_t *bios, int size, int force)
+int show_id(globals *g, uint8_t *bios, int size, int force)
 {
 	unsigned int *walk;
 	unsigned int mb_part_offset, mb_vendor_offset;
diff --git a/programmer.h b/programmer.h
index 9d78b59..fd59d56 100644
--- a/programmer.h
+++ b/programmer.h
@@ -205,8 +205,8 @@ int setup_cpu_msr(int cpu);
 void cleanup_cpu_msr(void);
 
 /* cbtable.c */
-void lb_vendor_dev_from_string(char *boardstring);
-int coreboot_init(void);
+void lb_vendor_dev_from_string(globals *g, char *boardstring);
+int coreboot_init(globals *g);
 extern char *lb_part, *lb_vendor;
 extern int partvendor_from_cbtable;
 
@@ -447,7 +447,7 @@ int check_max_decode(globals *g, enum chipbustype buses, uint32_t size);
 char *extract_programmer_param(globals *g, const char *param_name);
 
 /* layout.c */
-int show_id(uint8_t *bios, int size, int force);
+int show_id(globals *g, uint8_t *bios, int size, int force);
 
 /* spi.c */
 enum spi_controller {
-- 
1.7.6

