summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2005-05-17 14:16:28 +0200
committerMichael Brown2005-05-17 14:16:28 +0200
commit3bbf5f28a37e2dda53a835de59c99fdb6fdf631e (patch)
tree954b88c043ada9877855342dae041598c96a2238
parentUse the heap functions to allocate a load buffer. (diff)
downloadipxe-3bbf5f28a37e2dda53a835de59c99fdb6fdf631e.tar.gz
ipxe-3bbf5f28a37e2dda53a835de59c99fdb6fdf631e.tar.xz
ipxe-3bbf5f28a37e2dda53a835de59c99fdb6fdf631e.zip
Use __unused instead of __used for static data structures.
Remove compiler.h defines from osdep.h
-rw-r--r--src/arch/i386/include/relocate.h2
-rw-r--r--src/include/compiler.h15
-rw-r--r--src/include/console.h3
-rw-r--r--src/include/dev.h7
-rw-r--r--src/include/init.h2
-rw-r--r--src/include/osdep.h4
-rw-r--r--src/include/tables.h9
7 files changed, 24 insertions, 18 deletions
diff --git a/src/arch/i386/include/relocate.h b/src/arch/i386/include/relocate.h
index fdc807f0..5e482bd6 100644
--- a/src/arch/i386/include/relocate.h
+++ b/src/arch/i386/include/relocate.h
@@ -17,7 +17,7 @@ struct post_reloc_fn {
/* 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, \
};
diff --git a/src/include/compiler.h b/src/include/compiler.h
index 4912b424..4a7c48a1 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -84,9 +84,18 @@ __asm__ ( ".equ\tDEBUG_LEVEL, " DEBUG_SYMBOL_STR );
} 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
diff --git a/src/include/console.h b/src/include/console.h
index 146fd9c3..1decb9c3 100644
--- a/src/include/console.h
+++ b/src/include/console.h
@@ -18,8 +18,7 @@ struct console_driver {
int ( *iskey ) ( void );
};
-#define __console_driver \
- __attribute__ (( used, __table_section ( console, 01 ) ))
+#define __console_driver __table ( console, 01 )
/* Function prototypes */
diff --git a/src/include/dev.h b/src/include/dev.h
index 0d0d4d8e..d6e31dab 100644
--- a/src/include/dev.h
+++ b/src/include/dev.h
@@ -160,7 +160,7 @@ struct bus_driver {
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
@@ -186,7 +186,7 @@ struct type_driver {
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.
@@ -203,8 +203,7 @@ struct device_driver {
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) \
diff --git a/src/include/init.h b/src/include/init.h
index e28a4349..0b341b8d 100644
--- a/src/include/init.h
+++ b/src/include/init.h
@@ -51,7 +51,7 @@ struct init_fn {
/* 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, \
diff --git a/src/include/osdep.h b/src/include/osdep.h
index 121eacae..262c2d96 100644
--- a/src/include/osdep.h
+++ b/src/include/osdep.h
@@ -1,10 +1,6 @@
#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")
diff --git a/src/include/tables.h b/src/include/tables.h
index 48514464..26ad61db 100644
--- a/src/include/tables.h
+++ b/src/include/tables.h
@@ -49,8 +49,11 @@
#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 */