source: rtems/c/src/lib/libcpu/sparc/syscall/syscall.S @ ac7af4a

4.104.115
Last change on this file since ac7af4a was 173fd7c, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/01/04 at 10:08:08

2004-04-01 Ralf Corsepius <ralf_corsepius@…>

  • reg_win/window.S: Include <rtems/asm.h> instead of <asm.h>.
  • syscall/syscall.S: Include <rtems/asm.h> instead of <asm.h>.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  systrap.S
3 *
4 *  This file contains emulated system calls using software trap 0.
5 *  The following calls are supported:
6 *
7 *    + SYS_exit        (halt)
8 *    + SYS_irqdis      (disable interrupts)
9 *    + SYS_irqset      (set interrupt level)
10 *
11 *  COPYRIGHT:
12 *
13 *  COPYRIGHT (c) 1995. European Space Agency.
14 *
15 *  This terms of the RTEMS license apply to this file.
16 *
17 */
18
19#include <rtems/asm.h>
20#include "syscall.h"
21
22        .seg    "text"
23        /*
24         *  system call
25         *
26         *  On entry:
27         *
28         *    l0 = psr (from trap table)
29         *    l1 = pc
30         *    l2 = npc
31         *    g1 = system call id
32         */
33
34        PUBLIC(syscall)
35
36SYM(syscall):
37
38        subcc   %g1, 2, %g0             ! syscall 2, disable interrupts
39        bne     3f
40        or      %l0, 0x0f00, %l4        ! set PIL=15
41        mov     %l4, %psr
42        or      %l0, SPARC_PSR_ET_MASK, %i0     ! return old psr with ET=1
43        ba,a    9f
443:
45        subcc   %g1, 3, %g0             ! syscall 3, enable interrupts
46        bne     1f
47        and     %i0, SPARC_PSR_PIL_MASK, %l4
48        andn    %l0, SPARC_PSR_PIL_MASK, %l5
49        or      %l5, %l4, %l4
50        mov     %l4, %psr
51        ba,a    9f
52
531:                                     
54        ta      0                       ! halt
559:                                      ! leave
56        mov     0, %g1                  ! clear %g1
57        jmpl    %l2, %g0
58        rett    %l2 + 4
59
60        PUBLIC(sparc_disable_interrupts)
61
62SYM(sparc_disable_interrupts):
63
64        mov     SYS_irqdis, %g1
65        ta      0
66        retl
67        nop
68
69        PUBLIC(sparc_enable_interrupts)
70
71SYM(sparc_enable_interrupts):
72
73        mov     SYS_irqen, %g1
74        ta      0
75        retl
76        nop
77
78/* end of file */
Note: See TracBrowser for help on using the repository browser.