Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / x68k / stand / loadbsd / trampoline.S
blobbded8a440825116c62837b01423793a470af0a5f
2 |       copy binary image and execute
4 |       written by Yasha (ITOH Yasufumi)
5 |       public domain
7 |       $NetBSD: trampoline.S,v 1.1 1998/09/01 19:55:33 itohy Exp $
9 #include <machine/asm.h>
10 #include "trampoline.h"
12 |    arg+0              bsr trampoline
13 |       +4      %a3+0   temporary stack address
14 |       +8      %a3+4   processor type
15 |       +12     %a3+8   struct execkern_arg
16 |       +52             trampoline
18 ENTRY_NOPROFILE(trampoline)
19         oriw    #0x0700,%sr             | keep out interrupts
21         moveal  %sp@+,%a3
22         moveal  %a3@+,%sp               | set temporary stack
24         movel   %a3@+,%d2               | MPU type
26         |
27         | turn off MMU
28         |
29         moveq   #MPU_68030,%d0
30         cmpl    %d2,%d0
31         bccs    Lmmu030
32         | 040/060
33         moveq   #0,%d0
34         .long   0x4E7B0003              | movec %d0,%tc
35         .long   0x4E7B0004              | movec %d0,%itt0
36         .long   0x4E7B0005              | movec %d0,%itt1
37         .long   0x4E7B0006              | movec %d0,%dtt0
38         .long   0x4E7B0007              | movec %d0,%dtt1
39         .long   0x4E7B0806              | movec %d0,%urp
40         .long   0x4E7B0807              | movec %d0,%srp
41         bras    Lmmudone
42 Lmmu030:
43         | 020/030
44         clrl    %sp@-
45         .long   0xF0174000              | pmove %sp@,%tc
46         cmpl    %d0,%d2
47         bnes    Lmmu020                 | 68851 has no tt regs
48         .long   0xF0170800              | pmove %sp@,%tt0
49         .long   0xF0170C00              | pmove %sp@,%tt1
50 Lmmu020:
51         movel   #0x7fff0001,%sp@-       | null root pointer
52         .long   0xF0174C00              | pmove %sp@,%crp
53         .long   0xF0174800              | pmove %sp@,%srp
54         addql   #8,%sp
55 Lmmudone:
57         | minimize supervisor protection
58         clrb    AREA_SET_REG
60         | reset VBR (for compatibility)
61         subal   %a1,%a1
62         .long   0x4E7B9801              | movec %a1,%vbr
64         | then transfer and exec kernel
66 #define XK_NO_C_INTERFACE               /* pass arg with %a3 */
67 #include "../common/execkern.S"
69 GLOBAL(end_trampoline)