Skip to contentSkip to conversation

x86: coreboot: make it possible to process unhandled tags

PATCH New Christian Gmeiner 2 participants 3 messages Apr 17, 2019 – May 16, 2019 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: coreboot: make it possible to process unhandled tags

coreboot makes it possible to add own entries into coreboot's table at a per mainboard basis. As there might be some custom ones it makes sense to provide a way to process them.

---
 arch/x86/cpu/coreboot/tables.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/x86/cpu/coreboot/tables.c +5 -0
index bc18b710c9..a7c55c7dd1 100644
@@ -109,6 +109,8 @@ static void cb_parse_string(unsigned char *ptr, char **info)
 	*info = (char *)((struct cb_string *)ptr)->string;
 }
 
+__weak void cb_parse_unhandled(u32 tag, unsigned char *ptr) {}
+
 static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
 {
 	struct cb_header *header;
@@ -211,6 +213,9 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
 		case CB_TAG_VBNV:
 			cb_parse_vbnv(ptr, info);
 			break;
+		default:
+			cb_parse_unhandled(rec->tag, ptr);
+			break;
 		}
 
 		ptr += rec->size;
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 x86: coreboot: make it possible to process unhandled tags

Quoted 10 lines · Christian Gmeiner

coreboot makes it possible to add own entries into coreboot's table at a per mainboard basis. As there might be some custom ones it makes sense to provide a way to process them.

---
 arch/x86/cpu/coreboot/tables.c | 5 +++++
 1 file changed, 5 insertions(+)

arch/x86/cpu/coreboot/tables.c static void cb_parse_string(unsigned char *ptr, char **info) · line 113

Quoted 10 lines
arch/x86/cpu/coreboot/tables.c +2 -0
index bc18b710c9..a7c55c7dd1 100644
@@ -109,6 +109,8 @@ static void cb_parse_string(unsigned char *ptr, char **info)
        *info = (char *)((struct cb_string *)ptr)->string;
 }
 
+__weak void cb_parse_unhandled(u32 tag, unsigned char *ptr) {}
+

nits: I would prefer to have {} in sparate lines.

I can fix this when applying.

Quoted 14 lines
arch/x86/cpu/coreboot/tables.c +3 -1
 static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
 {
        struct cb_header *header;
@@ -211,6 +213,9 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
                case CB_TAG_VBNV:
                        cb_parse_vbnv(ptr, info);
                        break;
+               default:
+                       cb_parse_unhandled(rec->tag, ptr);
+                       break;
                }
 
                ptr += rec->size;
--
#2 lore raw

PATCH 1/1 x86: coreboot: make it possible to process unhandled tags

Quoted 24 lines · Bin Meng
Quoted 10 lines · Christian Gmeiner

coreboot makes it possible to add own entries into coreboot's table at a per mainboard basis. As there might be some custom ones it makes sense to provide a way to process them.

---
 arch/x86/cpu/coreboot/tables.c | 5 +++++
 1 file changed, 5 insertions(+)
Quoted 8 lines
arch/x86/cpu/coreboot/tables.c +0 -0
index bc18b710c9..a7c55c7dd1 100644
@@ -109,6 +109,8 @@ static void cb_parse_string(unsigned char *ptr, char **info)
        *info = (char *)((struct cb_string *)ptr)->string;
 }
 
Quoted 6 lines

arch/x86/cpu/coreboot/tables.c static void cb_parse_string(unsigned char *ptr, char **info) · line 113

Quoted 2 lines
arch/x86/cpu/coreboot/tables.c +2 -0
+__weak void cb_parse_unhandled(u32 tag, unsigned char *ptr) {}
+

nits: I would prefer to have {} in sparate lines.

I can fix this when applying.

Fixed the nits and applied to u-boot-x86, thanks!