diff -rup -x '.*.[^ch]' modutils-2.4.26/module-init-tools-3.0-pre10/depmod.c modutils-2.4.26.devel/module-init-tools-3.0-pre10/depmod.c --- modutils-2.4.26/module-init-tools-3.0-pre10/depmod.c 2004-09-07 04:49:52.104112544 -0400 +++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/depmod.c 2004-09-07 04:08:46.446949408 -0400 @@ -648,6 +648,7 @@ static struct depfile depfiles[] = { { "modules.ieee1394map", output_ieee1394_table }, { "modules.isapnpmap", output_isapnp_table }, { "modules.inputmap", output_input_table }, + { "modules.ofmap", output_of_table }, { "modules.alias", output_aliases }, { "modules.symbols", output_symbols }, }; diff -rup -x '.*.[^ch]' modutils-2.4.26/module-init-tools-3.0-pre10/depmod.h modutils-2.4.26.devel/module-init-tools-3.0-pre10/depmod.h --- modutils-2.4.26/module-init-tools-3.0-pre10/depmod.h 2003-12-23 21:10:57.000000000 -0500 +++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/depmod.h 2004-09-07 04:08:56.221463456 -0400 @@ -47,6 +47,8 @@ struct module void *pnp_card_table; unsigned int input_size; void *input_table; + unsigned int of_size; + void *of_table; /* File contents and length. */ void *data; diff -rup -x '.*.[^ch]' modutils-2.4.26/module-init-tools-3.0-pre10/moduleops_core.c modutils-2.4.26.devel/module-init-tools-3.0-pre10/moduleops_core.c --- modutils-2.4.26/module-init-tools-3.0-pre10/moduleops_core.c 2003-12-24 00:17:07.000000000 -0500 +++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/moduleops_core.c 2004-09-07 04:15:23.918524544 -0400 @@ -192,6 +192,11 @@ static void PERBIT(fetch_tables)(struct module->input_size = PERBIT(INPUT_DEVICE_SIZE); module->input_table = PERBIT(deref_sym)(module->data, "__mod_input_device_table"); + + module->of_size = PERBIT(OF_DEVICE_SIZE); + module->of_table = PERBIT(deref_sym)(module->data, + "__mod_of_device_table"); + } struct module_ops PERBIT(mod_ops) = { diff -rup -x '.*.[^ch]' modutils-2.4.26/module-init-tools-3.0-pre10/tables.c modutils-2.4.26.devel/module-init-tools-3.0-pre10/tables.c --- modutils-2.4.26/module-init-tools-3.0-pre10/tables.c 2003-12-24 00:23:38.000000000 -0500 +++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/tables.c 2004-09-07 04:45:51.761650152 -0400 @@ -340,3 +340,33 @@ void output_input_table(struct module *m } } } + +/* We set driver_data to zero */ +static void output_of_entry(struct of_device_id *dev, char *name, FILE *out) +{ + + fprintf (out, "%-20s %-20s %-20s %s\n", + name, + dev->name[0] ? dev->name : "*", + dev->type[0] ? dev->type : "*", + dev->compatible[0] ? dev->compatible : "*"); +} + +void output_of_table(struct module *modules, FILE *out) +{ + struct module *i; + + fprintf (out, "# of module name type compatible\n"); + for (i = modules; i; i = i->next) { + struct of_device_id *e; + char shortname[strlen(i->pathname) + 1]; + + if (!i->of_table) + continue; + + make_shortname(shortname, i->pathname); + for (e = i->of_table; e->name[0]|e->type[0]|e->compatible[0]; + e = (void *)e + i->of_size) + output_of_entry(e, shortname, out); + } +} diff -rup -x '.*.[^ch]' modutils-2.4.26/module-init-tools-3.0-pre10/tables.h modutils-2.4.26.devel/module-init-tools-3.0-pre10/tables.h --- modutils-2.4.26/module-init-tools-3.0-pre10/tables.h 2003-12-24 00:18:54.000000000 -0500 +++ modutils-2.4.26.devel/module-init-tools-3.0-pre10/tables.h 2004-09-07 04:46:59.057419640 -0400 @@ -116,6 +116,16 @@ struct input_device_id_32 { #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) +#define MAX_OF_NAMELEN (32) +struct of_device_id { + char name[MAX_OF_NAMELEN]; + char type[MAX_OF_NAMELEN]; + char compatible[MAX_OF_NAMELEN]; +}; + +#define OF_DEVICE_SIZE32 (MAX_OF_NAMELEN * 3 + 4) +#define OF_DEVICE_SIZE64 (MAX_OF_NAMELEN * 3 + 8) + /* Functions provided by tables.c */ struct module; void output_usb_table(struct module *modules, FILE *out); @@ -124,5 +134,6 @@ void output_pci_table(struct module *mod 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_of_table(struct module *modules, FILE *out); #endif /* MODINITTOOLS_TABLES_H */