diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-06-25 08:19:04 +0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 15:10:28 +0400 |
commit | 43adfc26dea171558f944adbc9adecddf2d4602f (patch) | |
tree | d0b2b3b3b1c6ba1c47080d06639c37e357118a9d | |
parent | 4583ed514ea9ac844a6eb02d33120beaedf6837f (diff) | |
download | linux-43adfc26dea171558f944adbc9adecddf2d4602f.tar.xz |
x86, 64-bit: add gate_offset() and gate_segment() macros
For calculating the offset from struct gate_struct fields.
[ gate_offset and gate_segment were broken for 32-bit. ]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/asm-x86/desc_defs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/asm-x86/desc_defs.h b/include/asm-x86/desc_defs.h index eccb4ea1f918..f7bacf357dac 100644 --- a/include/asm-x86/desc_defs.h +++ b/include/asm-x86/desc_defs.h @@ -75,10 +75,14 @@ struct ldttss_desc64 { typedef struct gate_struct64 gate_desc; typedef struct ldttss_desc64 ldt_desc; typedef struct ldttss_desc64 tss_desc; +#define gate_offset(g) ((g).offset_low | ((unsigned long)(g).offset_middle << 16) | ((unsigned long)(g).offset_high << 32)) +#define gate_segment(g) ((g).segment) #else typedef struct desc_struct gate_desc; typedef struct desc_struct ldt_desc; typedef struct desc_struct tss_desc; +#define gate_offset(g) (((g).b & 0xffff0000) | ((g).a & 0x0000ffff)) +#define gate_segment(g) ((g).a >> 16) #endif struct desc_ptr { |