--- tables.c~ 2003-12-24 05:23:38.000000000 +0000 +++ tables.c 2005-04-02 13:12:24.370140112 +0100 @@ -18,6 +18,34 @@ } /* We set driver_data to zero */ +static void output_soc_entry(struct soc_device_id *soc, char *name, FILE *out) +{ + fprintf(out, + "%-20s 0x%08x 0x0\n", + name, + soc->id); +} + +void output_soc_table(struct module *modules, FILE *out) +{ + struct module *i; + + fprintf(out, "# soc module id driver_data\n"); + + for (i = modules; i; i = i->next) { + struct soc_device_id *e; + char shortname[strlen(i->pathname) + 1]; + + if (!i->soc_table) + continue; + + make_shortname(shortname, i->pathname); + for (e = i->soc_table; e->id; e = (void *)e + i->soc_size) + output_soc_entry(e, shortname, out); + } +} + +/* We set driver_data to zero */ static void output_pci_entry(struct pci_device_id *pci, char *name, FILE *out) { fprintf(out, --- tables.h~ 2003-12-24 05:18:54.000000000 +0000 +++ tables.h 2005-04-02 13:05:15.269373344 +0100 @@ -116,6 +116,15 @@ #define INPUT_DEVICE_SIZE32 (4 + 4 * 2 + 4 + 16 * 4 + 4 + 2 * 4 + 4 + 4 + 4 + 4 * 4 + 4) #define INPUT_DEVICE_SIZE64 (8 + 4 * 2 + 8 + 8 * 8 + 8 + 8 + 8 + 8 + 8 + 2 * 8 + 8) +#include + +typedef struct soc_device_id { + uint32_t id; +} soc_device_id; + +#define SOC_DEVICE_SIZE32 (4 + 4) +#define SOC_DEVICE_SIZE64 (4 + 8) + /* Functions provided by tables.c */ struct module; void output_usb_table(struct module *modules, FILE *out); @@ -124,5 +133,6 @@ void output_ccw_table(struct module *modules, FILE *out); void output_isapnp_table(struct module *modules, FILE *out); void output_input_table(struct module *modules, FILE *out); +void output_soc_table(struct module *modules, FILE *out); #endif /* MODINITTOOLS_TABLES_H */ --- moduleops_core.c~ 2004-08-12 06:08:35.000000000 +0100 +++ moduleops_core.c 2005-04-02 13:04:13.367783816 +0100 @@ -196,6 +196,11 @@ module->input_size = PERBIT(INPUT_DEVICE_SIZE); module->input_table = PERBIT(deref_sym)(module->data, "__mod_input_device_table"); + + module->soc_size = PERBIT(SOC_DEVICE_SIZE); + module->soc_table = PERBIT(deref_sym)(module->data, + "__mod_soc_device_table"); + } struct module_ops PERBIT(mod_ops) = { --- depmod.h~ 2003-12-24 02:10:57.000000000 +0000 +++ depmod.h 2005-04-02 13:03:19.006048056 +0100 @@ -47,6 +47,8 @@ void *pnp_card_table; unsigned int input_size; void *input_table; + unsigned int soc_size; + void *soc_table; /* File contents and length. */ void *data; --- depmod.c~ 2005-02-14 04:50:51.744716656 +0000 +++ depmod.c 2005-04-02 13:03:37.051304760 +0100 @@ -683,6 +683,7 @@ { "modules.ieee1394map", output_ieee1394_table }, { "modules.isapnpmap", output_isapnp_table }, { "modules.inputmap", output_input_table }, + { "modules.socmap", output_soc_table }, { "modules.alias", output_aliases }, { "modules.symbols", output_symbols }, };