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.
This commit is contained in:
parent
adf2dcf69d
commit
15fd4340d6
|
@ -1397,7 +1397,7 @@ SVGA_WaitForIRQ(void)
|
||||||
void
|
void
|
||||||
SVGAInterruptHandler(int vector) // IN (unused)
|
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.
|
* 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);
|
Atomic_Or(gSVGA.irq.pending, irqFlags);
|
||||||
|
|
||||||
if (gSVGA.irq.switchContext) {
|
if (gSVGA.irq.switchContext) {
|
||||||
gSVGA.irq.oldContext = *context;
|
memcpy((void*) &gSVGA.irq.oldContext, context, sizeof *context);
|
||||||
*context = gSVGA.irq.newContext;
|
memcpy(context, (void*) &gSVGA.irq.newContext, sizeof *context);
|
||||||
gSVGA.irq.switchContext = FALSE;
|
gSVGA.irq.switchContext = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue