Skip to contentSkip to conversation

linux-user/m68k: remove simulator syscall interface

PATCH New Laurent Vivier 1 participant 1 message May 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user/m68k: remove simulator syscall interface

This interface has been introduced in 2005 with the coldfire implementation (e6e5906b6e ColdFire target.) and looks like to do what the linux-user interface already does with the TRAP exception rather than the ILLEGAL exception.

This interface has not been maintained since that. The semi-hosting interface is not removed so coldfire kernel with semi-hosting is always supported.

---
 linux-user/Makefile.objs         |   1 -
 linux-user/m68k-sim.c            | 164 -------------------------------
 linux-user/m68k/cpu_loop.c       |  17 +---
 linux-user/m68k/target_syscall.h |   2 -
 linux-user/qemu.h                |   1 -
 5 files changed, 1 insertion(+), 184 deletions(-)
 delete mode 100644 linux-user/m68k-sim.c
linux-user/Makefile.objs +0 -1
index 769b8d8336..adae8e1b34 100644
@@ -6,4 +6,3 @@ obj-y = main.o syscall.o strace.o mmap.o signal.o \
 obj-$(TARGET_HAS_BFLT) += flatload.o
 obj-$(TARGET_I386) += vm86.o
 obj-$(TARGET_ARM) += arm/nwfpe/
-obj-$(TARGET_M68K) += m68k-sim.o
linux-user/m68k-sim.c deleted +0 -164

164 lines not on this page · raw message

linux-user/m68k/cpu_loop.c +1 -16
index bfb41bbcc5..1c8c2a6f70 100644
@@ -27,7 +27,6 @@ void cpu_loop(CPUM68KState *env)
     int trapnr;
     unsigned int n;
     target_siginfo_t info;
-    TaskState *ts = cs->opaque;
 
     for(;;) {
         cpu_exec_start(cs);
@@ -36,26 +35,14 @@ void cpu_loop(CPUM68KState *env)
         process_queued_cpu_work(cs);
 
         switch(trapnr) {
-        case EXCP_ILLEGAL:
-            {
-                if (ts->sim_syscalls) {
-                    uint16_t nr;
-                    get_user_u16(nr, env->pc + 2);
-                    env->pc += 4;
-                    do_m68k_simcall(env, nr);
-                } else {
-                    goto do_sigill;
-                }
-            }
-            break;
         case EXCP_HALT_INSN:
             /* Semihosing syscall.  */
             env->pc += 4;
             do_m68k_semihosting(env, env->dregs[0]);
             break;
+        case EXCP_ILLEGAL:
         case EXCP_LINEA:
         case EXCP_LINEF:
-        do_sigill:
             info.si_signo = TARGET_SIGILL;
             info.si_errno = 0;
             info.si_code = TARGET_ILL_ILLOPN;
@@ -79,7 +66,6 @@ void cpu_loop(CPUM68KState *env)
         case EXCP_TRAP0:
             {
                 abi_long ret;
-                ts->sim_syscalls = 0;
                 n = env->dregs[0];
                 env->pc += 2;
                 ret = do_syscall(env,
@@ -153,7 +139,6 @@ void target_cpu_copy_regs(CPUArchState *env, struct target_pt_regs *regs)
     env->aregs[7] = regs->usp;
     env->sr = regs->sr;
 
-    ts->sim_syscalls = 1;
     ts->stack_base = info->start_stack;
     ts->heap_base = info->brk;
     /* This will be filled in on the first SYS_HEAPINFO call.  */
linux-user/m68k/target_syscall.h +0 -2
index 632ee4fcf8..c0366b1c62 100644
@@ -26,6 +26,4 @@ struct target_pt_regs {
 
 #define TARGET_WANT_OLD_SYS_SELECT
 
-void do_m68k_simcall(CPUM68KState *, int);
-
 #endif /* M68K_TARGET_SYSCALL_H */
linux-user/qemu.h +0 -1
index 82d33d7e93..fab287b7ec 100644
@@ -116,7 +116,6 @@ typedef struct TaskState {
 #endif
     abi_ulong child_tidptr;
 #ifdef TARGET_M68K
-    int sim_syscalls;
     abi_ulong tp_value;
 #endif
 #if defined(TARGET_ARM) || defined(TARGET_M68K)
Signature · 1 line
2.20.1