Moved definition of __shared into compiler.h
[people/lynusvaz/gpxe.git] / src / include / compiler.h
index 4fe4f02..df0a01a 100644 (file)
@@ -71,6 +71,23 @@ __asm__ ( ".equ\tDEBUG_LEVEL, " DEBUG_SYMBOL_STR );
 #define __unused __attribute__((unused))
 #define __used __attribute__((used))
 
+/*
+ * To save space in the binary when multiple-driver images are
+ * compiled, uninitialised data areas can be shared between drivers.
+ * This will typically be used to share statically-allocated receive
+ * and transmit buffers between drivers.
+ *
+ * Use as e.g.
+ *
+ *  struct {
+ *     char    rx_buf[NUM_RX_BUF][RX_BUF_SIZE];
+ *     char    tx_buf[TX_BUF_SIZE];
+ *  } my_static_data __shared;
+ *
+ */
+
+#define __shared __asm__ ( "_shared_bss" );
+
 #endif /* ASSEMBLY */
 
 #endif /* COMPILER_H */