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.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 45f9a3377dcd..23708636b05c 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -79,10 +79,12 @@ struct devtable **__start___devtable, **__stop___devtable;
79extern struct devtable *__start___devtable[], *__stop___devtable[]; 79extern struct devtable *__start___devtable[], *__stop___devtable[];
80#endif /* __MACH__ */ 80#endif /* __MACH__ */
81 81
82#if __GNUC__ == 3 && __GNUC_MINOR__ < 3 82#if !defined(__used)
83# define __used __attribute__((__unused__)) 83# if __GNUC__ == 3 && __GNUC_MINOR__ < 3
84#else 84# define __used __attribute__((__unused__))
85# define __used __attribute__((__used__)) 85# else
86# define __used __attribute__((__used__))
87# endif
86#endif 88#endif
87 89
88/* Define a variable f that holds the value of field f of struct devid 90/* Define a variable f that holds the value of field f of struct devid
@@ -1145,6 +1147,26 @@ static int do_mei_entry(const char *filename, void *symval,
1145} 1147}
1146ADD_TO_DEVTABLE("mei", mei_cl_device_id, do_mei_entry); 1148ADD_TO_DEVTABLE("mei", mei_cl_device_id, do_mei_entry);
1147 1149
1150/* Looks like: rapidio:vNdNavNadN */
1151static int do_rio_entry(const char *filename,
1152 void *symval, char *alias)
1153{
1154 DEF_FIELD(symval, rio_device_id, did);
1155 DEF_FIELD(symval, rio_device_id, vid);
1156 DEF_FIELD(symval, rio_device_id, asm_did);
1157 DEF_FIELD(symval, rio_device_id, asm_vid);
1158
1159 strcpy(alias, "rapidio:");
1160 ADD(alias, "v", vid != RIO_ANY_ID, vid);
1161 ADD(alias, "d", did != RIO_ANY_ID, did);
1162 ADD(alias, "av", asm_vid != RIO_ANY_ID, asm_vid);
1163 ADD(alias, "ad", asm_did != RIO_ANY_ID, asm_did);
1164
1165 add_wildcard(alias);
1166 return 1;
1167}
1168ADD_TO_DEVTABLE("rapidio", rio_device_id, do_rio_entry);
1169
1148/* Does namelen bytes of name exactly match the symbol? */ 1170/* Does namelen bytes of name exactly match the symbol? */
1149static bool sym_is(const char *name, unsigned namelen, const char *symbol) 1171static bool sym_is(const char *name, unsigned namelen, const char *symbol)
1150{ 1172{