~ubuntu-branches/ubuntu/saucy/seabios/saucy-proposed

« back to all changes in this revision

Viewing changes to src/types.h

  • Committer: Package Import Robot
  • Author(s): Michael Tokarev
  • Date: 2013-07-08 21:34:44 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20130708213444-6ed9q23j39x143lu
Tags: 1.7.3-1
Multi-Arch: allowed

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
# define VISIBLE32SEG
52
52
// Designate a variable as (only) visible to 16bit code.
53
53
# define VAR16 __section(".data16." UNIQSEC)
54
 
// Designate a variable as visible to 16bit, 32bit, and assembler code.
55
 
# define VAR16VISIBLE VAR16 __VISIBLE
56
 
// Designate a variable as externally visible (in addition to all internal code).
57
 
# define VAR16EXPORT __section(".data16.export." UNIQSEC) __VISIBLE
58
54
// Designate a variable at a specific 16bit address
59
55
# define VAR16FIXED(addr) __aligned(1) __VISIBLE __section(".fixedaddr." __stringify(addr))
60
56
// Designate a variable as (only) visible to 32bit segmented code.
61
57
# define VAR32SEG __section(".discard.var32seg." UNIQSEC)
62
 
// Designate a 32bit variable also available in 16bit "big real" mode.
63
 
# define VAR32FLATVISIBLE __section(".discard.var32flat." UNIQSEC) __VISIBLE __weak
64
58
// Designate a variable as visible and located in the e-segment.
65
59
# define VARLOW __section(".discard.varlow." UNIQSEC) __VISIBLE __weak
 
60
// Designate a variable as visible and located in the f-segment.
 
61
# define VARFSEG __section(".discard.varfseg." UNIQSEC) __VISIBLE __weak
 
62
// Verify a variable is only accessable via 32bit "init" functions
 
63
# define VARVERIFY32INIT __section(".discard.varinit." UNIQSEC)
66
64
// Designate top-level assembler as 16bit only.
67
65
# define ASM16(code) __ASM(code)
68
66
// Designate top-level assembler as 32bit flat only.
77
75
# define VISIBLE32INIT
78
76
# define VISIBLE32SEG __VISIBLE
79
77
# define VAR16 __section(".discard.var16." UNIQSEC)
80
 
# define VAR16VISIBLE VAR16 __VISIBLE __weak
81
 
# define VAR16EXPORT VAR16VISIBLE
82
 
# define VAR16FIXED(addr) VAR16VISIBLE
 
78
# define VAR16FIXED(addr) VAR16 __VISIBLE __weak
83
79
# define VAR32SEG __section(".data32seg." UNIQSEC)
84
 
# define VAR32FLATVISIBLE __section(".discard.var32flat." UNIQSEC) __VISIBLE __weak
85
80
# define VARLOW __section(".discard.varlow." UNIQSEC) __VISIBLE __weak
 
81
# define VARFSEG __section(".discard.varfseg." UNIQSEC) __VISIBLE __weak
 
82
# define VARVERIFY32INIT __section(".discard.varinit." UNIQSEC)
86
83
# define ASM16(code)
87
84
# define ASM32FLAT(code)
88
85
# define ASSERT16() __force_link_error__only_in_16bit()
94
91
# define VISIBLE32INIT __section(".text.init." UNIQSEC) __VISIBLE
95
92
# define VISIBLE32SEG
96
93
# define VAR16 __section(".discard.var16." UNIQSEC)
97
 
# define VAR16VISIBLE VAR16 __VISIBLE __weak
98
 
# define VAR16EXPORT VAR16VISIBLE
99
 
# define VAR16FIXED(addr) VAR16VISIBLE
 
94
# define VAR16FIXED(addr) VAR16 __VISIBLE __weak
100
95
# define VAR32SEG __section(".discard.var32seg." UNIQSEC)
101
 
# define VAR32FLATVISIBLE __section(".data.runtime." UNIQSEC) __VISIBLE
102
 
# define VARLOW __section(".datalow." UNIQSEC) __VISIBLE
 
96
# define VARLOW __section(".data.varlow." UNIQSEC) __VISIBLE __weak
 
97
# define VARFSEG __section(".data.varfseg." UNIQSEC) __VISIBLE
 
98
# define VARVERIFY32INIT __section(".data.varinit." UNIQSEC)
103
99
# define ASM16(code)
104
100
# define ASM32FLAT(code) __ASM(code)
105
101
# define ASSERT16() __force_link_error__only_in_16bit()
121
117
#define container_of(ptr, type, member) ({                      \
122
118
        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
123
119
        (type *)( (char *)__mptr - offsetof(type,member) );})
 
120
#define container_of_or_null(ptr, type, member) ({              \
 
121
        const typeof( ((type *)0)->member ) *___mptr = (ptr);   \
 
122
        ___mptr ? container_of(___mptr, type, member) : NULL; })
124
123
 
125
124
#define likely(x)       __builtin_expect(!!(x), 1)
126
125
#define unlikely(x)     __builtin_expect(!!(x), 0)