OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libcpu/] [sparc/] [syscall/] [syscall.S] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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 
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
 
36
SYM(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
44
3:
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
 
53
1:
54
        ta      0                        ! halt
55
9:                                      ! leave
56
        mov     0, %g1                  ! clear %g1
57
        jmpl    %l2, %g0
58
        rett    %l2 + 4
59
 
60
        PUBLIC(sparc_disable_interrupts)
61
 
62
SYM(sparc_disable_interrupts):
63
 
64
        mov     SYS_irqdis, %g1
65
        ta      0
66
        retl
67
        nop
68
 
69
        PUBLIC(sparc_enable_interrupts)
70
 
71
SYM(sparc_enable_interrupts):
72
 
73
        mov     SYS_irqen, %g1
74
        ta      0
75
        retl
76
        nop
77
 
78
/* end of file */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.