/* Macro for creating a post-relocation function table entry */
#define POST_RELOC_FN( order, post_reloc_func ) \
static struct post_reloc_fn PREFIX_OBJECT(post_reloc_fn__) \
- __attribute__ (( used, __table_section(post_reloc_fn,order) )) = {\
+ __table ( post_reloc_fn, order ) = { \
.post_reloc = post_reloc_func, \
};
} while (0)
#endif
-#define PACKED __attribute__((packed))
-#define __unused __attribute__((unused))
-#define __used __attribute__((used))
+/*
+ * Commonly-used attributes.
+ *
+ * Note that __used can be used only for functions. If you have a
+ * static variable declaration that you want to force to be included,
+ * use __unused.
+ *
+ */
+#define PACKED __attribute__ (( packed ))
+#define __unused __attribute__ (( unused ))
+#define __used __attribute__ (( used ))
+#define __aligned __attribute__ (( aligned ( 16 ) ))
/*
* To save space in the binary when multiple-driver images are
int ( *iskey ) ( void );
};
-#define __console_driver \
- __attribute__ (( used, __table_section ( console, 01 ) ))
+#define __console_driver __table ( console, 01 )
/* Function prototypes */
const char * ( *name_device ) ( struct bus_dev *bus_dev );
};
-#define __bus_driver __attribute__ (( used, __table_section(bus_driver,01) ))
+#define __bus_driver __table ( bus_driver, 01 )
/*
* A structure fully describing the bus-independent parts of a
int ( * load ) ( struct type_dev *type_dev, struct buffer *buffer );
};
-#define __type_driver __attribute__ (( used, __table_section(type_driver,01) ))
+#define __type_driver __table ( type_driver, 01 )
/*
* A driver for a device.
struct bus_dev *bus_dev );
};
-#define __device_driver \
- __attribute__ (( used, __table_section(device_driver,01) ))
+#define __device_driver __table ( device_driver, 01 )
#define DRIVER(_name,_type_driver,_bus_driver,_bus_info, \
_probe,_disable) \
/* Macro for creating an initialisation function table entry */
#define INIT_FN( init_order, init_func, reset_func, exit_func ) \
static struct init_fn PREFIX_OBJECT(init_fn__) \
- __attribute__ (( used, __table_section(init_fn,init_order) )) = { \
+ __table ( init_fn, init_order ) = { \
.init = init_func, \
.reset = reset_func, \
.exit = exit_func, \
#ifndef ETHERBOOT_OSDEP_H
#define ETHERBOOT_OSDEP_H
-#define __unused __attribute__((unused))
-#define __aligned __attribute__((aligned(16)))
-#define PACKED __attribute__((packed))
-
/* Optimization barrier */
/* The "volatile" is due to gcc bugs */
#define barrier() __asm__ __volatile__("": : :"memory")
#define __table_section_start(table) __table_section(table,00)
#define __table_section_end(table) __table_section(table,99)
-#define __table(table,idx) __attribute__ (( __table_section(table,idx) ))
-#define __table_start(table) __attribute__ (( __table_section_start(table) ))
-#define __table_end(table) __attribute__ (( __table_section_end(table) ))
+#define __table(table,idx) \
+ __attribute__ (( unused, __table_section(table,idx) ))
+#define __table_start(table) \
+ __attribute__ (( unused, __table_section_start(table) ))
+#define __table_end(table) \
+ __attribute__ (( unused, __table_section_end(table) ))
#endif /* TABLES_H */