patch named .diff; should show inline

On Fri, Aug 8, 2008 at 4:29 PM, Carl-Daniel Hailfinger
<[EMAIL PROTECTED]> wrote:
> On 08.08.2008 19:00, Sean Nelson wrote:
>> change all references of lb_/LB_ to cb_/CB_ in flashrom
>>
>> Signed-off-by: Sean Nelson <[EMAIL PROTECTED]>
>>
>
> Your mailer seems to be broken. Giving the attachment the type
> application/octet-stream is inappropriate for plain text patches and
> causes at least Thunderbird not to display the attachment inline.
>
> Regards,
> Carl-Daniel
>
Index: flash.h
===================================================================
--- flash.h	(revision 3490)
+++ flash.h	(working copy)
@@ -406,9 +406,9 @@
 int find_romentry(char *name);
 int handle_romentries(uint8_t *buffer, uint8_t *content);
 
-/* lbtable.c */
+/* cbtable.c */
 int coreboot_init(void);
-extern char *lb_part, *lb_vendor;
+extern char *cb_part, *cb_vendor;
 
 /* spi.c */
 int probe_spi_rdid(struct flashchip *flash);
Index: coreboot_tables.h
===================================================================
--- coreboot_tables.h	(revision 3490)
+++ coreboot_tables.h	(working copy)
@@ -36,19 +36,19 @@
  * 64bit system, a uint64_t would be aligned to 64bit boundaries, 
  * breaking the table format.
  *
- * lb_uint64 will keep 64bit coreboot table values aligned to 32bit
+ * cb_uint64 will keep 64bit coreboot table values aligned to 32bit
  * to ensure compatibility. They can be accessed with the two functions
- * below: unpack_lb64() and pack_lb64()
+ * below: unpack_cb64() and pack_cb64()
  *
  * See also: util/lbtdump/lbtdump.c
  */
 
-struct lb_uint64 {
+struct cb_uint64 {
 	uint32_t lo;
 	uint32_t hi;
 };
 
-static inline uint64_t unpack_lb64(struct lb_uint64 value)
+static inline uint64_t unpack_cb64(struct cb_uint64 value)
 {
 	uint64_t result;
 	result = value.hi;
@@ -56,15 +56,15 @@
 	return result;
 }
 
-static inline struct lb_uint64 pack_lb64(uint64_t value)
+static inline struct cb_uint64 pack_cb64(uint64_t value)
 {
-	struct lb_uint64 result;
+	struct cb_uint64 result;
 	result.lo = (value >> 0) & 0xffffffff;
 	result.hi = (value >> 32) & 0xffffffff;
 	return result;
 }
 
-struct lb_header {
+struct cb_header {
 	uint8_t signature[4];	/* LBIO */
 	uint32_t header_bytes;
 	uint32_t header_checksum;
@@ -79,39 +79,39 @@
  * boot enviroment record if you don't know what it easy.  This allows
  * forward compatibility with records not yet defined.
  */
-struct lb_record {
+struct cb_record {
 	uint32_t tag;		/* tag ID */
 	uint32_t size;		/* size of record (in bytes) */
 };
 
-#define LB_TAG_UNUSED	0x0000
+#define CB_TAG_UNUSED	0x0000
 
-#define LB_TAG_MEMORY	0x0001
+#define CB_TAG_MEMORY	0x0001
 
-struct lb_memory_range {
-	struct lb_uint64 start;
-	struct lb_uint64 size;
+struct cb_memory_range {
+	struct cb_uint64 start;
+	struct cb_uint64 size;
 	uint32_t type;
-#define LB_MEM_RAM       1	/* Memory anyone can use */
-#define LB_MEM_RESERVED  2	/* Don't use this memory region */
-#define LB_MEM_TABLE     16	/* Ram configuration tables are kept in */
+#define CB_MEM_RAM       1	/* Memory anyone can use */
+#define CB_MEM_RESERVED  2	/* Don't use this memory region */
+#define CB_MEM_TABLE     16	/* Ram configuration tables are kept in */
 };
 
-struct lb_memory {
+struct cb_memory {
 	uint32_t tag;
 	uint32_t size;
-	struct lb_memory_range map[0];
+	struct cb_memory_range map[0];
 };
 
-#define LB_TAG_HWRPB	0x0002
-struct lb_hwrpb {
+#define CB_TAG_HWRPB	0x0002
+struct cb_hwrpb {
 	uint32_t tag;
 	uint32_t size;
 	uint64_t hwrpb;
 };
 
-#define LB_TAG_MAINBOARD	0x0003
-struct lb_mainboard {
+#define CB_TAG_MAINBOARD	0x0003
+struct cb_mainboard {
 	uint32_t tag;
 	uint32_t size;
 	uint8_t vendor_idx;
@@ -119,24 +119,24 @@
 	uint8_t strings[0];
 };
 
-#define LB_TAG_VERSION		0x0004
-#define LB_TAG_EXTRA_VERSION	0x0005
-#define LB_TAG_BUILD		0x0006
-#define LB_TAG_COMPILE_TIME	0x0007
-#define LB_TAG_COMPILE_BY	0x0008
-#define LB_TAG_COMPILE_HOST	0x0009
-#define LB_TAG_COMPILE_DOMAIN	0x000a
-#define LB_TAG_COMPILER		0x000b
-#define LB_TAG_LINKER		0x000c
-#define LB_TAG_ASSEMBLER	0x000d
-struct lb_string {
+#define CB_TAG_VERSION		0x0004
+#define CB_TAG_EXTRA_VERSION	0x0005
+#define CB_TAG_BUILD		0x0006
+#define CB_TAG_COMPILE_TIME	0x0007
+#define CB_TAG_COMPILE_BY	0x0008
+#define CB_TAG_COMPILE_HOST	0x0009
+#define CB_TAG_COMPILE_DOMAIN	0x000a
+#define CB_TAG_COMPILER		0x000b
+#define CB_TAG_LINKER		0x000c
+#define CB_TAG_ASSEMBLER	0x000d
+struct cb_string {
 	uint32_t tag;
 	uint32_t size;
 	uint8_t string[0];
 };
 
 /* The following structures are for the cmos definitions table */
-#define LB_TAG_CMOS_OPTION_TABLE 200
+#define CB_TAG_CMOS_OPTION_TABLE 200
 /* cmos header record */
 struct cmos_option_table {
 	uint32_t tag;		/* CMOS definitions table type */
@@ -151,7 +151,7 @@
         starts at the beginning of the byte and the length is
         fills complete bytes.
 */
-#define LB_TAG_OPTION 201
+#define CB_TAG_OPTION 201
 struct cmos_entries {
 	uint32_t tag;		/* entry type */
 	uint32_t size;		/* length of this record */
@@ -168,7 +168,7 @@
         This record is variable length.  The text field may be
         shorter than CMOS_MAX_TEXT_LENGTH.
 */
-#define LB_TAG_OPTION_ENUM 202
+#define CB_TAG_OPTION_ENUM 202
 struct cmos_enums {
 	uint32_t tag;		/* enumeration type */
 	uint32_t size;		/* length of this record */
@@ -182,7 +182,7 @@
 /* cmos defaults record
         This record contains default settings for the cmos ram.
 */
-#define LB_TAG_OPTION_DEFAULTS 203
+#define CB_TAG_OPTION_DEFAULTS 203
 struct cmos_defaults {
 	uint32_t tag;		/* default type */
 	uint32_t size;		/* length of this record */
@@ -192,7 +192,7 @@
 	uint8_t default_set[CMOS_IMAGE_BUFFER_SIZE];	/* default settings */
 };
 
-#define LB_TAG_OPTION_CHECKSUM 204
+#define CB_TAG_OPTION_CHECKSUM 204
 struct cmos_checksum {
 	uint32_t tag;
 	uint32_t size;
Index: flashrom.c
===================================================================
--- flashrom.c	(revision 3490)
+++ flashrom.c	(working copy)
@@ -326,11 +326,11 @@
 			strtok(tempstr, ":");
 			tempstr2 = strtok(NULL, ":");
 			if (tempstr2) {
-				lb_vendor = tempstr;
-				lb_part = tempstr2;
+				cb_vendor = tempstr;
+				cb_part = tempstr2;
 			} else {
-				lb_vendor = NULL;
-				lb_part = tempstr;
+				cb_vendor = NULL;
+				cb_part = tempstr;
 			}
 			break;
 		case 'f':
@@ -398,7 +398,7 @@
 
 	myusec_calibrate_delay();
 
-	/* We look at the lbtable first to see if we need a
+	/* We look at the cbtable first to see if we need a
 	 * mainboard specific flash enable sequence.
 	 */
 	coreboot_init();
@@ -412,7 +412,7 @@
 		       "will most likely fail.\n");
 	}
 
-	board_flash_enable(lb_vendor, lb_part);
+	board_flash_enable(cb_vendor, cb_part);
 
 	for (i = 0; i < ARRAY_SIZE(flashes); i++) {
 		flashes[i] = probe_flash(i ? flashes[i - 1] + 1 : flashchips, 0);
Index: layout.c
===================================================================
--- layout.c	(revision 3490)
+++ layout.c	(working copy)
@@ -94,10 +94,10 @@
 	printf_debug("Mainboard ID: %s\n", mainboard_part);
 
 	/*
-	 * If lb_vendor is not set, the coreboot table was
+	 * If cb_vendor is not set, the coreboot table was
 	 * not found. Nor was -m VENDOR:PART specified.
 	 */
-	if (!lb_vendor || !lb_part) {
+	if (!cb_vendor || !cb_part) {
 		printf("Note: If the following flash access fails, "
 		       "try -m <vendor>:<mainboard>.\n");
 		return 0;
@@ -106,8 +106,8 @@
 	/* These comparisons are case insensitive to make things
 	 * a little less user^Werror prone. 
 	 */
-	if (!strcasecmp(mainboard_vendor, lb_vendor) &&
-	    !strcasecmp(mainboard_part, lb_part)) {
+	if (!strcasecmp(mainboard_vendor, cb_vendor) &&
+	    !strcasecmp(mainboard_part, cb_part)) {
 		printf_debug("This firmware image matches "
 			     "this motherboard.\n");
 	} else {
@@ -121,8 +121,8 @@
 			       "are absolutely sure that you\nare using a correct "
 			       "image for this mainboard or override\nthe detected "
 			       "values with --mainboard <vendor>:<mainboard>.\n\n",
-			       mainboard_vendor, mainboard_part, lb_vendor,
-			       lb_part);
+			       mainboard_vendor, mainboard_part, cb_vendor,
+			       cb_part);
 			exit(1);
 		}
 	}
Index: cbtable.c
===================================================================
--- cbtable.c	(revision 3490)
+++ cbtable.c	(working copy)
@@ -33,7 +33,7 @@
 #include "flash.h"
 #include "coreboot_tables.h"
 
-char *lb_part = NULL, *lb_vendor = NULL;
+char *cb_part = NULL, *cb_vendor = NULL;
 
 static unsigned long compute_checksum(void *addr, unsigned long length)
 {
@@ -69,37 +69,37 @@
 	return (~value.word) & 0xFFFF;
 }
 
-#define for_each_lbrec(head, rec) \
-	for(rec = (struct lb_record *)(((char *)head) + sizeof(*head)); \
+#define for_each_cbrec(head, rec) \
+	for(rec = (struct cb_record *)(((char *)head) + sizeof(*head)); \
 		(((char *)rec) < (((char *)head) + sizeof(*head) + head->table_bytes))  && \
 		(rec->size >= 1) && \
 		((((char *)rec) + rec->size) <= (((char *)head) + sizeof(*head) + head->table_bytes)); \
-		rec = (struct lb_record *)(((char *)rec) + rec->size))
+		rec = (struct cb_record *)(((char *)rec) + rec->size))
 
-static int count_lb_records(struct lb_header *head)
+static int count_cb_records(struct cb_header *head)
 {
-	struct lb_record *rec;
+	struct cb_record *rec;
 	int count;
 
 	count = 0;
-	for_each_lbrec(head, rec) {
+	for_each_cbrec(head, rec) {
 		count++;
 	}
 
 	return count;
 }
 
-static struct lb_header *find_lb_table(void *base, unsigned long start,
+static struct cb_header *find_cb_table(void *base, unsigned long start,
 				       unsigned long end)
 {
 	unsigned long addr;
 
 	/* For now be stupid.... */
 	for (addr = start; addr < end; addr += 16) {
-		struct lb_header *head =
-		    (struct lb_header *)(((char *)base) + addr);
-		struct lb_record *recs =
-		    (struct lb_record *)(((char *)base) + addr + sizeof(*head));
+		struct cb_header *head =
+		    (struct cb_header *)(((char *)base) + addr);
+		struct cb_record *recs =
+		    (struct cb_record *)(((char *)base) + addr + sizeof(*head));
 		if (memcmp(head->signature, "LBIO", 4) != 0)
 			continue;
 		printf_debug("Found canidate at: %08lx-%08lx\n",
@@ -109,7 +109,7 @@
 				head->header_bytes);
 			continue;
 		}
-		if (count_lb_records(head) != head->table_entries) {
+		if (count_cb_records(head) != head->table_entries) {
 			fprintf(stderr, "Bad record count: %d.\n",
 				head->table_entries);
 			continue;
@@ -132,13 +132,13 @@
 	return 0;
 }
 
-static void find_mainboard(struct lb_record *ptr, unsigned long addr)
+static void find_mainboard(struct cb_record *ptr, unsigned long addr)
 {
-	struct lb_mainboard *rec;
+	struct cb_mainboard *rec;
 	int max_size;
 	char vendor[256], part[256];
 
-	rec = (struct lb_mainboard *)ptr;
+	rec = (struct cb_mainboard *)ptr;
 	max_size = rec->size - sizeof(*rec);
 	printf("Vendor ID: %.*s, part ID: %.*s\n",
 	       max_size - rec->vendor_idx,
@@ -150,23 +150,23 @@
 	snprintf(part, 255, "%.*s", max_size - rec->part_number_idx,
 		 rec->strings + rec->part_number_idx);
 
-	if (lb_part) {
-		printf("Overwritten by command line, vendor ID: %s, part ID: %s.\n", lb_vendor, lb_part);
+	if (cb_part) {
+		printf("Overwritten by command line, vendor ID: %s, part ID: %s.\n", cb_vendor, cb_part);
 	} else {
-		lb_part = strdup(part);
-		lb_vendor = strdup(vendor);
+		cb_part = strdup(part);
+		cb_vendor = strdup(vendor);
 	}
 }
 
-static struct lb_record *next_record(struct lb_record *rec)
+static struct cb_record *next_record(struct cb_record *rec)
 {
-	return (struct lb_record *)(((char *)rec) + rec->size);
+	return (struct cb_record *)(((char *)rec) + rec->size);
 }
 
-static void search_lb_records(struct lb_record *rec, struct lb_record *last,
+static void search_cb_records(struct cb_record *rec, struct cb_record *last,
 			      unsigned long addr)
 {
-	struct lb_record *next;
+	struct cb_record *next;
 	int count;
 	count = 0;
 
@@ -174,7 +174,7 @@
 	     rec = next, addr += rec->size) {
 		next = next_record(rec);
 		count++;
-		if (rec->tag == LB_TAG_MAINBOARD) {
+		if (rec->tag == CB_TAG_MAINBOARD) {
 			find_mainboard(rec, addr);
 			break;
 		}
@@ -184,8 +184,8 @@
 int coreboot_init(void)
 {
 	uint8_t *low_1MB;
-	struct lb_header *lb_table;
-	struct lb_record *rec, *last;
+	struct cb_header *cb_table;
+	struct cb_record *rec, *last;
 
 	low_1MB = mmap(0, 1024 * 1024, PROT_READ, MAP_SHARED, fd_mem,
 		       0x00000000);
@@ -193,22 +193,22 @@
 		perror("Can't mmap memory using " MEM_DEV);
 		exit(-2);
 	}
-	lb_table = 0;
-	if (!lb_table)
-		lb_table = find_lb_table(low_1MB, 0x00000, 0x1000);
-	if (!lb_table)
-		lb_table = find_lb_table(low_1MB, 0xf0000, 1024 * 1024);
-	if (lb_table) {
+	cb_table = 0;
+	if (!cb_table)
+		cb_table = find_cb_table(low_1MB, 0x00000, 0x1000);
+	if (!cb_table)
+		cb_table = find_cb_table(low_1MB, 0xf0000, 1024 * 1024);
+	if (cb_table) {
 		unsigned long addr;
-		addr = ((char *)lb_table) - ((char *)low_1MB);
-		printf_debug("Coreboot table found at %p.\n", lb_table);
-		rec = (struct lb_record *)(((char *)lb_table) + lb_table->header_bytes);
-		last = (struct lb_record *)(((char *)rec) + lb_table->table_bytes);
+		addr = ((char *)cb_table) - ((char *)low_1MB);
+		printf_debug("Coreboot table found at %p.\n", cb_table);
+		rec = (struct cb_record *)(((char *)cb_table) + cb_table->header_bytes);
+		last = (struct cb_record *)(((char *)rec) + cb_table->table_bytes);
 		printf_debug("Coreboot header(%d) checksum: %04x table(%d) checksum: %04x entries: %d\n",
-		     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);
+		     cb_table->header_bytes, cb_table->header_checksum,
+		     cb_table->table_bytes, cb_table->table_checksum,
+		     cb_table->table_entries);
+		search_cb_records(rec, last, addr + cb_table->header_bytes);
 	} else {
 		printf("No coreboot table found.\n");
 		return -1;
Index: board_enable.c
===================================================================
--- board_enable.c	(revision 3490)
+++ board_enable.c	(working copy)
@@ -573,8 +573,8 @@
 	uint16_t second_card_device;
 
 	/* The vendor / part name from the coreboot table. */
-	const char *lb_vendor;
-	const char *lb_part;
+	const char *cb_vendor;
+	const char *cb_part;
 
 	const char *name;
 	int (*enable) (const char *name);
@@ -635,10 +635,10 @@
 	printf("\nSupported mainboards (this list is not exhaustive!):\n\n");
 
 	for (i = 0; board_pciid_enables[i].name != NULL; i++) {
-		if (board_pciid_enables[i].lb_vendor != NULL) {
+		if (board_pciid_enables[i].cb_vendor != NULL) {
 			printf("%s (-m %s:%s)\n", board_pciid_enables[i].name,
-			       board_pciid_enables[i].lb_vendor,
-			       board_pciid_enables[i].lb_part);
+			       board_pciid_enables[i].cb_vendor,
+			       board_pciid_enables[i].cb_part);
 		} else {
 			printf("%s (autodetected)\n",
 			       board_pciid_enables[i].name);
@@ -658,10 +658,10 @@
 	struct board_pciid_enable *partmatch = NULL;
 
 	for (; board->name; board++) {
-		if (vendor && (!board->lb_vendor || strcasecmp(board->lb_vendor, vendor)))
+		if (vendor && (!board->cb_vendor || strcasecmp(board->cb_vendor, vendor)))
 			continue;
 
-		if (!board->lb_part || strcasecmp(board->lb_part, part))
+		if (!board->cb_part || strcasecmp(board->cb_part, part))
 			continue;
 
 		if (!pci_dev_find(board->first_vendor, board->first_device))
@@ -678,7 +678,7 @@
 			/* a second entry has a matching part name */
 			printf("AMBIGUOUS BOARD NAME: %s\n", part);
 			printf("At least vendors '%s' and '%s' match.\n",
-				partmatch->lb_vendor, board->lb_vendor);
+				partmatch->cb_vendor, board->cb_vendor);
 			printf("Please use the full -m vendor:part syntax.\n");
 			return NULL;
 		}
--
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to