diff options
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r-- | scripts/mod/file2alias.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 1924990a737f..23708636b05c 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -42,7 +42,7 @@ typedef unsigned char __u8; /* This array collects all instances that use the generic do_table */ struct devtable { - const char *device_id; /* name of table, __mod_<name>__*_device_table. */ + const char *device_id; /* name of table, __mod_<name>_device_table. */ unsigned long id_size; void *function; }; @@ -146,8 +146,7 @@ static void device_id_check(const char *modname, const char *device_id, if (size % id_size || size < id_size) { fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo " - "of the size of " - "section __mod_%s__<identifier>_device_table=%lu.\n" + "of the size of section __mod_%s_device_table=%lu.\n" "Fix definition of struct %s_device_id " "in mod_devicetable.h\n", modname, device_id, id_size, device_id, size, device_id); @@ -211,8 +210,8 @@ static void do_usb_entry(void *symval, range_lo < 0x9 ? "[%X-9" : "[%X", range_lo); sprintf(alias + strlen(alias), - range_hi > 0xA ? "A-%X]" : "%X]", - range_hi); + range_hi > 0xA ? "a-%X]" : "%X]", + range_lo); } } if (bcdDevice_initial_digits < (sizeof(bcdDevice_lo) * 2 - 1)) @@ -1111,7 +1110,7 @@ static int do_amba_entry(const char *filename, } ADD_TO_DEVTABLE("amba", amba_id, do_amba_entry); -/* LOOKS like cpu:type:x86,venVVVVfamFFFFmodMMMM:feature:*,FEAT,* +/* LOOKS like x86cpu:vendor:VVVV:family:FFFF:model:MMMM:feature:*,FEAT,* * All fields are numbers. It would be nicer to use strings for vendor * and feature, but getting those out of the build system here is too * complicated. @@ -1125,10 +1124,10 @@ static int do_x86cpu_entry(const char *filename, void *symval, DEF_FIELD(symval, x86_cpu_id, model); DEF_FIELD(symval, x86_cpu_id, vendor); - strcpy(alias, "cpu:type:x86,"); - ADD(alias, "ven", vendor != X86_VENDOR_ANY, vendor); - ADD(alias, "fam", family != X86_FAMILY_ANY, family); - ADD(alias, "mod", model != X86_MODEL_ANY, model); + strcpy(alias, "x86cpu:"); + ADD(alias, "vendor:", vendor != X86_VENDOR_ANY, vendor); + ADD(alias, ":family:", family != X86_FAMILY_ANY, family); + ADD(alias, ":model:", model != X86_MODEL_ANY, model); strcat(alias, ":feature:*"); if (feature != X86_FEATURE_ANY) sprintf(alias + strlen(alias), "%04X*", feature); @@ -1136,16 +1135,6 @@ static int do_x86cpu_entry(const char *filename, void *symval, } ADD_TO_DEVTABLE("x86cpu", x86_cpu_id, do_x86cpu_entry); -/* LOOKS like cpu:type:*:feature:*FEAT* */ -static int do_cpu_entry(const char *filename, void *symval, char *alias) -{ - DEF_FIELD(symval, cpu_feature, feature); - - sprintf(alias, "cpu:type:*:feature:*%04X*", feature); - return 1; -} -ADD_TO_DEVTABLE("cpu", cpu_feature, do_cpu_entry); - /* Looks like: mei:S */ static int do_mei_entry(const char *filename, void *symval, char *alias) @@ -1217,7 +1206,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, { void *symval; char *zeros = NULL; - const char *name, *identifier; + const char *name; unsigned int namelen; /* We're looking for a section relative symbol */ @@ -1228,7 +1217,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT) return; - /* All our symbols are of form <prefix>__mod_<name>__<identifier>_device_table. */ + /* All our symbols are of form <prefix>__mod_XXX_device_table. */ name = strstr(symname, "__mod_"); if (!name) return; @@ -1238,10 +1227,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, return; if (strcmp(name + namelen - strlen("_device_table"), "_device_table")) return; - identifier = strstr(name, "__"); - if (!identifier) - return; - namelen = identifier - name; + namelen -= strlen("_device_table"); /* Handle all-NULL symbols allocated into .bss */ if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) { |