Merge branch 'for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
[linux-2.6-microblaze.git] / scripts / mod / file2alias.c
index fb48270..d21d287 100644 (file)
@@ -1375,6 +1375,28 @@ static int do_auxiliary_entry(const char *filename, void *symval, char *alias)
        return 1;
 }
 
+/*
+ * Looks like: ssam:dNcNtNiNfN
+ *
+ * N is exactly 2 digits, where each is an upper-case hex digit.
+ */
+static int do_ssam_entry(const char *filename, void *symval, char *alias)
+{
+       DEF_FIELD(symval, ssam_device_id, match_flags);
+       DEF_FIELD(symval, ssam_device_id, domain);
+       DEF_FIELD(symval, ssam_device_id, category);
+       DEF_FIELD(symval, ssam_device_id, target);
+       DEF_FIELD(symval, ssam_device_id, instance);
+       DEF_FIELD(symval, ssam_device_id, function);
+
+       sprintf(alias, "ssam:d%02Xc%02X", domain, category);
+       ADD(alias, "t", match_flags & SSAM_MATCH_TARGET, target);
+       ADD(alias, "i", match_flags & SSAM_MATCH_INSTANCE, instance);
+       ADD(alias, "f", match_flags & SSAM_MATCH_FUNCTION, function);
+
+       return 1;
+}
+
 /* Does namelen bytes of name exactly match the symbol? */
 static bool sym_is(const char *name, unsigned namelen, const char *symbol)
 {
@@ -1450,6 +1472,7 @@ static const struct devtable devtable[] = {
        {"wmi", SIZE_wmi_device_id, do_wmi_entry},
        {"mhi", SIZE_mhi_device_id, do_mhi_entry},
        {"auxiliary", SIZE_auxiliary_device_id, do_auxiliary_entry},
+       {"ssam", SIZE_ssam_device_id, do_ssam_entry},
 };
 
 /* Create MODULE_ALIAS() statements.