From 1e8bf86fa4e8195c8039a7ded835785ce0d383c0 Mon Sep 17 00:00:00 2001 From: Mike Larkin Date: Sat, 6 Jun 2009 00:21:54 +0000 Subject: Fix some lapic, interrupt, and clock issues on i386 ACPI S3 resume. (Allows time to flow forward after resume) ok pirofti@ --- sys/arch/i386/i386/acpi_machdep.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/i386/i386/acpi_machdep.c b/sys/arch/i386/i386/acpi_machdep.c index 7488077f74c..81259433c69 100644 --- a/sys/arch/i386/i386/acpi_machdep.c +++ b/sys/arch/i386/i386/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.20 2009/06/04 23:48:00 mlarkin Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.21 2009/06/06 00:21:53 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -40,6 +41,10 @@ #include "ioapic.h" #include "lapic.h" +#if NIOAPIC > 0 +#include +#endif + #if NLAPIC > 0 #include #include @@ -53,11 +58,8 @@ int haveacpibutusingapm; extern u_char acpi_real_mode_resume[], acpi_resume_end[]; -int acpi_savecpu(void); -void intr_calculatemasks(void); -void acpi_cpu_flush(struct acpi_softc *, int); -void ioapic_enable(void); -void lapic_enable(void); +extern int acpi_savecpu(void); +extern void intr_calculatemasks(void); #define ACPI_BIOS_RSDP_WINDOW_BASE 0xe0000 #define ACPI_BIOS_RSDP_WINDOW_SIZE 0x20000 @@ -254,17 +256,19 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) */ npxinit(&cpu_info_primary); +#if NISA > 0 isa_defaultirq(); +#endif intr_calculatemasks(); #if NLAPIC > 0 lapic_enable(); - lapic_calibrate_timer(&cpu_info_primary); + lapic_initclocks(); #endif #if NIOAPIC > 0 ioapic_enable(); #endif initrtclock(); - enable_intr(); + inittodr(time_second); #endif /* ACPI_SLEEP_ENABLED */ return (0); -- cgit v1.2.3