From 15fd4340d65e32e553bf69fdb3854129a5eeef45 Mon Sep 17 00:00:00 2001 From: Micah Dowty Date: Wed, 1 Jul 2009 21:02:40 +0000 Subject: [PATCH] SVGA refdriver: compile fix for gcc strict aliasing Newer versions of GCC have additional strict alias checking, and so the refdriver's IRQ handler would fail to compile. Work around this problem (and avoid unwanted compiler optimizations to boot) by using memcpy instead of struct assignment. --- lib/refdriver/svga.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/refdriver/svga.c b/lib/refdriver/svga.c index e2dea73..63daa8c 100644 --- a/lib/refdriver/svga.c +++ b/lib/refdriver/svga.c @@ -1397,7 +1397,7 @@ SVGA_WaitForIRQ(void) void SVGAInterruptHandler(int vector) // IN (unused) { - volatile IntrContext *context = Intr_GetContext(vector); + IntrContext *context = Intr_GetContext(vector); /* * The SVGA_IRQSTATUS_PORT is a separate I/O port, not a register. @@ -1421,8 +1421,8 @@ SVGAInterruptHandler(int vector) // IN (unused) Atomic_Or(gSVGA.irq.pending, irqFlags); if (gSVGA.irq.switchContext) { - gSVGA.irq.oldContext = *context; - *context = gSVGA.irq.newContext; + memcpy((void*) &gSVGA.irq.oldContext, context, sizeof *context); + memcpy(context, (void*) &gSVGA.irq.newContext, sizeof *context); gSVGA.irq.switchContext = FALSE; } }