1c0fcfb293a9f43ac9885297651e9a5bfdb8aee4
[AROS.git] / arch / m68k-amiga / exec / coldreboot.c
blob1c0fcfb293a9f43ac9885297651e9a5bfdb8aee4
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: ColdReboot() - Reboot the computer.
6 Lang: english
7 */
9 #include <aros/debug.h>
11 #include "exec_intern.h"
12 #include "exec_util.h"
14 extern void Exec_MagicResetCode(void);
15 /* Reset everything but the CPU, then restart
16 * at the ROM exception vector
18 asm (
19 " .text\n"
20 " .align 4\n"
21 " .globl Exec_MagicResetCode\n"
22 "Exec_MagicResetCode:\n"
23 " nop\n"
24 " move.l #2,%a0\n"
25 " reset\n"
26 " jmp (%a0)\n"
30 /*****************************************************************************
32 NAME */
33 #include <proto/exec.h>
35 AROS_LH0(void, ColdReboot,
37 /* LOCATION */
38 struct ExecBase *, SysBase, 121, Exec)
40 /* FUNCTION
41 This function will reboot the computer.
43 INPUTS
44 None.
46 RESULT
47 This function does not return.
49 NOTES
50 It can be quite harmful to call this function. It may be possible that
51 you will lose data from other tasks not having saved, or disk buffers
52 not being flushed. Plus you could annoy the (other) users.
54 EXAMPLE
56 BUGS
58 SEE ALSO
60 ******************************************************************************/
62 AROS_LIBFUNC_INIT
64 /* Disable interrupts, and do all the reset callbacks
66 Exec_DoResetCallbacks((struct IntExecBase *)SysBase, SD_ACTION_WARMREBOOT);
68 Supervisor((ULONG_FUNC)Exec_MagicResetCode);
70 AROS_LIBFUNC_EXIT
71 } /* ColdReboot() */