summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2006-09-19 00:25:04 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:26:41 +0200
commit99ee9de277063ced53fc7c4a396aeaf8ceab16bd (patch)
tree61b147bf24178f8323b7cc79b57ffbd012c3312a /i386
parent3b4a7fb1606e5774447a1571991a5005b69dcdd1 (diff)
2006-09-19 Samuel Thibault <samuel.thibault@ens-lyon.org>
Fix against gcc 4.1's optimizations. * i386/i386/seg.h (struct pseudo_descriptor): Pack structure and move the padding field to the end. (lgdt): Pass the whole structure to the lgdt assembly command. (lidt): Likewise.
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)
{