Subject: CVS commit: [jmcneill-pm] src/sys/arch
To: None <source-changes@NetBSD.org>
From: Joerg Sonnenberger <joerg@netbsd.org>
List: source-changes
Date: 09/08/2007 00:31:36
Module Name:	src
Committed By:	joerg
Date:		Sat Sep  8 00:31:36 UTC 2007

Modified Files:
	src/sys/arch/amd64/acpi [jmcneill-pm]: acpi_wakeup.c
	src/sys/arch/amd64/amd64 [jmcneill-pm]: machdep.c
	src/sys/arch/i386/acpi [jmcneill-pm]: acpi_wakecode.S acpi_wakecode.h
	    acpi_wakeup.c
	src/sys/arch/i386/conf [jmcneill-pm]: files.i386
	src/sys/arch/i386/i386 [jmcneill-pm]: machdep.c
	src/sys/arch/x86/include [jmcneill-pm]: acpi_machdep.h
Added Files:
	src/sys/arch/i386/acpi [jmcneill-pm]: acpi_wakeup_low.S

Log Message:
Start to revamp the ACPI wake code (i386 only, amd64 gets minimal fixes
to keep being compilable):

- In init386 and the amd64 equivalent, just reserve the low-level code.
  Do not map and don't copy the wakecode yet. This avoids the conflicts
  with the MP tramp code as well. The wakecode is expected to be less
  than one page long, which is way too much space.
  acpi_md_get_npages_of_wakecode and acpi_md_install_wakecode are
  dropped, acpi_wakeup_paddr is set instead of the reserved address.
- Split the wakecode into the essential low-level part to setup
  protected mode with paging and valid CS and DS (which stays as
  wakecode) and the rest. Inline beepon and beepoff as they are used
  exactly once.
- Split the acpi_restorecpu and acpi_savecpu assembly from apci_wakeup.c
  and merge acpi_restorecpu with the second half dropped from wakecode.
  Most registers are not exported, just those needed to be patched into
  wakecode. Don't bother to save or restore %eax, it is overriden
  anyway.
- Don't bother to save and restore eflags in acpi_md_sleep, they are
  handled correctly by the assembly. Don't play games with cr3 either,
  we modify the pmap of the running processes. Copy the wakecode
  directly before patching it, after the identity mapping has been
  setup.
- Drop clear_reg and acpi_printcpu.
- Add an commented out broadcast IPI to halt the other CPUs explicitly.


To generate a diff of this commit:
cvs rdiff -r1.3.48.2 -r1.3.48.3 src/sys/arch/amd64/acpi/acpi_wakeup.c
cvs rdiff -r1.60.8.2 -r1.60.8.3 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -r1.9.10.2 -r1.9.10.3 src/sys/arch/i386/acpi/acpi_wakecode.S
cvs rdiff -r1.8.10.2 -r1.8.10.3 src/sys/arch/i386/acpi/acpi_wakecode.h
cvs rdiff -r1.38.2.2 -r1.38.2.3 src/sys/arch/i386/acpi/acpi_wakeup.c
cvs rdiff -r0 -r1.1.2.1 src/sys/arch/i386/acpi/acpi_wakeup_low.S
cvs rdiff -r1.312.8.3 -r1.312.8.4 src/sys/arch/i386/conf/files.i386
cvs rdiff -r1.606.8.2 -r1.606.8.3 src/sys/arch/i386/i386/machdep.c
cvs rdiff -r1.2.56.1 -r1.2.56.2 src/sys/arch/x86/include/acpi_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.