From 8df1f408fd8c4f67629f32470b5b7d94123bc305 Mon Sep 17 00:00:00 2001 From: Christian Mauderer Date: Mon, 2 Jun 2014 16:31:51 +0200 Subject: score/sparc: Add support for paravirtualization Guest systems in paravirtualization environments run usually in user mode. Thus it is not possible to directly access the PSR and TBR registers. Use functions instead of inline assembler to access these registers if RTEMS_PARAVIRT is defined. --- c/src/lib/libcpu/sparc/syscall/syscall.S | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'c/src/lib/libcpu/sparc/syscall') diff --git a/c/src/lib/libcpu/sparc/syscall/syscall.S b/c/src/lib/libcpu/sparc/syscall/syscall.S index a36ffaf220..9ce7fa54ef 100644 --- a/c/src/lib/libcpu/sparc/syscall/syscall.S +++ b/c/src/lib/libcpu/sparc/syscall/syscall.S @@ -83,4 +83,40 @@ SYM(sparc_syscall_exit): mov %o1, %g3 ! Additional exit code 2 ta 0 +#if defined(RTEMS_PARAVIRT) + + PUBLIC(_SPARC_Get_PSR) + +SYM(_SPARC_Get_PSR): + + retl + rd %psr, %o0 + + PUBLIC(_SPARC_Set_PSR) + +SYM(_SPARC_Set_PSR): + + mov %o0, %psr + nop + nop + nop + retl + nop + + PUBLIC(_SPARC_Get_TBR) + +SYM(_SPARC_Get_TBR): + + retl + rd %tbr, %o0 + + PUBLIC(_SPARC_Set_TBR) + +SYM(_SPARC_Set_TBR): + + retl + wr %o0, 0, %tbr + +#endif /* defined(RTEMS_PARAVIRT) */ + /* end of file */ -- cgit v1.2.3