Added methods for efficiently declaring and accessing variables in

.data16.  librm will need to supply "char *data16", i.e. the virtual
address of the start of .data16.
This commit is contained in:
Michael Brown
2006-05-04 17:00:20 +00:00
parent f8f75cef5b
commit f4429533a6
3 changed files with 59 additions and 0 deletions
+11
View File
@@ -15,6 +15,17 @@
*
*/
/* Access to variables in .data16 */
extern char *data16;
#define __data16( variable ) \
_data16_ ## variable __asm__ ( #variable ) \
__attribute__ (( section ( ".data16" ) ))
#define __use_data16( variable ) \
( * ( ( typeof ( _data16_ ## variable ) * ) \
& ( data16 [ ( size_t ) & ( _data16_ ## variable ) ] ) ) )
/* Variables in librm.S, present in the normal data segment */
extern uint16_t rm_sp;
extern uint16_t rm_ss;