2
* GRUB -- GRand Unified Bootloader
3
* Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc.
5
* GRUB is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* GRUB is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
21
* Note: These functions defined in this file may be called from C.
22
* Be careful of that you must not modify some registers. Quote
23
* from gcc-2.95.2/gcc/config/i386/i386.h:
25
1 for registers not available across function calls.
26
These must include the FIXED_REGISTERS and also any
27
registers that can be used without being saved.
28
The latter must include the registers where values are returned
29
and the register where structure-value addresses are passed.
30
Aside from that, you can include as many other registers as you like.
32
ax,dx,cx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg
33
{ 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
37
* Note: GRUB is compiled with the options -mrtd and -mregparm=3.
38
* So the first three arguments are passed in %eax, %edx, and %ecx,
39
* respectively, and if a function has a fixed number of arguments
40
* and the number if greater than three, the function must return
41
* with "ret $N" where N is ((the number of arguments) - 3) * 4.
45
* This is the area for all of the special variables.
48
#include <grub/symbol.h>
49
#include <grub/cpu/memory.h>
50
#include <grub/cpu/linux.h>
51
#include <grub/machine/memory.h>
57
* This next part is sort of evil. It takes advantage of the
58
* byte ordering on the x86 to work in either 16-bit or 32-bit
59
* mode, so think about it before changing it.
62
FUNCTION(grub_hard_stop)
64
jmp EXT_C(grub_hard_stop)
67
* grub_halt(int no_apm)
69
* Halt the system, using APM if possible. If NO_APM is true, don't use
70
* APM even if it is available.
84
jc EXT_C(grub_hard_stop)
85
/* don't check %bx for buggy BIOSes... */
87
/* disconnect APM first */
96
jc EXT_C(grub_hard_stop)
98
/* set APM protocol level - 1.1 or bust. (this covers APM 1.2 also) */
103
jc EXT_C(grub_hard_stop)
105
/* set the power state to off */
111
/* shouldn't reach here */
112
jmp EXT_C(grub_hard_stop)