prism2.device: Compiler delint
[AROS.git] / arch / m68k-amiga / boot / superstack_swap.S
blob7a78b9610cb9d1edd03779558b8713b7d86f9ad1
1 /*
2     Copyright © 2011, The AROS Development Team. All rights reserved.
3     $Id$
5     Desc: SuperstackSwap() - set up a new supervisor stack
6     Lang: english
8     This routine is expected to be called from Exec/Supervisor().
11 /*****************************************************************************
13     NAME
14         SuperstackSwap
16     LOCATION
18     FUNCTION
19         Sets up the new Supervisor stack
21     INPUTS
22         None.
24     RESULT
26     NOTES
27         Must be called from Exec/Supervisor()
29     EXAMPLE
31     BUGS
33     SEE ALSO
35     INTERNALS
37 ******************************************************************************/
38         #include "aros/m68k/asm.h"
40 /* On entry, the stack looks like:
41  *   UWORD 0x0020  (only on 68010+)
42  *   ULONG PC
43  *   UWORD STATUS
44  * A6 = SysBase
45  * A5 = void SuperstackSwap(void)
46  *
47  * D0/D1 and A0/A1 can be used as scratch
48  */
49         .text
50         .balign 4
51         .globl SuperstackSwap
52 SuperstackSwap:
53         move.l  %a6@(SysStkUpper),%a0
54        moveq.l #-6,%d0
55         btst    #0, %a6@(AttnFlags+1)   // If 68010+, copy frame ID
56         beq     0f
57         subq.l  #2,%d0                  // Add 68010 space
59         lea.l   %a0@(%d0),%a1
61         move.w  %sp@+,%a0@(%d0)
62         addq.l  #2,%d0
63         bne     1b
64         move.l  %a1,%sp
65         rte