summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--i386/i386/seg.h8
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 74e465d..2260b20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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.
+
2006-08-06 Thomas Schwinge <tschwinge@gnu.org>
* DEVELOPMENT: Update.
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)
{