diff options
Diffstat (limited to 'scripts/mod')
| -rw-r--r-- | scripts/mod/file2alias.c | 222 |
1 files changed, 101 insertions, 121 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 363ab4666b17..c0e14b3f2306 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
| @@ -28,6 +28,7 @@ typedef Elf64_Addr kernel_ulong_t; | |||
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
| 30 | #include <ctype.h> | 30 | #include <ctype.h> |
| 31 | #include <stdbool.h> | ||
| 31 | 32 | ||
| 32 | typedef uint32_t __u32; | 33 | typedef uint32_t __u32; |
| 33 | typedef uint16_t __u16; | 34 | typedef uint16_t __u16; |
| @@ -38,6 +39,35 @@ typedef unsigned char __u8; | |||
| 38 | * we handle those differences explicitly below */ | 39 | * we handle those differences explicitly below */ |
| 39 | #include "../../include/linux/mod_devicetable.h" | 40 | #include "../../include/linux/mod_devicetable.h" |
| 40 | 41 | ||
| 42 | /* This array collects all instances that use the generic do_table */ | ||
| 43 | struct devtable { | ||
| 44 | const char *device_id; /* name of table, __mod_<name>_device_table. */ | ||
| 45 | unsigned long id_size; | ||
| 46 | void *function; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* We construct a table of pointers in an ELF section (pointers generally | ||
| 50 | * go unpadded by gcc). ld creates boundary syms for us. */ | ||
| 51 | extern struct devtable *__start___devtable[], *__stop___devtable[]; | ||
| 52 | #define ___cat(a,b) a ## b | ||
| 53 | #define __cat(a,b) ___cat(a,b) | ||
| 54 | |||
| 55 | #if __GNUC__ == 3 && __GNUC_MINOR__ < 3 | ||
| 56 | # define __used __attribute__((__unused__)) | ||
| 57 | #else | ||
| 58 | # define __used __attribute__((__used__)) | ||
| 59 | #endif | ||
| 60 | |||
| 61 | /* Add a table entry. We test function type matches while we're here. */ | ||
| 62 | #define ADD_TO_DEVTABLE(device_id, type, function) \ | ||
| 63 | static struct devtable __cat(devtable,__LINE__) = { \ | ||
| 64 | device_id + 0*sizeof((function)((const char *)NULL, \ | ||
| 65 | (type *)NULL, \ | ||
| 66 | (char *)NULL)), \ | ||
| 67 | sizeof(type), (function) }; \ | ||
| 68 | static struct devtable *__attribute__((section("__devtable"))) \ | ||
| 69 | __used __cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__) | ||
| 70 | |||
| 41 | #define ADD(str, sep, cond, field) \ | 71 | #define ADD(str, sep, cond, field) \ |
| 42 | do { \ | 72 | do { \ |
| 43 | strcat(str, sep); \ | 73 | strcat(str, sep); \ |
| @@ -289,6 +319,7 @@ static int do_hid_entry(const char *filename, | |||
| 289 | 319 | ||
| 290 | return 1; | 320 | return 1; |
| 291 | } | 321 | } |
| 322 | ADD_TO_DEVTABLE("hid", struct hid_device_id, do_hid_entry); | ||
| 292 | 323 | ||
| 293 | /* Looks like: ieee1394:venNmoNspNverN */ | 324 | /* Looks like: ieee1394:venNmoNspNverN */ |
| 294 | static int do_ieee1394_entry(const char *filename, | 325 | static int do_ieee1394_entry(const char *filename, |
| @@ -313,6 +344,7 @@ static int do_ieee1394_entry(const char *filename, | |||
| 313 | add_wildcard(alias); | 344 | add_wildcard(alias); |
| 314 | return 1; | 345 | return 1; |
| 315 | } | 346 | } |
| 347 | ADD_TO_DEVTABLE("ieee1394", struct ieee1394_device_id, do_ieee1394_entry); | ||
| 316 | 348 | ||
| 317 | /* Looks like: pci:vNdNsvNsdNbcNscNiN. */ | 349 | /* Looks like: pci:vNdNsvNsdNbcNscNiN. */ |
| 318 | static int do_pci_entry(const char *filename, | 350 | static int do_pci_entry(const char *filename, |
| @@ -356,6 +388,7 @@ static int do_pci_entry(const char *filename, | |||
| 356 | add_wildcard(alias); | 388 | add_wildcard(alias); |
| 357 | return 1; | 389 | return 1; |
| 358 | } | 390 | } |
| 391 | ADD_TO_DEVTABLE("pci", struct pci_device_id, do_pci_entry); | ||
| 359 | 392 | ||
| 360 | /* looks like: "ccw:tNmNdtNdmN" */ | 393 | /* looks like: "ccw:tNmNdtNdmN" */ |
| 361 | static int do_ccw_entry(const char *filename, | 394 | static int do_ccw_entry(const char *filename, |
| @@ -379,6 +412,7 @@ static int do_ccw_entry(const char *filename, | |||
| 379 | add_wildcard(alias); | 412 | add_wildcard(alias); |
| 380 | return 1; | 413 | return 1; |
| 381 | } | 414 | } |
| 415 | ADD_TO_DEVTABLE("ccw", struct ccw_device_id, do_ccw_entry); | ||
| 382 | 416 | ||
| 383 | /* looks like: "ap:tN" */ | 417 | /* looks like: "ap:tN" */ |
| 384 | static int do_ap_entry(const char *filename, | 418 | static int do_ap_entry(const char *filename, |
| @@ -387,6 +421,7 @@ static int do_ap_entry(const char *filename, | |||
| 387 | sprintf(alias, "ap:t%02X*", id->dev_type); | 421 | sprintf(alias, "ap:t%02X*", id->dev_type); |
| 388 | return 1; | 422 | return 1; |
| 389 | } | 423 | } |
| 424 | ADD_TO_DEVTABLE("ap", struct ap_device_id, do_ap_entry); | ||
| 390 | 425 | ||
| 391 | /* looks like: "css:tN" */ | 426 | /* looks like: "css:tN" */ |
| 392 | static int do_css_entry(const char *filename, | 427 | static int do_css_entry(const char *filename, |
| @@ -395,6 +430,7 @@ static int do_css_entry(const char *filename, | |||
| 395 | sprintf(alias, "css:t%01X", id->type); | 430 | sprintf(alias, "css:t%01X", id->type); |
| 396 | return 1; | 431 | return 1; |
| 397 | } | 432 | } |
| 433 | ADD_TO_DEVTABLE("css", struct css_device_id, do_css_entry); | ||
| 398 | 434 | ||
| 399 | /* Looks like: "serio:tyNprNidNexN" */ | 435 | /* Looks like: "serio:tyNprNidNexN" */ |
| 400 | static int do_serio_entry(const char *filename, | 436 | static int do_serio_entry(const char *filename, |
| @@ -414,6 +450,7 @@ static int do_serio_entry(const char *filename, | |||
| 414 | add_wildcard(alias); | 450 | add_wildcard(alias); |
| 415 | return 1; | 451 | return 1; |
| 416 | } | 452 | } |
| 453 | ADD_TO_DEVTABLE("serio", struct serio_device_id, do_serio_entry); | ||
| 417 | 454 | ||
| 418 | /* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */ | 455 | /* looks like: "acpi:ACPI0003 or acpi:PNP0C0B" or "acpi:LNXVIDEO" */ |
| 419 | static int do_acpi_entry(const char *filename, | 456 | static int do_acpi_entry(const char *filename, |
| @@ -422,6 +459,7 @@ static int do_acpi_entry(const char *filename, | |||
| 422 | sprintf(alias, "acpi*:%s:*", id->id); | 459 | sprintf(alias, "acpi*:%s:*", id->id); |
| 423 | return 1; | 460 | return 1; |
| 424 | } | 461 | } |
| 462 | ADD_TO_DEVTABLE("acpi", struct acpi_device_id, do_acpi_entry); | ||
| 425 | 463 | ||
| 426 | /* looks like: "pnp:dD" */ | 464 | /* looks like: "pnp:dD" */ |
| 427 | static void do_pnp_device_entry(void *symval, unsigned long size, | 465 | static void do_pnp_device_entry(void *symval, unsigned long size, |
| @@ -544,8 +582,7 @@ static int do_pcmcia_entry(const char *filename, | |||
| 544 | add_wildcard(alias); | 582 | add_wildcard(alias); |
| 545 | return 1; | 583 | return 1; |
| 546 | } | 584 | } |
| 547 | 585 | ADD_TO_DEVTABLE("pcmcia", struct pcmcia_device_id, do_pcmcia_entry); | |
| 548 | |||
| 549 | 586 | ||
| 550 | static int do_of_entry (const char *filename, struct of_device_id *of, char *alias) | 587 | static int do_of_entry (const char *filename, struct of_device_id *of, char *alias) |
| 551 | { | 588 | { |
| @@ -568,6 +605,7 @@ static int do_of_entry (const char *filename, struct of_device_id *of, char *ali | |||
| 568 | add_wildcard(alias); | 605 | add_wildcard(alias); |
| 569 | return 1; | 606 | return 1; |
| 570 | } | 607 | } |
| 608 | ADD_TO_DEVTABLE("of", struct of_device_id, do_of_entry); | ||
| 571 | 609 | ||
| 572 | static int do_vio_entry(const char *filename, struct vio_device_id *vio, | 610 | static int do_vio_entry(const char *filename, struct vio_device_id *vio, |
| 573 | char *alias) | 611 | char *alias) |
| @@ -585,6 +623,7 @@ static int do_vio_entry(const char *filename, struct vio_device_id *vio, | |||
| 585 | add_wildcard(alias); | 623 | add_wildcard(alias); |
| 586 | return 1; | 624 | return 1; |
| 587 | } | 625 | } |
| 626 | ADD_TO_DEVTABLE("vio", struct vio_device_id, do_vio_entry); | ||
| 588 | 627 | ||
| 589 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 628 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
| 590 | 629 | ||
| @@ -640,6 +679,7 @@ static int do_input_entry(const char *filename, struct input_device_id *id, | |||
| 640 | do_input(alias, id->swbit, 0, INPUT_DEVICE_ID_SW_MAX); | 679 | do_input(alias, id->swbit, 0, INPUT_DEVICE_ID_SW_MAX); |
| 641 | return 1; | 680 | return 1; |
| 642 | } | 681 | } |
| 682 | ADD_TO_DEVTABLE("input", struct input_device_id, do_input_entry); | ||
| 643 | 683 | ||
| 644 | static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa, | 684 | static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa, |
| 645 | char *alias) | 685 | char *alias) |
| @@ -650,6 +690,7 @@ static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa, | |||
| 650 | strcat(alias, "*"); | 690 | strcat(alias, "*"); |
| 651 | return 1; | 691 | return 1; |
| 652 | } | 692 | } |
| 693 | ADD_TO_DEVTABLE("eisa", struct eisa_device_id, do_eisa_entry); | ||
| 653 | 694 | ||
| 654 | /* Looks like: parisc:tNhvNrevNsvN */ | 695 | /* Looks like: parisc:tNhvNrevNsvN */ |
| 655 | static int do_parisc_entry(const char *filename, struct parisc_device_id *id, | 696 | static int do_parisc_entry(const char *filename, struct parisc_device_id *id, |
| @@ -669,6 +710,7 @@ static int do_parisc_entry(const char *filename, struct parisc_device_id *id, | |||
| 669 | add_wildcard(alias); | 710 | add_wildcard(alias); |
| 670 | return 1; | 711 | return 1; |
| 671 | } | 712 | } |
| 713 | ADD_TO_DEVTABLE("parisc", struct parisc_device_id, do_parisc_entry); | ||
| 672 | 714 | ||
| 673 | /* Looks like: sdio:cNvNdN. */ | 715 | /* Looks like: sdio:cNvNdN. */ |
| 674 | static int do_sdio_entry(const char *filename, | 716 | static int do_sdio_entry(const char *filename, |
| @@ -685,6 +727,7 @@ static int do_sdio_entry(const char *filename, | |||
| 685 | add_wildcard(alias); | 727 | add_wildcard(alias); |
| 686 | return 1; | 728 | return 1; |
| 687 | } | 729 | } |
| 730 | ADD_TO_DEVTABLE("sdio", struct sdio_device_id, do_sdio_entry); | ||
| 688 | 731 | ||
| 689 | /* Looks like: ssb:vNidNrevN. */ | 732 | /* Looks like: ssb:vNidNrevN. */ |
| 690 | static int do_ssb_entry(const char *filename, | 733 | static int do_ssb_entry(const char *filename, |
| @@ -701,6 +744,7 @@ static int do_ssb_entry(const char *filename, | |||
| 701 | add_wildcard(alias); | 744 | add_wildcard(alias); |
| 702 | return 1; | 745 | return 1; |
| 703 | } | 746 | } |
| 747 | ADD_TO_DEVTABLE("ssb", struct ssb_device_id, do_ssb_entry); | ||
| 704 | 748 | ||
| 705 | /* Looks like: bcma:mNidNrevNclN. */ | 749 | /* Looks like: bcma:mNidNrevNclN. */ |
| 706 | static int do_bcma_entry(const char *filename, | 750 | static int do_bcma_entry(const char *filename, |
| @@ -719,6 +763,7 @@ static int do_bcma_entry(const char *filename, | |||
| 719 | add_wildcard(alias); | 763 | add_wildcard(alias); |
| 720 | return 1; | 764 | return 1; |
| 721 | } | 765 | } |
| 766 | ADD_TO_DEVTABLE("bcma", struct bcma_device_id, do_bcma_entry); | ||
| 722 | 767 | ||
| 723 | /* Looks like: virtio:dNvN */ | 768 | /* Looks like: virtio:dNvN */ |
| 724 | static int do_virtio_entry(const char *filename, struct virtio_device_id *id, | 769 | static int do_virtio_entry(const char *filename, struct virtio_device_id *id, |
| @@ -734,6 +779,7 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id, | |||
| 734 | add_wildcard(alias); | 779 | add_wildcard(alias); |
| 735 | return 1; | 780 | return 1; |
| 736 | } | 781 | } |
| 782 | ADD_TO_DEVTABLE("virtio", struct virtio_device_id, do_virtio_entry); | ||
| 737 | 783 | ||
| 738 | /* | 784 | /* |
| 739 | * Looks like: vmbus:guid | 785 | * Looks like: vmbus:guid |
| @@ -755,6 +801,7 @@ static int do_vmbus_entry(const char *filename, struct hv_vmbus_device_id *id, | |||
| 755 | 801 | ||
| 756 | return 1; | 802 | return 1; |
| 757 | } | 803 | } |
| 804 | ADD_TO_DEVTABLE("vmbus", struct hv_vmbus_device_id, do_vmbus_entry); | ||
| 758 | 805 | ||
| 759 | /* Looks like: i2c:S */ | 806 | /* Looks like: i2c:S */ |
| 760 | static int do_i2c_entry(const char *filename, struct i2c_device_id *id, | 807 | static int do_i2c_entry(const char *filename, struct i2c_device_id *id, |
| @@ -764,6 +811,7 @@ static int do_i2c_entry(const char *filename, struct i2c_device_id *id, | |||
| 764 | 811 | ||
| 765 | return 1; | 812 | return 1; |
| 766 | } | 813 | } |
| 814 | ADD_TO_DEVTABLE("i2c", struct i2c_device_id, do_i2c_entry); | ||
| 767 | 815 | ||
| 768 | /* Looks like: spi:S */ | 816 | /* Looks like: spi:S */ |
| 769 | static int do_spi_entry(const char *filename, struct spi_device_id *id, | 817 | static int do_spi_entry(const char *filename, struct spi_device_id *id, |
| @@ -773,6 +821,17 @@ static int do_spi_entry(const char *filename, struct spi_device_id *id, | |||
| 773 | 821 | ||
| 774 | return 1; | 822 | return 1; |
| 775 | } | 823 | } |
| 824 | ADD_TO_DEVTABLE("spi", struct spi_device_id, do_spi_entry); | ||
| 825 | |||
| 826 | /* Looks like: mcp:S */ | ||
| 827 | static int do_mcp_entry(const char *filename, struct mcp_device_id *id, | ||
| 828 | char *alias) | ||
| 829 | { | ||
| 830 | sprintf(alias, MCP_MODULE_PREFIX "%s", id->name); | ||
| 831 | |||
| 832 | return 1; | ||
| 833 | } | ||
| 834 | ADD_TO_DEVTABLE("mcp", struct mcp_device_id, do_mcp_entry); | ||
| 776 | 835 | ||
| 777 | static const struct dmifield { | 836 | static const struct dmifield { |
| 778 | const char *prefix; | 837 | const char *prefix; |
| @@ -827,6 +886,7 @@ static int do_dmi_entry(const char *filename, struct dmi_system_id *id, | |||
| 827 | strcat(alias, ":"); | 886 | strcat(alias, ":"); |
| 828 | return 1; | 887 | return 1; |
| 829 | } | 888 | } |
| 889 | ADD_TO_DEVTABLE("dmi", struct dmi_system_id, do_dmi_entry); | ||
| 830 | 890 | ||
| 831 | static int do_platform_entry(const char *filename, | 891 | static int do_platform_entry(const char *filename, |
| 832 | struct platform_device_id *id, char *alias) | 892 | struct platform_device_id *id, char *alias) |
| @@ -834,6 +894,7 @@ static int do_platform_entry(const char *filename, | |||
| 834 | sprintf(alias, PLATFORM_MODULE_PREFIX "%s", id->name); | 894 | sprintf(alias, PLATFORM_MODULE_PREFIX "%s", id->name); |
| 835 | return 1; | 895 | return 1; |
| 836 | } | 896 | } |
| 897 | ADD_TO_DEVTABLE("platform", struct platform_device_id, do_platform_entry); | ||
| 837 | 898 | ||
| 838 | static int do_mdio_entry(const char *filename, | 899 | static int do_mdio_entry(const char *filename, |
| 839 | struct mdio_device_id *id, char *alias) | 900 | struct mdio_device_id *id, char *alias) |
| @@ -856,6 +917,7 @@ static int do_mdio_entry(const char *filename, | |||
| 856 | 917 | ||
| 857 | return 1; | 918 | return 1; |
| 858 | } | 919 | } |
| 920 | ADD_TO_DEVTABLE("mdio", struct mdio_device_id, do_mdio_entry); | ||
| 859 | 921 | ||
| 860 | /* Looks like: zorro:iN. */ | 922 | /* Looks like: zorro:iN. */ |
| 861 | static int do_zorro_entry(const char *filename, struct zorro_device_id *id, | 923 | static int do_zorro_entry(const char *filename, struct zorro_device_id *id, |
| @@ -866,6 +928,7 @@ static int do_zorro_entry(const char *filename, struct zorro_device_id *id, | |||
| 866 | ADD(alias, "i", id->id != ZORRO_WILDCARD, id->id); | 928 | ADD(alias, "i", id->id != ZORRO_WILDCARD, id->id); |
| 867 | return 1; | 929 | return 1; |
| 868 | } | 930 | } |
| 931 | ADD_TO_DEVTABLE("zorro", struct zorro_device_id, do_zorro_entry); | ||
| 869 | 932 | ||
| 870 | /* looks like: "pnp:dD" */ | 933 | /* looks like: "pnp:dD" */ |
| 871 | static int do_isapnp_entry(const char *filename, | 934 | static int do_isapnp_entry(const char *filename, |
| @@ -879,6 +942,7 @@ static int do_isapnp_entry(const char *filename, | |||
| 879 | (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f); | 942 | (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f); |
| 880 | return 1; | 943 | return 1; |
| 881 | } | 944 | } |
| 945 | ADD_TO_DEVTABLE("isa", struct isapnp_device_id, do_isapnp_entry); | ||
| 882 | 946 | ||
| 883 | /* | 947 | /* |
| 884 | * Append a match expression for a single masked hex digit. | 948 | * Append a match expression for a single masked hex digit. |
| @@ -947,16 +1011,15 @@ static int do_amba_entry(const char *filename, | |||
| 947 | 1011 | ||
| 948 | return 1; | 1012 | return 1; |
| 949 | } | 1013 | } |
| 1014 | ADD_TO_DEVTABLE("amba", struct amba_id, do_amba_entry); | ||
| 950 | 1015 | ||
| 951 | /* Ignore any prefix, eg. some architectures prepend _ */ | 1016 | /* Does namelen bytes of name exactly match the symbol? */ |
| 952 | static inline int sym_is(const char *symbol, const char *name) | 1017 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) |
| 953 | { | 1018 | { |
| 954 | const char *match; | 1019 | if (namelen != strlen(symbol)) |
| 1020 | return false; | ||
| 955 | 1021 | ||
| 956 | match = strstr(symbol, name); | 1022 | return memcmp(name, symbol, namelen) == 0; |
| 957 | if (!match) | ||
| 958 | return 0; | ||
| 959 | return match[strlen(name)] == '\0'; | ||
| 960 | } | 1023 | } |
| 961 | 1024 | ||
| 962 | static void do_table(void *symval, unsigned long size, | 1025 | static void do_table(void *symval, unsigned long size, |
| @@ -989,11 +1052,25 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
| 989 | { | 1052 | { |
| 990 | void *symval; | 1053 | void *symval; |
| 991 | char *zeros = NULL; | 1054 | char *zeros = NULL; |
| 1055 | const char *name; | ||
| 1056 | unsigned int namelen; | ||
| 992 | 1057 | ||
| 993 | /* We're looking for a section relative symbol */ | 1058 | /* We're looking for a section relative symbol */ |
| 994 | if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections) | 1059 | if (!sym->st_shndx || get_secindex(info, sym) >= info->num_sections) |
| 995 | return; | 1060 | return; |
| 996 | 1061 | ||
| 1062 | /* All our symbols are of form <prefix>__mod_XXX_device_table. */ | ||
| 1063 | name = strstr(symname, "__mod_"); | ||
| 1064 | if (!name) | ||
| 1065 | return; | ||
| 1066 | name += strlen("__mod_"); | ||
| 1067 | namelen = strlen(name); | ||
| 1068 | if (namelen < strlen("_device_table")) | ||
| 1069 | return; | ||
| 1070 | if (strcmp(name + namelen - strlen("_device_table"), "_device_table")) | ||
| 1071 | return; | ||
| 1072 | namelen -= strlen("_device_table"); | ||
| 1073 | |||
| 997 | /* Handle all-NULL symbols allocated into .bss */ | 1074 | /* Handle all-NULL symbols allocated into .bss */ |
| 998 | if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) { | 1075 | if (info->sechdrs[get_secindex(info, sym)].sh_type & SHT_NOBITS) { |
| 999 | zeros = calloc(1, sym->st_size); | 1076 | zeros = calloc(1, sym->st_size); |
| @@ -1004,121 +1081,24 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
| 1004 | + sym->st_value; | 1081 | + sym->st_value; |
| 1005 | } | 1082 | } |
| 1006 | 1083 | ||
| 1007 | if (sym_is(symname, "__mod_pci_device_table")) | 1084 | /* First handle the "special" cases */ |
| 1008 | do_table(symval, sym->st_size, | 1085 | if (sym_is(name, namelen, "usb")) |
| 1009 | sizeof(struct pci_device_id), "pci", | ||
| 1010 | do_pci_entry, mod); | ||
| 1011 | else if (sym_is(symname, "__mod_usb_device_table")) | ||
| 1012 | /* special case to handle bcdDevice ranges */ | ||
| 1013 | do_usb_table(symval, sym->st_size, mod); | 1086 | do_usb_table(symval, sym->st_size, mod); |
| 1014 | else if (sym_is(symname, "__mod_hid_device_table")) | 1087 | else if (sym_is(name, namelen, "pnp")) |
| 1015 | do_table(symval, sym->st_size, | ||
| 1016 | sizeof(struct hid_device_id), "hid", | ||
| 1017 | do_hid_entry, mod); | ||
| 1018 | else if (sym_is(symname, "__mod_ieee1394_device_table")) | ||
| 1019 | do_table(symval, sym->st_size, | ||
| 1020 | sizeof(struct ieee1394_device_id), "ieee1394", | ||
| 1021 | do_ieee1394_entry, mod); | ||
| 1022 | else if (sym_is(symname, "__mod_ccw_device_table")) | ||
| 1023 | do_table(symval, sym->st_size, | ||
| 1024 | sizeof(struct ccw_device_id), "ccw", | ||
| 1025 | do_ccw_entry, mod); | ||
| 1026 | else if (sym_is(symname, "__mod_ap_device_table")) | ||
| 1027 | do_table(symval, sym->st_size, | ||
| 1028 | sizeof(struct ap_device_id), "ap", | ||
| 1029 | do_ap_entry, mod); | ||
| 1030 | else if (sym_is(symname, "__mod_css_device_table")) | ||
| 1031 | do_table(symval, sym->st_size, | ||
| 1032 | sizeof(struct css_device_id), "css", | ||
| 1033 | do_css_entry, mod); | ||
| 1034 | else if (sym_is(symname, "__mod_serio_device_table")) | ||
| 1035 | do_table(symval, sym->st_size, | ||
| 1036 | sizeof(struct serio_device_id), "serio", | ||
| 1037 | do_serio_entry, mod); | ||
| 1038 | else if (sym_is(symname, "__mod_acpi_device_table")) | ||
| 1039 | do_table(symval, sym->st_size, | ||
| 1040 | sizeof(struct acpi_device_id), "acpi", | ||
| 1041 | do_acpi_entry, mod); | ||
| 1042 | else if (sym_is(symname, "__mod_pnp_device_table")) | ||
| 1043 | do_pnp_device_entry(symval, sym->st_size, mod); | 1088 | do_pnp_device_entry(symval, sym->st_size, mod); |
| 1044 | else if (sym_is(symname, "__mod_pnp_card_device_table")) | 1089 | else if (sym_is(name, namelen, "pnp_card")) |
| 1045 | do_pnp_card_entries(symval, sym->st_size, mod); | 1090 | do_pnp_card_entries(symval, sym->st_size, mod); |
| 1046 | else if (sym_is(symname, "__mod_pcmcia_device_table")) | 1091 | else { |
| 1047 | do_table(symval, sym->st_size, | 1092 | struct devtable **p; |
| 1048 | sizeof(struct pcmcia_device_id), "pcmcia", | 1093 | |
| 1049 | do_pcmcia_entry, mod); | 1094 | for (p = __start___devtable; p < __stop___devtable; p++) { |
| 1050 | else if (sym_is(symname, "__mod_of_device_table")) | 1095 | if (sym_is(name, namelen, (*p)->device_id)) { |
| 1051 | do_table(symval, sym->st_size, | 1096 | do_table(symval, sym->st_size, (*p)->id_size, |
| 1052 | sizeof(struct of_device_id), "of", | 1097 | (*p)->device_id, (*p)->function, mod); |
| 1053 | do_of_entry, mod); | 1098 | break; |
| 1054 | else if (sym_is(symname, "__mod_vio_device_table")) | 1099 | } |
| 1055 | do_table(symval, sym->st_size, | 1100 | } |
| 1056 | sizeof(struct vio_device_id), "vio", | 1101 | } |
| 1057 | do_vio_entry, mod); | ||
| 1058 | else if (sym_is(symname, "__mod_input_device_table")) | ||
| 1059 | do_table(symval, sym->st_size, | ||
| 1060 | sizeof(struct input_device_id), "input", | ||
| 1061 | do_input_entry, mod); | ||
| 1062 | else if (sym_is(symname, "__mod_eisa_device_table")) | ||
| 1063 | do_table(symval, sym->st_size, | ||
| 1064 | sizeof(struct eisa_device_id), "eisa", | ||
| 1065 | do_eisa_entry, mod); | ||
| 1066 | else if (sym_is(symname, "__mod_parisc_device_table")) | ||
| 1067 | do_table(symval, sym->st_size, | ||
| 1068 | sizeof(struct parisc_device_id), "parisc", | ||
| 1069 | do_parisc_entry, mod); | ||
| 1070 | else if (sym_is(symname, "__mod_sdio_device_table")) | ||
| 1071 | do_table(symval, sym->st_size, | ||
| 1072 | sizeof(struct sdio_device_id), "sdio", | ||
| 1073 | do_sdio_entry, mod); | ||
| 1074 | else if (sym_is(symname, "__mod_ssb_device_table")) | ||
| 1075 | do_table(symval, sym->st_size, | ||
| 1076 | sizeof(struct ssb_device_id), "ssb", | ||
| 1077 | do_ssb_entry, mod); | ||
| 1078 | else if (sym_is(symname, "__mod_bcma_device_table")) | ||
| 1079 | do_table(symval, sym->st_size, | ||
| 1080 | sizeof(struct bcma_device_id), "bcma", | ||
| 1081 | do_bcma_entry, mod); | ||
| 1082 | else if (sym_is(symname, "__mod_virtio_device_table")) | ||
| 1083 | do_table(symval, sym->st_size, | ||
| 1084 | sizeof(struct virtio_device_id), "virtio", | ||
| 1085 | do_virtio_entry, mod); | ||
| 1086 | else if (sym_is(symname, "__mod_vmbus_device_table")) | ||
| 1087 | do_table(symval, sym->st_size, | ||
| 1088 | sizeof(struct hv_vmbus_device_id), "vmbus", | ||
| 1089 | do_vmbus_entry, mod); | ||
| 1090 | else if (sym_is(symname, "__mod_i2c_device_table")) | ||
| 1091 | do_table(symval, sym->st_size, | ||
| 1092 | sizeof(struct i2c_device_id), "i2c", | ||
| 1093 | do_i2c_entry, mod); | ||
| 1094 | else if (sym_is(symname, "__mod_spi_device_table")) | ||
| 1095 | do_table(symval, sym->st_size, | ||
| 1096 | sizeof(struct spi_device_id), "spi", | ||
| 1097 | do_spi_entry, mod); | ||
| 1098 | else if (sym_is(symname, "__mod_dmi_device_table")) | ||
| 1099 | do_table(symval, sym->st_size, | ||
| 1100 | sizeof(struct dmi_system_id), "dmi", | ||
| 1101 | do_dmi_entry, mod); | ||
| 1102 | else if (sym_is(symname, "__mod_platform_device_table")) | ||
| 1103 | do_table(symval, sym->st_size, | ||
| 1104 | sizeof(struct platform_device_id), "platform", | ||
| 1105 | do_platform_entry, mod); | ||
| 1106 | else if (sym_is(symname, "__mod_mdio_device_table")) | ||
| 1107 | do_table(symval, sym->st_size, | ||
| 1108 | sizeof(struct mdio_device_id), "mdio", | ||
| 1109 | do_mdio_entry, mod); | ||
| 1110 | else if (sym_is(symname, "__mod_zorro_device_table")) | ||
| 1111 | do_table(symval, sym->st_size, | ||
| 1112 | sizeof(struct zorro_device_id), "zorro", | ||
| 1113 | do_zorro_entry, mod); | ||
| 1114 | else if (sym_is(symname, "__mod_isapnp_device_table")) | ||
| 1115 | do_table(symval, sym->st_size, | ||
| 1116 | sizeof(struct isapnp_device_id), "isa", | ||
| 1117 | do_isapnp_entry, mod); | ||
| 1118 | else if (sym_is(symname, "__mod_amba_device_table")) | ||
| 1119 | do_table(symval, sym->st_size, | ||
| 1120 | sizeof(struct amba_id), "amba", | ||
| 1121 | do_amba_entry, mod); | ||
| 1122 | free(zeros); | 1102 | free(zeros); |
| 1123 | } | 1103 | } |
| 1124 | 1104 | ||
