--- include/asm-m68k/kerneltypes.h | 9 + include/linux/mod_devicetable.h | 191 ++++++++++++++++++++-------------------- scripts/mod/file2alias.c | 9 - 3 files changed, 108 insertions(+), 101 deletions(-) --- /dev/null +++ b/include/asm-m68k/kerneltypes.h @@ -0,0 +1,9 @@ +#ifndef _ASM_M68K_KERNELTYPES_H +#define _ASM_M68K_KERNELTYPES_H + +typedef unsigned long __attribute__((aligned(2))) kernel_ulong_t; +typedef unsigned char __attribute__((aligned(1))) kernel_u8; +typedef unsigned short __attribute__((aligned(2))) kernel_u16; +typedef unsigned int __attribute__((aligned(2))) kernel_u32; + +#endif /* _ASM_M68K_KERNELTYPES_H */ --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -10,15 +10,23 @@ #ifdef __KERNEL__ #include typedef unsigned long kernel_ulong_t; +typedef u8 kernel_u8; +typedef u16 kernel_u16; +typedef u32 kernel_u32; +#else +#include #endif #define PCI_ANY_ID (~0) struct pci_device_id { - __u32 vendor, device; /* Vendor and device ID or PCI_ANY_ID*/ - __u32 subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */ - __u32 class, class_mask; /* (class,subclass,prog-if) triplet */ - kernel_ulong_t driver_data; /* Data private to the driver */ + kernel_u32 vendor; /* Vendor ID or PCI_ANY_ID*/ + kernel_u32 device; /* Device ID or PCI_ANY_ID*/ + kernel_u32 subvendor; /* Subsystem ID or PCI_ANY_ID */ + kernel_u32 subdevice; /* Subsystem ID or PCI_ANY_ID */ + kernel_u32 class; /* (class,subclass,prog-if) triplet */ + kernel_u32 class_mask; /* (class,subclass,prog-if) triplet */ + kernel_ulong_t driver_data; /* Data private to the driver */ }; @@ -28,13 +36,12 @@ struct pci_device_id { #define IEEE1394_MATCH_VERSION 0x0008 struct ieee1394_device_id { - __u32 match_flags; - __u32 vendor_id; - __u32 model_id; - __u32 specifier_id; - __u32 version; - kernel_ulong_t driver_data - __attribute__((aligned(sizeof(kernel_ulong_t)))); + kernel_u32 match_flags; + kernel_u32 vendor_id; + kernel_u32 model_id; + kernel_u32 specifier_id; + kernel_u32 version; + kernel_ulong_t driver_data; }; @@ -97,23 +104,23 @@ struct ieee1394_device_id { */ struct usb_device_id { /* which fields to match against? */ - __u16 match_flags; + kernel_u16 match_flags; /* Used for product specific matches; range is inclusive */ - __u16 idVendor; - __u16 idProduct; - __u16 bcdDevice_lo; - __u16 bcdDevice_hi; + kernel_u16 idVendor; + kernel_u16 idProduct; + kernel_u16 bcdDevice_lo; + kernel_u16 bcdDevice_hi; /* Used for device class matches */ - __u8 bDeviceClass; - __u8 bDeviceSubClass; - __u8 bDeviceProtocol; + kernel_u8 bDeviceClass; + kernel_u8 bDeviceSubClass; + kernel_u8 bDeviceProtocol; /* Used for interface class matches */ - __u8 bInterfaceClass; - __u8 bInterfaceSubClass; - __u8 bInterfaceProtocol; + kernel_u8 bInterfaceClass; + kernel_u8 bInterfaceSubClass; + kernel_u8 bInterfaceProtocol; /* not matched against */ kernel_ulong_t driver_info; @@ -133,12 +140,12 @@ struct usb_device_id { /* s390 CCW devices */ struct ccw_device_id { - __u16 match_flags; /* which fields to match against */ + kernel_u16 match_flags; /* which fields to match against */ - __u16 cu_type; /* control unit type */ - __u16 dev_type; /* device type */ - __u8 cu_model; /* control unit model */ - __u8 dev_model; /* device model */ + kernel_u16 cu_type; /* control unit type */ + kernel_u16 dev_type; /* device type */ + kernel_u8 cu_model; /* control unit model */ + kernel_u8 dev_model; /* device model */ kernel_ulong_t driver_info; }; @@ -150,11 +157,11 @@ struct ccw_device_id { /* s390 AP bus devices */ struct ap_device_id { - __u16 match_flags; /* which fields to match against */ - __u8 dev_type; /* device type */ - __u8 pad1; - __u32 pad2; - kernel_ulong_t driver_info; + kernel_u16 match_flags; /* which fields to match against */ + kernel_u8 dev_type; /* device type */ + kernel_u8 pad1; + kernel_u32 pad2; + kernel_ulong_t driver_info; }; #define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 @@ -163,23 +170,23 @@ struct ap_device_id { /* to workaround crosscompile issues */ struct acpi_device_id { - __u8 id[ACPI_ID_LEN]; - kernel_ulong_t driver_data; + kernel_u8 id[ACPI_ID_LEN]; + kernel_ulong_t driver_data; }; #define PNP_ID_LEN 8 #define PNP_MAX_DEVICES 8 struct pnp_device_id { - __u8 id[PNP_ID_LEN]; - kernel_ulong_t driver_data; + kernel_u8 id[PNP_ID_LEN]; + kernel_ulong_t driver_data; }; struct pnp_card_device_id { - __u8 id[PNP_ID_LEN]; - kernel_ulong_t driver_data; + kernel_u8 id[PNP_ID_LEN]; + kernel_ulong_t driver_data; struct { - __u8 id[PNP_ID_LEN]; + kernel_u8 id[PNP_ID_LEN]; } devs[PNP_MAX_DEVICES]; }; @@ -187,10 +194,10 @@ struct pnp_card_device_id { #define SERIO_ANY 0xff struct serio_device_id { - __u8 type; - __u8 extra; - __u8 id; - __u8 proto; + kernel_u8 type; + kernel_u8 extra; + kernel_u8 id; + kernel_u8 proto; }; /* @@ -198,47 +205,45 @@ struct serio_device_id { */ struct of_device_id { - char name[32]; - char type[32]; - char compatible[128]; + char name[32]; + char type[32]; + char compatible[128]; #ifdef __KERNEL__ - void *data; + void * data; #else - kernel_ulong_t data; + kernel_ulong_t data; #endif }; /* VIO */ struct vio_device_id { - char type[32]; - char compat[32]; + char type[32]; + char compat[32]; }; /* PCMCIA */ struct pcmcia_device_id { - __u16 match_flags; + kernel_u16 match_flags; - __u16 manf_id; - __u16 card_id; + kernel_u16 manf_id; + kernel_u16 card_id; - __u8 func_id; + kernel_u8 func_id; /* for real multi-function devices */ - __u8 function; + kernel_u8 function; /* for pseudo multi-function devices */ - __u8 device_no; + kernel_u8 device_no; - __u32 prod_id_hash[4] - __attribute__((aligned(sizeof(__u32)))); + kernel_u32 prod_id_hash[4] /* not matched against in kernelspace*/ #ifdef __KERNEL__ const char * prod_id[4]; #else - kernel_ulong_t prod_id[4] - __attribute__((aligned(sizeof(kernel_ulong_t)))); + kernel_ulong_t prod_id[4]; #endif /* not matched against */ @@ -291,24 +296,24 @@ struct pcmcia_device_id { struct input_device_id { - kernel_ulong_t flags; + kernel_ulong_t flags; - __u16 bustype; - __u16 vendor; - __u16 product; - __u16 version; - - kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1]; - kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1]; - kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1]; - kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1]; - kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1]; - kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1]; - kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1]; - kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1]; - kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1]; + kernel_u16 bustype; + kernel_u16 vendor; + kernel_u16 product; + kernel_u16 version; + + kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1]; + kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1]; + kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1]; + kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1]; + kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1]; + kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1]; + kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1]; + kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1]; + kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1]; - kernel_ulong_t driver_info; + kernel_ulong_t driver_info; }; /* EISA */ @@ -317,17 +322,17 @@ struct input_device_id { /* The EISA signature, in ASCII form, null terminated */ struct eisa_device_id { - char sig[EISA_SIG_LEN]; - kernel_ulong_t driver_data; + char sig[EISA_SIG_LEN]; + kernel_ulong_t driver_data; }; #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s" struct parisc_device_id { - __u8 hw_type; /* 5 bits used */ - __u8 hversion_rev; /* 4 bits */ - __u16 hversion; /* 12 bits */ - __u32 sversion; /* 20 bits */ + kernel_u8 hw_type; /* 5 bits used */ + kernel_u8 hversion_rev; /* 4 bits */ + kernel_u16 hversion; /* 12 bits */ + kernel_u32 sversion; /* 20 bits */ }; #define PA_HWTYPE_ANY_ID 0xff @@ -340,17 +345,17 @@ struct parisc_device_id { #define SDIO_ANY_ID (~0) struct sdio_device_id { - __u8 class; /* Standard interface or SDIO_ANY_ID */ - __u16 vendor; /* Vendor or SDIO_ANY_ID */ - __u16 device; /* Device ID or SDIO_ANY_ID */ - kernel_ulong_t driver_data; /* Data private to the driver */ + kernel_u8 class; /* Standard interface or SDIO_ANY_ID */ + kernel_u16 vendor; /* Vendor or SDIO_ANY_ID */ + kernel_u16 device; /* Device ID or SDIO_ANY_ID */ + kernel_ulong_t driver_data; /* Data private to the driver */ }; /* SSB core, see drivers/ssb/ */ struct ssb_device_id { - __u16 vendor; - __u16 coreid; - __u8 revision; + kernel_u16 vendor; + kernel_u16 coreid; + kernel_u8 revision; }; #define SSB_DEVICE(_vendor, _coreid, _revision) \ { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } @@ -362,15 +367,15 @@ struct ssb_device_id { #define SSB_ANY_REV 0xFF struct virtio_device_id { - __u32 device; - __u32 vendor; + kernel_u32 device; + kernel_u32 vendor; }; #define VIRTIO_DEV_ANY_ID 0xffffffff struct zorro_device_id { - __u32 id; /* Device ID or ZORRO_WILDCARD */ - kernel_ulong_t driver_data; /* Data private to the driver */ + kernel_u32 id; /* Device ID or ZORRO_WILDCARD */ + kernel_ulong_t driver_data; /* Data private to the driver */ }; #define ZORRO_WILDCARD (0xffffffff) /* not official */ --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -12,13 +12,10 @@ #include "modpost.h" -/* We use the ELF typedefs for kernel_ulong_t but bite the bullet and - * use either stdint.h or inttypes.h for the rest. */ +/* We use the ELF typedefs for 32 vs. 64 bit */ #if KERNEL_ELFCLASS == ELFCLASS32 -typedef Elf32_Addr kernel_ulong_t; #define BITS_PER_LONG 32 #else -typedef Elf64_Addr kernel_ulong_t; #define BITS_PER_LONG 64 #endif #ifdef __sun__ @@ -29,10 +26,6 @@ typedef Elf64_Addr kernel_ulong_t; #include -typedef uint32_t __u32; -typedef uint16_t __u16; -typedef unsigned char __u8; - /* Big exception to the "don't include kernel headers into userspace, which * even potentially has different endianness and word sizes, since * we handle those differences explicitly below */