blob: 24c076f1b290386a2369d91299c2d4afa6365e0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
.section .text
.global _start
.type _start, @function
_start:
mov $_bss_end, %esp // the stack is at the top of bss
call sysenter_setup
push %ebx // address of the Multiboot struct
call kmain_early
.global cpu_shutdown
.type cpu_shutdown, @function
cpu_shutdown:
/* This quits QEMU. While I couldn't find this officially documented anywhere,
* it is used by QEMU in tests/tcg/i386/system/boot.S (as of commit 40d6ee), so
* I assume that this is safe-ish to use */
mov $0x604, %edx
mov $0x2000, %eax
outw %ax, %dx
.global halt_cpu
.type halt_cpu, @function
halt_cpu:
cli
1: hlt
jmp 1b
.global cpu_pause
.type cpu_pause, @function
cpu_pause:
sti
hlt
cli
ret
|