URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libcpu/] [sparc/] [syscall/] [syscall.S] - Rev 173
Compare with Previous | Blame | View Log
/** systrap.S** This file contains emulated system calls using software trap 0.* The following calls are supported:** + SYS_exit (halt)* + SYS_irqdis (disable interrupts)* + SYS_irqset (set interrupt level)** COPYRIGHT:** COPYRIGHT (c) 1995. European Space Agency.** This terms of the RTEMS license apply to this file.**/#include <asm.h>#include "syscall.h".seg "text"/** system call** On entry:** l0 = psr (from trap table)* l1 = pc* l2 = npc* g1 = system call id*/PUBLIC(syscall)SYM(syscall):subcc %g1, 2, %g0 ! syscall 2, disable interruptsbne 3for %l0, 0x0f00, %l4 ! set PIL=15mov %l4, %psror %l0, SPARC_PSR_ET_MASK, %i0 ! return old psr with ET=1ba,a 9f3:subcc %g1, 3, %g0 ! syscall 3, enable interruptsbne 1fand %i0, SPARC_PSR_PIL_MASK, %l4andn %l0, SPARC_PSR_PIL_MASK, %l5or %l5, %l4, %l4mov %l4, %psrba,a 9f1:ta 0 ! halt9: ! leavemov 0, %g1 ! clear %g1jmpl %l2, %g0rett %l2 + 4PUBLIC(sparc_disable_interrupts)SYM(sparc_disable_interrupts):mov SYS_irqdis, %g1ta 0retlnopPUBLIC(sparc_enable_interrupts)SYM(sparc_enable_interrupts):mov SYS_irqen, %g1ta 0retlnop/* end of file */
