revert between 56095 -> 55830 in arch
[AROS.git] / arch / .unmaintained / m68k-pp-native / exec / coldreboot.S
blob0937b6496c08d9915feec1a2b7c8d87c43833056
1 /*
2     Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3     $Id$
4 */
6 /*****************************************************************************
7  
8     NAME
9  
10         AROS_LH0(void, ColdReboot,
12     SYNOPSIS
14     LOCATION
15         struct ExecBase *, SysBase, 121, Exec)
17     FUNCTION
18         Reboots AROS.
20     INPUTS
22     RESULT
24     NOTES
25         This function never returns.
27     EXAMPLE
29     BUGS
31     SEE ALSO
33     INTERNALS
35     HISTORY
37 ******************************************************************************/
39         #include "../include/aros/machine.i"
41         .text
42         .balign 4
43         .globl  AROS_SLIB_ENTRY(ColdReboot,Exec)
44 AROS_SLIB_ENTRY(ColdReboot,Exec):
45         jsr     Disable(%a6)            /* disable */
46         moveq.l #0,%d0                  /* cache bits */
47         moveq.l #-1,%d1                 /* cache mask */
48         jsr     CacheControl(%a6)       /* disable all cache modes */
50         lea.l   resetus(%pc),%a5        /* actual reset routine */
51         jsr     Supervisor(%a6)         /* supervisor mode, ofcourse */
53         .balign 4
54 resetus:
55 //warning FIXME! This code won't work!
56         lea.l   initial_ssp,%a0         /* pointer to initial ssp */
57         move.l  (%a0),%d0               /* the initial ssp itself */
58         move.l  4(%a0),%a0              /* get vector from initial_ssp+4 */
59         reset                           /* reset stuff */
60         move.l  %d0,%ssp                /* load ssp with initial value -
61                                            hopefully I am in supervisor mode after reset - 
62                                            didn't read the manual... */
63         jmp     (%a0)                   /* this instruction was still in prefetch */
64         /* never gets here */