summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/seg.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/i386/i386/seg.h b/i386/i386/seg.h
index a71611d..d95bff9 100644
--- a/i386/i386/seg.h
+++ b/i386/i386/seg.h
@@ -121,20 +121,20 @@ struct real_gate {
/* Format of a "pseudo-descriptor", used for loading the IDT and GDT. */
struct pseudo_descriptor
{
- short pad;
unsigned short limit;
unsigned long linear_base;
-};
+ short pad;
+} __attribute__((packed));
/* Load the processor's IDT, GDT, or LDT pointers. */
MACH_INLINE void lgdt(struct pseudo_descriptor *pdesc)
{
- __asm volatile("lgdt %0" : : "m" (pdesc->limit));
+ __asm volatile("lgdt %0" : : "m" (*pdesc));
}
MACH_INLINE void lidt(struct pseudo_descriptor *pdesc)
{
- __asm volatile("lidt %0" : : "m" (pdesc->limit));
+ __asm volatile("lidt %0" : : "m" (*pdesc));
}
MACH_INLINE void lldt(unsigned short ldt_selector)
{