Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
file2alias.c File Reference
#include "modpost.h"
#include <stdint.h>
#include <ctype.h>
#include <stdbool.h>
#include "../../include/linux/mod_devicetable.h"

Go to the source code of this file.

Data Structures

struct  devtable
 
struct  dmifield
 

Macros

#define BITS_PER_LONG   32
 
#define ___cat(a, b)   a ## b
 
#define __cat(a, b)   ___cat(a,b)
 
#define INIT_SECTION(name)   /* no-op for ELF */
 
#define SECTION(name)   __attribute__((section(#name)))
 
#define __used   __attribute__((__used__))
 
#define ADD_TO_DEVTABLE(device_id, type, function)
 
#define ADD(str, sep, cond, field)
 
#define ARRAY_SIZE(x)   (sizeof(x) / sizeof((x)[0]))
 

Typedefs

typedef Elf32_Addr kernel_ulong_t
 
typedef uint32_t __u32
 
typedef uint16_t __u16
 
typedef unsigned char __u8
 

Functions

 ADD_TO_DEVTABLE ("hid", struct hid_device_id, do_hid_entry)
 
 ADD_TO_DEVTABLE ("ieee1394", struct ieee1394_device_id, do_ieee1394_entry)
 
 ADD_TO_DEVTABLE ("pci", struct pci_device_id, do_pci_entry)
 
 ADD_TO_DEVTABLE ("ccw", struct ccw_device_id, do_ccw_entry)
 
 ADD_TO_DEVTABLE ("ap", struct ap_device_id, do_ap_entry)
 
 ADD_TO_DEVTABLE ("css", struct css_device_id, do_css_entry)
 
 ADD_TO_DEVTABLE ("serio", struct serio_device_id, do_serio_entry)
 
 ADD_TO_DEVTABLE ("acpi", struct acpi_device_id, do_acpi_entry)
 
 ADD_TO_DEVTABLE ("pcmcia", struct pcmcia_device_id, do_pcmcia_entry)
 
 ADD_TO_DEVTABLE ("of", struct of_device_id, do_of_entry)
 
 ADD_TO_DEVTABLE ("vio", struct vio_device_id, do_vio_entry)
 
 ADD_TO_DEVTABLE ("input", struct input_device_id, do_input_entry)
 
 ADD_TO_DEVTABLE ("eisa", struct eisa_device_id, do_eisa_entry)
 
 ADD_TO_DEVTABLE ("parisc", struct parisc_device_id, do_parisc_entry)
 
 ADD_TO_DEVTABLE ("sdio", struct sdio_device_id, do_sdio_entry)
 
 ADD_TO_DEVTABLE ("ssb", struct ssb_device_id, do_ssb_entry)
 
 ADD_TO_DEVTABLE ("bcma", struct bcma_device_id, do_bcma_entry)
 
 ADD_TO_DEVTABLE ("virtio", struct virtio_device_id, do_virtio_entry)
 
 ADD_TO_DEVTABLE ("vmbus", struct hv_vmbus_device_id, do_vmbus_entry)
 
 ADD_TO_DEVTABLE ("i2c", struct i2c_device_id, do_i2c_entry)
 
 ADD_TO_DEVTABLE ("spi", struct spi_device_id, do_spi_entry)
 
 ADD_TO_DEVTABLE ("dmi", struct dmi_system_id, do_dmi_entry)
 
 ADD_TO_DEVTABLE ("platform", struct platform_device_id, do_platform_entry)
 
 ADD_TO_DEVTABLE ("mdio", struct mdio_device_id, do_mdio_entry)
 
 ADD_TO_DEVTABLE ("zorro", struct zorro_device_id, do_zorro_entry)
 
 ADD_TO_DEVTABLE ("isapnp", struct isapnp_device_id, do_isapnp_entry)
 
 ADD_TO_DEVTABLE ("ipack", struct ipack_device_id, do_ipack_entry)
 
 ADD_TO_DEVTABLE ("amba", struct amba_id, do_amba_entry)
 
 ADD_TO_DEVTABLE ("x86cpu", struct x86_cpu_id, do_x86cpu_entry)
 
void handle_moddevtable (struct module *mod, struct elf_info *info, Elf_Sym *sym, const char *symname)
 
void add_moddevtable (struct buffer *buf, struct module *mod)
 

Variables

struct devtable__start___devtable []
 
struct devtable__stop___devtable []
 
unsigned int cross_build = 0
 

Macro Definition Documentation

#define ___cat (   a,
  b 
)    a ## b

Definition at line 49 of file file2alias.c.

#define __cat (   a,
  b 
)    ___cat(a,b)

Definition at line 50 of file file2alias.c.

#define __used   __attribute__((__used__))

Definition at line 84 of file file2alias.c.

#define ADD (   str,
  sep,
  cond,
  field 
)
Value:
do { \
strcat(str, sep); \
if (cond) \
sprintf(str + strlen(str), \
sizeof(field) == 1 ? "%02X" : \
sizeof(field) == 2 ? "%04X" : \
sizeof(field) == 4 ? "%08X" : "", \
field); \
sprintf(str + strlen(str), "*"); \
} while(0)

Definition at line 97 of file file2alias.c.

#define ADD_TO_DEVTABLE (   device_id,
  type,
  function 
)
Value:
static struct devtable __cat(devtable,__LINE__) = { \
device_id + 0*sizeof((function)((const char *)NULL, \
(type *)NULL, \
(char *)NULL)), \
sizeof(type), (function) }; \
static struct devtable *SECTION(__devtable) __used \
__cat(devtable_ptr,__LINE__) = &__cat(devtable,__LINE__)

Definition at line 88 of file file2alias.c.

#define ARRAY_SIZE (   x)    (sizeof(x) / sizeof((x)[0]))

Definition at line 660 of file file2alias.c.

#define BITS_PER_LONG   32

Definition at line 19 of file file2alias.c.

#define INIT_SECTION (   name)    /* no-op for ELF */

Definition at line 73 of file file2alias.c.

#define SECTION (   name)    __attribute__((section(#name)))

Definition at line 74 of file file2alias.c.

Typedef Documentation

typedef uint16_t __u16

Definition at line 34 of file file2alias.c.

typedef uint32_t __u32

Definition at line 33 of file file2alias.c.

typedef unsigned char __u8

Definition at line 35 of file file2alias.c.

Definition at line 18 of file file2alias.c.

Function Documentation

void add_moddevtable ( struct buffer buf,
struct module mod 
)

Definition at line 1173 of file file2alias.c.

ADD_TO_DEVTABLE ( "hid"  ,
struct hid_device_id  ,
do_hid_entry   
)
ADD_TO_DEVTABLE ( "ieee1394"  ,
struct ieee1394_device_id  ,
do_ieee1394_entry   
)
ADD_TO_DEVTABLE ( "pci"  ,
struct pci_device_id  ,
do_pci_entry   
)
ADD_TO_DEVTABLE ( "ccw"  ,
struct ccw_device_id  ,
do_ccw_entry   
)
ADD_TO_DEVTABLE ( "ap"  ,
struct ap_device_id  ,
do_ap_entry   
)
ADD_TO_DEVTABLE ( "css"  ,
struct css_device_id  ,
do_css_entry   
)
ADD_TO_DEVTABLE ( "serio"  ,
struct serio_device_id  ,
do_serio_entry   
)
ADD_TO_DEVTABLE ( "acpi"  ,
struct acpi_device_id  ,
do_acpi_entry   
)
ADD_TO_DEVTABLE ( "pcmcia"  ,
struct pcmcia_device_id  ,
do_pcmcia_entry   
)
ADD_TO_DEVTABLE ( "of"  ,
struct of_device_id  ,
do_of_entry   
)
ADD_TO_DEVTABLE ( "vio"  ,
struct vio_device_id  ,
do_vio_entry   
)
ADD_TO_DEVTABLE ( "input"  ,
struct input_device_id  ,
do_input_entry   
)
ADD_TO_DEVTABLE ( "eisa"  ,
struct eisa_device_id  ,
do_eisa_entry   
)
ADD_TO_DEVTABLE ( "parisc"  ,
struct parisc_device_id  ,
do_parisc_entry   
)
ADD_TO_DEVTABLE ( "sdio"  ,
struct sdio_device_id  ,
do_sdio_entry   
)
ADD_TO_DEVTABLE ( "ssb"  ,
struct ssb_device_id  ,
do_ssb_entry   
)
ADD_TO_DEVTABLE ( "bcma"  ,
struct bcma_device_id  ,
do_bcma_entry   
)
ADD_TO_DEVTABLE ( "virtio"  ,
struct virtio_device_id  ,
do_virtio_entry   
)
ADD_TO_DEVTABLE ( "vmbus"  ,
struct hv_vmbus_device_id  ,
do_vmbus_entry   
)
ADD_TO_DEVTABLE ( "i2c"  ,
struct i2c_device_id  ,
do_i2c_entry   
)
ADD_TO_DEVTABLE ( "spi"  ,
struct spi_device_id  ,
do_spi_entry   
)
ADD_TO_DEVTABLE ( "dmi"  ,
struct dmi_system_id  ,
do_dmi_entry   
)
ADD_TO_DEVTABLE ( "platform"  ,
struct platform_device_id  ,
do_platform_entry   
)
ADD_TO_DEVTABLE ( "mdio"  ,
struct mdio_device_id  ,
do_mdio_entry   
)
ADD_TO_DEVTABLE ( "zorro"  ,
struct zorro_device_id  ,
do_zorro_entry   
)
ADD_TO_DEVTABLE ( "isapnp"  ,
struct isapnp_device_id  ,
do_isapnp_entry   
)
ADD_TO_DEVTABLE ( "ipack"  ,
struct ipack_device_id  ,
do_ipack_entry   
)
ADD_TO_DEVTABLE ( "amba"  ,
struct amba_id  ,
do_amba_entry   
)
ADD_TO_DEVTABLE ( "x86cpu"  ,
struct x86_cpu_id  ,
do_x86cpu_entry   
)
void handle_moddevtable ( struct module mod,
struct elf_info info,
Elf_Sym sym,
const char symname 
)

Definition at line 1112 of file file2alias.c.

Variable Documentation

struct devtable* __start___devtable[]
struct devtable * __stop___devtable[]
unsigned int cross_build = 0

Definition at line 119 of file file2alias.c.