From 3e0c6ff3a7e1e44cdf0cfa60f627a5a73de5b345 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 25 Dec 2006 23:05:24 +0000 Subject: * arm/licfunc.c (do_AngelSWI): Remove. * arm/syscalls.c (do_AngelSWI): Remove. * arm/swi.h (do_AngelSWI): New. --- libgloss/arm/swi.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libgloss/arm/swi.h') diff --git a/libgloss/arm/swi.h b/libgloss/arm/swi.h index f5c910313..7638dbe4e 100644 --- a/libgloss/arm/swi.h +++ b/libgloss/arm/swi.h @@ -66,3 +66,24 @@ #define AngelSWI_Reason_ReportException 0x18 #define ADP_Stopped_ApplicationExit ((2 << 16) + 38) #define ADP_Stopped_RunTimeError ((2 << 16) + 35) + +#if defined(ARM_RDI_MONITOR) && !defined(__ASSEMBLER__) + +static inline int +do_AngelSWI (int reason, void * arg) +{ + int value; + asm volatile ("mov r0, %1; mov r1, %2; " AngelSWIInsn " %a3; mov %0, r0" + : "=r" (value) /* Outputs */ + : "r" (reason), "r" (arg), "i" (AngelSWI) /* Inputs */ + : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc" + /* Clobbers r0 and r1, and lr if in supervisor mode */); + /* Accordingly to page 13-77 of ARM DUI 0040D other registers + can also be clobbered. Some memory positions may also be + changed by a system call, so they should not be kept in + registers. Note: we are assuming the manual is right and + Angel is respecting the APCS. */ + return value; +} + +#endif -- cgit v1.2.3