diff options
author | Carsten Otte <cotte@de.ibm.com> | 2007-10-29 16:08:51 +0100 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 17:52:57 +0200 |
commit | 5fb76f9be1a050a25e21a44ab2003c9d36a72a77 (patch) | |
tree | fa5a184ade52e55746efb1bab59fa283ee3535ed /drivers/kvm/segment_descriptor.h | |
parent | 1fe779f8eccd16e527315e1bafd2b3a876ff2489 (diff) | |
download | op-kernel-dev-5fb76f9be1a050a25e21a44ab2003c9d36a72a77.zip op-kernel-dev-5fb76f9be1a050a25e21a44ab2003c9d36a72a77.tar.gz |
KVM: Portability: Move memory segmentation to x86.c
This patch moves the definition of segment_descriptor_64 for AMD64 and
EM64T from kvm_main.c to segment_descriptor.h. It also adds a proper
#ifndef...#define...#endif around that header file.
The implementation of segment_base is moved from kvm_main.c to x86.c.
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/segment_descriptor.h')
-rw-r--r-- | drivers/kvm/segment_descriptor.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/kvm/segment_descriptor.h b/drivers/kvm/segment_descriptor.h index 71fdf45..56fc4c8 100644 --- a/drivers/kvm/segment_descriptor.h +++ b/drivers/kvm/segment_descriptor.h @@ -1,3 +1,6 @@ +#ifndef __SEGMENT_DESCRIPTOR_H +#define __SEGMENT_DESCRIPTOR_H + struct segment_descriptor { u16 limit_low; u16 base_low; @@ -14,4 +17,13 @@ struct segment_descriptor { u8 base_high; } __attribute__((packed)); +#ifdef CONFIG_X86_64 +/* LDT or TSS descriptor in the GDT. 16 bytes. */ +struct segment_descriptor_64 { + struct segment_descriptor s; + u32 base_higher; + u32 pad_zero; +}; +#endif +#endif |