1/*- 2 * Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org> 3 * Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/i386/acpica/acpi_wakecode.S 145397 2005-04-22 09:53:04Z iedowse $ |
28 */ 29 30#define LOCORE 31 32#include <machine/asmacros.h> |
33#include <machine/specialreg.h> 34 |
35#include "assym.s" 36 |
37 .align 4 38 .code16 39wakeup_16: 40 nop 41 cli 42 43 /* 44 * Set up segment registers for real mode and a small stack for --- 50 unchanged lines hidden (view full) --- 95 96 /* Enable protected mode */ 97 mov %cr0,%eax 98 orl $(CR0_PE),%eax 99 mov %eax,%cr0 100 101wakeup_sw32: 102 /* Switch to protected mode by intersegmental jump */ |
103 ljmpl $KCSEL,$0x12345678 /* Code location, to be replaced */ |
104 105 .code32 106wakeup_32: 107 /* 108 * Switched to protected mode w/o paging 109 * %esi: KERNEL stack pointer (physical address) 110 */ 111 112 nop 113 114 /* Set up segment registers for protected mode */ |
115 movw $KDSEL,%ax /* KDSEL to segment registers */ |
116 movw %ax,%ds 117 movw %ax,%es 118 movw %ax,%gs 119 movw %ax,%ss |
120 movw $KPSEL,%ax /* KPSEL to %fs */ |
121 movw %ax,%fs 122 movl %esi,%esp /* physical address stack pointer */ 123 124wakeup_32stack: 125 /* Operands are overwritten in 16bit code */ 126 pushl $0xabcdef09 /* ss + dummy */ 127 pushl $0xabcdef08 /* fs + gs */ 128 pushl $0xabcdef07 /* ds + es */ --- 111 unchanged lines hidden --- |