aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index b89efe6e4c85..44ddaa542db6 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1029,6 +1029,31 @@ static int do_amba_entry(const char *filename,
1029} 1029}
1030ADD_TO_DEVTABLE("amba", struct amba_id, do_amba_entry); 1030ADD_TO_DEVTABLE("amba", struct amba_id, do_amba_entry);
1031 1031
1032/* LOOKS like x86cpu:vendor:VVVV:family:FFFF:model:MMMM:feature:*,FEAT,*
1033 * All fields are numbers. It would be nicer to use strings for vendor
1034 * and feature, but getting those out of the build system here is too
1035 * complicated.
1036 */
1037
1038static int do_x86cpu_entry(const char *filename, struct x86_cpu_id *id,
1039 char *alias)
1040{
1041 id->feature = TO_NATIVE(id->feature);
1042 id->family = TO_NATIVE(id->family);
1043 id->model = TO_NATIVE(id->model);
1044 id->vendor = TO_NATIVE(id->vendor);
1045
1046 strcpy(alias, "x86cpu:");
1047 ADD(alias, "vendor:", id->vendor != X86_VENDOR_ANY, id->vendor);
1048 ADD(alias, ":family:", id->family != X86_FAMILY_ANY, id->family);
1049 ADD(alias, ":model:", id->model != X86_MODEL_ANY, id->model);
1050 strcat(alias, ":feature:*");
1051 if (id->feature != X86_FEATURE_ANY)
1052 sprintf(alias + strlen(alias), "%04X*", id->feature);
1053 return 1;
1054}
1055ADD_TO_DEVTABLE("x86cpu", struct x86_cpu_id, do_x86cpu_entry);
1056
1032/* Does namelen bytes of name exactly match the symbol? */ 1057/* Does namelen bytes of name exactly match the symbol? */
1033static bool sym_is(const char *name, unsigned namelen, const char *symbol) 1058static bool sym_is(const char *name, unsigned namelen, const char *symbol)
1034{ 1059{
@@ -1075,6 +1100,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
1075 if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections) 1100 if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections)
1076 return; 1101 return;
1077 1102
1103 /* We're looking for an object */
1104 if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT)
1105 return;
1106
1078 /* All our symbols are of form <prefix>__mod_XXX_device_table. */ 1107 /* All our symbols are of form <prefix>__mod_XXX_device_table. */
1079 name = strstr(symname, "__mod_"); 1108 name = strstr(symname, "__mod_");
1080 if (!name) 1109 if (!name)