]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/xen/plan9l.s
ether82563: add 0x15bd i219-lm variant (thanks crab1)
[plan9front.git] / sys / src / 9 / xen / plan9l.s
1 #include "xendefs.h"
2 #include "mem.h"
3
4 /*
5  * This must match io.h.
6  */
7 #define VectorSYSCALL   0x40
8
9 /*
10  *  Used to get to the first process:
11  *      set up an interrupt return frame and IRET to user level.
12  */
13 TEXT touser(SB), $0
14         PUSHL   $(UDSEL)                        /* old ss */
15         MOVL    sp+0(FP), AX                    /* old sp */
16         PUSHL   AX
17         MOVL    $0x200, AX                      /* interrupt enable flag */
18         PUSHL   AX                              /* old flags */
19         PUSHL   $(UESEL)                        /* old cs */
20         PUSHL   $(UTZERO+32)                    /* old pc */
21         MOVL    $(UDSEL), AX
22         MOVW    AX, DS
23         MOVW    AX, ES
24         MOVW    AX, GS
25         MOVW    AX, FS
26         IRETL
27
28 /*
29  * This is merely _strayintr from l.s optimised to vector
30  * to syscall() without going through trap().
31  */
32 TEXT _syscallintr(SB), $0
33         PUSHL   $VectorSYSCALL                  /* trap type */
34
35         PUSHL   DS
36         PUSHL   ES
37         PUSHL   FS
38         PUSHL   GS
39         PUSHAL
40         MOVL    $(KDSEL), AX
41         MOVW    AX, DS
42         MOVW    AX, ES
43         PUSHL   SP
44         CALL    syscall(SB)
45
46         POPL    AX
47         POPAL
48         POPL    GS
49         POPL    FS
50         POPL    ES
51         POPL    DS
52         ADDL    $8, SP                          /* pop error code and trap type */
53         IRETL