MCPcopy Create free account
hub / github.com/coreboot/coreboot / smbios_add_string

Function smbios_add_string

src/lib/smbios.c:31–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31int smbios_add_string(u8 *start, const char *str)
32{
33 int i = 1;
34 char *p = (char *)start;
35
36 /*
37 * Return 0 as required for empty strings.
38 * See Section 6.1.3 "Text Strings" of the SMBIOS specification.
39 */
40 if (str == NULL || *str == '\0')
41 return 0;
42
43 for (;;) {
44 if (!*p) {
45 strcpy(p, str);
46 p += strlen(str);
47 *p++ = '\0';
48 *p++ = '\0';
49 return i;
50 }
51
52 if (!strcmp(p, str))
53 return i;
54
55 p += strlen(p)+1;
56 i++;
57 }
58}
59
60int smbios_string_table_len(u8 *start)
61{

Callers 15

smbios_processor_nameFunction · 0.85
smbios_write_type4Function · 0.85
smbios_cpu_vendorFunction · 0.85
smbios_processor_nameFunction · 0.85
smbios_write_type4Function · 0.85
smbios_fill_dimm_locatorFunction · 0.85
smbios_fill_dimm_locatorFunction · 0.85
qemu_get_smbios_data17Function · 0.85
lumpy_smbios_type41_irqFunction · 0.85
mainboard_smbios_type17Function · 0.85
smbios_fill_dimm_locatorFunction · 0.85

Calls 3

strlenFunction · 0.85
strcpyFunction · 0.70
strcmpFunction · 0.70

Tested by

no test coverage detected