Avoid casts as lvalues. While here, avoid storing 32bit quantities in

16bit locations.
This commit is contained in:
kan 2004-07-28 06:32:28 +00:00
parent 5610a7e068
commit 7a2c503e1b

View File

@ -160,14 +160,14 @@ acpi_printcpu(void)
}
#define WAKECODE_FIXUP(offset, type, val) do { \
void **addr; \
addr = (void **)(sc->acpi_wakeaddr + offset); \
(type *)*addr = val; \
type *addr; \
addr = (type *)(sc->acpi_wakeaddr + offset); \
*addr = val; \
} while (0)
#define WAKECODE_BCOPY(offset, type, val) do { \
void **addr; \
addr = (void **)(sc->acpi_wakeaddr + offset); \
void *addr; \
addr = (void *)(sc->acpi_wakeaddr + offset); \
bcopy(&(val), addr, sizeof(type)); \
} while (0)
@ -233,7 +233,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
WAKECODE_FIXUP(previous_ldt, uint16_t, r_ldt);
WAKECODE_BCOPY(previous_idt, struct region_descriptor, r_idt);
WAKECODE_FIXUP(where_to_recover, void, acpi_restorecpu);
WAKECODE_FIXUP(where_to_recover, void *, acpi_restorecpu);
WAKECODE_FIXUP(previous_ds, uint16_t, r_ds);
WAKECODE_FIXUP(previous_es, uint16_t, r_es);