History log of /freebsd-current/sys/i386/acpica/acpi_wakecode.S
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# de4da6cd 20-Apr-2023 Dmitry Chagin <dchagin@FreeBSD.org>

x86: Move i386 timerreg.h to x86

Reviewed by: emaste, jhb
Differential Revision: https://reviews.freebsd.org/D39656
MFC after: 1 month


# d1f4c44a 20-Apr-2023 Dmitry Chagin <dchagin@FreeBSD.org>

x86: Move i386 ppireg.h to x86

Differential Revision: https://reviews.freebsd.org/D39655
MFC after: 1 month


# f76b5ab6 06-Feb-2019 Konstantin Belousov <kib@FreeBSD.org>

Fix resume on i386 PAE.

It was broken before PAE/no-PAE merge, but since now PAE is the
default, resume is apparently becomes for all machines.

The corrected issues:
- the trampoline page is not mapped executable, so machine faults when
paging is on;
- MSR.EFER and %cr4 both should be loaded before paging is enabled,
otherwise paging structures are invalid (cr4.PAE and EFER.NX).
- MSR.EFER and %cr4 should be only loaded if present. I attempt to handle
this by not touching the registers if the value is zero.

There are some more bits still not quite correct, e.g. unconditional
access to %cr4 in resumectx.

Reported and debugging help by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# fc2a8776 20-Mar-2018 Ed Maste <emaste@FreeBSD.org>

Rename assym.s to assym.inc

assym is only to be included by other .s files, and should never
actually be assembled by itself.

Reviewed by: imp, bdrewery (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14180


# c93ea91c 14-Dec-2017 Bruce Evans <bde@FreeBSD.org>

Minor cleanups found while fixing a bug involving double mapping of low
memory:

Load the kernel eflags less magically, as in locore. The magic increased
when I removed eflags from the pcb in r305899.

Remove a jump to low memory that became garbage when the i386 version was
mostly replaced by the amd64 version in r235622.

The amd64 version is very similar. It still loads the flags magically,
but is not missing comments about using the special page table.

Reviewed by: kib


# d9f3b5e7 12-Aug-2014 John Baldwin <jhb@FreeBSD.org>

Correct a comment brought over from amd64. i386 doesn't use long
mode.


# acd7df97 13-Jun-2012 Jung-uk Kim <jkim@FreeBSD.org>

- Fix resumectx() prototypes to reflect reality.
- For i386, simply jump to resumectx() with PCB in %ecx.
- Fix a style(9) nit while I am here.


# fb864578 08-Jun-2012 Mitsuru IWASAKI <iwasaki@FreeBSD.org>

Add x86/acpica/acpi_wakeup.c for amd64 and i386. Difference of
suspend/resume procedures are minimized among them.

common:
- Add global cpuset suspended_cpus to indicate APs are suspended/resumed.
- Remove acpi_waketag and acpi_wakemap from acpivar.h (no longer used).
- Add some variables in acpi_wakecode.S in order to minimize the difference
among amd64 and i386.
- Disable load_cr3() because now CR3 is restored in resumectx().

amd64:
- Add suspend/resume related members (such as MSR) in PCB.
- Modify savectx() for above new PCB members.
- Merge acpi_switch.S into cpu_switch.S as resumectx().

i386:
- Merge(and remove) suspendctx() into savectx() in order to match with
amd64 code.

Reviewed by: attilio@, acpi@


# e3fd0bc1 18-May-2012 Mitsuru IWASAKI <iwasaki@FreeBSD.org>

Add SMP/i386 suspend/resume support.
Most part is merged from amd64.

- i386/acpica/acpi_wakecode.S
Replaced with amd64 code (from realmode to paging enabling code).

- i386/acpica/acpi_wakeup.c
Replaced with amd64 code (except for wakeup_pagetables stuff).

- i386/include/pcb.h
- i386/i386/genassym.c
Added PCB new members (CR0, CR2, CR4, DS, ED, FS, SS, GDT, IDT, LDT
and TR) needed for suspend/resume, not for context switch.

- i386/i386/swtch.s
Added suspendctx() and resumectx().
Note that savectx() was not changed and used for suspending (while
amd64 code uses it).
BSP and AP execute the same sequence, suspendctx(), acpi_wakecode()
and resumectx() for suspend/resume (in case of UP system also).

- i386/i386/apic_vector.s
Added cpususpend().

- i386/i386/mp_machdep.c
- i386/include/smp.h
Added cpususpend_handler().

- i386/include/apicvar.h
- kern/subr_smp.c
- sys/smp.h
Added IPI_SUSPEND and suspend_cpus().

- i386/i386/initcpu.c
- i386/i386/machdep.c
- i386/include/md_var.h
- pc98/pc98/machdep.c
Moved initializecpu() declarations to md_var.h.

MFC after: 3 days


# a3c464fb 12-Nov-2010 Jung-uk Kim <jkim@FreeBSD.org>

MFamd64: (based on) r209957

Move logic of building ACPI headers for acpi_wakeup.c into better places,
remove intermediate makefile and shell script, and reduce diff between i386
and amd64.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 716d09af 10-Jun-2006 Nate Lawson <njl@FreeBSD.org>

Minor tweaks to the resume code. Previous commit reverted alignment back
to 4. There is no need to be more strict at assembly time since we copy
the code anyway to a private page.

* Clear the direction flag and eflags. Probably not necessary but it won't
hurt to be safe.
* Add prefixes to all instructions to prevent any assembler mistakes.
* Remove zeroing of eax - edi. We use those registers immediately after
to transfer values to protected mode so this was pointless.
* Update comments to reflect info found during code review.


# b46f4324 10-Jun-2006 Nate Lawson <njl@FreeBSD.org>

Move the reset beep tunable/sysctl to debug.acpi.resume_beep. This makes
more sense than under hw.acpi. Also, document this in the man page.


# 64297e67 08-Jun-2006 Nate Lawson <njl@FreeBSD.org>

Minor tweaks to the resume code that might help people debug.

* Add hw.acpi.resume_beep tunable and sysctl, default to 0. Beeps the PC
speaker soon after waking to diagnose whether the wakeup code is even
getting run before other drivers possibly hang the system. To stop the beep,
cause another beep (i.e. keyboard bell). Submitted by takawata@, I changed
the frequency to be lower.

* Use 4096 instead of 4 byte alignment. Might be useful although doesn't
seem to be necessary.

* Remove a useless assignment to acpi_reset_video. It was overwritten by
the default sysctl value anyway.


# b8619d36 22-Apr-2005 Ian Dowse <iedowse@FreeBSD.org>

Pick up the selectors to use for various kernel segments from assym.s
instead of assuming fixed offsets within the GDT. The hard-coded
values here have been incorrect since Peter's GDT rearranging around
10 days ago, causing ACPI resume problems.

Reviewed by: peter


# 0906e0c5 01-Jan-2004 Nate Lawson <njl@FreeBSD.org>

Use <machine/asmacros.h> since <machine/asm.h> is a userland-only header
and gives very wrong macros for ENTRY(), etc. for kernel programs.

PR:
Suggested by: bde
Reviewed by:
Approved by:
Obtained from:
MFC after:


# 00295e74 31-Oct-2003 Nate Lawson <njl@FreeBSD.org>

Fix the logic to match the new name of the tunable.

Pointed out by: iwasaki


# cc65a50c 31-Oct-2003 Nate Lawson <njl@FreeBSD.org>

Change the reset video option to be positive (hw.acpi.reset_video).
Requested by: jhb

Initialize the real mode stack. This is needed at least for the return
address from the lcall.
Requested by: takawata

Fix style bugs in acpi_wakecode.S
Requested by: bde

Remove the kernel option now that we have the tunable.


# fbbdf7c7 30-Oct-2003 Mitsuru IWASAKI <iwasaki@FreeBSD.org>

Add sysctl MIB and loader tunable `hw.acpi.no_reset_video' as
the same effect as ACPI_NO_RESET_VIDEO kernel option.


# 92781c35 28-Oct-2003 Mitsuru IWASAKI <iwasaki@FreeBSD.org>

Add kernel option ACPI_NO_RESET_VIDEO as workaround for problems
(e.g. LCD white-out after resume) on some machine cased by
re-initialize video BIOS code in acpi_wakecode.


# 450b6ff6 26-Oct-2003 Nate Lawson <njl@FreeBSD.org>

Call the VESA reset BIOS vector on the resume path. This may help displays
after resume. I have not found it to break anything.


# cacbbaa7 28-Aug-2003 Nate Lawson <njl@FreeBSD.org>

Style cleanups.


# cef2a2e3 02-Jun-2003 David E. O'Brien <obrien@FreeBSD.org>

Use __FBSDID().


# 6161544c 20-Jul-2001 Takanori Watanabe <takawata@FreeBSD.org>

Add ACPI S2-S4BIOS Suspend/Resume code.
Some problems may remain.

Reviewed by:iwasaki