mirror of
https://github.com/ipxe/ipxe
synced 2025-12-31 15:25:23 +03:00
Add "name" field to struct device to allow human-readable hardware device
names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
This commit is contained in:
@@ -165,16 +165,17 @@
|
||||
*/
|
||||
|
||||
#ifdef DOXYGEN
|
||||
#define __attribute__(x)
|
||||
#define __attribute__( x )
|
||||
#endif
|
||||
|
||||
#define __table_str(x) #x
|
||||
#define __table_section(table,idx) \
|
||||
__section__ ( ".tbl." __table_str(table) "." __table_str(idx) )
|
||||
#define __table_str( x ) #x
|
||||
#define __table_section( table, idx ) \
|
||||
__section__ ( ".tbl." __table_str ( table ) "." __table_str ( idx ) )
|
||||
|
||||
#define __table_section_start(table) __table_section(table,00)
|
||||
#define __table_section_end(table) __table_section(table,99)
|
||||
#define __table_section_start( table ) __table_section ( table, 00 )
|
||||
#define __table_section_end( table ) __table_section ( table, 99 )
|
||||
|
||||
#define __natural_alignment( type ) __aligned__ ( __alignof__ ( type ) )
|
||||
|
||||
/**
|
||||
* Linker table entry.
|
||||
@@ -191,8 +192,9 @@
|
||||
* @endcode
|
||||
*
|
||||
*/
|
||||
#define __table(table,idx) \
|
||||
__attribute__ (( __table_section(table,idx) ))
|
||||
#define __table( type, table, idx ) \
|
||||
__attribute__ (( __table_section ( table, idx ), \
|
||||
__natural_alignment ( type ) ))
|
||||
|
||||
/**
|
||||
* Linker table start marker.
|
||||
@@ -207,8 +209,7 @@
|
||||
* @endcode
|
||||
*
|
||||
*/
|
||||
#define __table_start(table) \
|
||||
__attribute__ (( __table_section_start(table) ))
|
||||
#define __table_start( type, table ) __table ( type, table, 00 )
|
||||
|
||||
/**
|
||||
* Linker table end marker.
|
||||
@@ -223,7 +224,6 @@
|
||||
* @endcode
|
||||
*
|
||||
*/
|
||||
#define __table_end(table) \
|
||||
__attribute__ (( __table_section_end(table) ))
|
||||
#define __table_end( type, table ) __table ( type, table, 99 )
|
||||
|
||||
#endif /* _GPXE_TABLES_H */
|
||||
|
||||
Reference in New Issue
Block a user