]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: Rename TARGET_ERESTARTSYS to QEMU_ERESTARTSYS
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 22 Nov 2021 18:47:33 +0000 (19:47 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 20 Dec 2021 04:47:33 +0000 (20:47 -0800)
This value is fully internal to qemu, and so is not a TARGET define.
We use this as an extra marker for both host and target errno.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
31 files changed:
linux-user/aarch64/cpu_loop.c
linux-user/alpha/cpu_loop.c
linux-user/arm/cpu_loop.c
linux-user/cris/cpu_loop.c
linux-user/generic/target_errno_defs.h
linux-user/hexagon/cpu_loop.c
linux-user/host/aarch64/safe-syscall.inc.S
linux-user/host/arm/safe-syscall.inc.S
linux-user/host/i386/safe-syscall.inc.S
linux-user/host/mips/safe-syscall.inc.S
linux-user/host/ppc64/safe-syscall.inc.S
linux-user/host/riscv/safe-syscall.inc.S
linux-user/host/s390x/safe-syscall.inc.S
linux-user/host/sparc64/safe-syscall.inc.S
linux-user/host/x86_64/safe-syscall.inc.S
linux-user/hppa/cpu_loop.c
linux-user/i386/cpu_loop.c
linux-user/m68k/cpu_loop.c
linux-user/microblaze/cpu_loop.c
linux-user/mips/cpu_loop.c
linux-user/openrisc/cpu_loop.c
linux-user/ppc/cpu_loop.c
linux-user/riscv/cpu_loop.c
linux-user/s390x/cpu_loop.c
linux-user/safe-syscall.h
linux-user/sh4/cpu_loop.c
linux-user/signal-common.h
linux-user/signal.c
linux-user/sparc/cpu_loop.c
linux-user/syscall.c
linux-user/xtensa/cpu_loop.c

index f9f3473288ff7f799d79bca7a7efca7a30369b74..ad9a8fdc25f54c3834ada5d024af0bc829a39049 100644 (file)
@@ -99,7 +99,7 @@ void cpu_loop(CPUARMState *env)
                              env->xregs[4],
                              env->xregs[5],
                              0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->pc -= 4;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                 env->xregs[0] = ret;
index 4029849d5cd387c0d07fcbd3fc8826e6635ef2c9..ce9b251ce3e01c94da38f8f8adc87da52565d19e 100644 (file)
@@ -98,7 +98,7 @@ void cpu_loop(CPUAlphaState *env)
                                     env->ir[IR_A2], env->ir[IR_A3],
                                     env->ir[IR_A4], env->ir[IR_A5],
                                     0, 0);
-                if (sysret == -TARGET_ERESTARTSYS) {
+                if (sysret == -QEMU_ERESTARTSYS) {
                     env->pc -= 4;
                     break;
                 }
index 01cb6eb534e0cc64dcf26605aff60e976c1cdf1a..1fcf19750e53e6d883d9247832aeda6fc916f8d4 100644 (file)
@@ -407,7 +407,7 @@ void cpu_loop(CPUARMState *env)
                                      env->regs[4],
                                      env->regs[5],
                                      0, 0);
-                    if (ret == -TARGET_ERESTARTSYS) {
+                    if (ret == -QEMU_ERESTARTSYS) {
                         env->regs[15] -= env->thumb ? 2 : 4;
                     } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                         env->regs[0] = ret;
index 0d5d268609a4905c4435c1875fe40e5fd20079dc..f3e5b13f89caca0a577f08a5cf70c4b5a532448c 100644 (file)
@@ -50,7 +50,7 @@ void cpu_loop(CPUCRISState *env)
                              env->pregs[7], 
                              env->pregs[11],
                              0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->pc -= 2;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                 env->regs[10] = ret;
index 17d85e0b61b6850eedfef9b5974027b058bc2d4f..58a06a10d63492cd54310a1adb0c8023846a578e 100644 (file)
  * after handling any pending signals. They match with the ones the guest
  * kernel uses for the same purpose.
  */
-#define TARGET_ERESTARTSYS     512     /* Restart system call (if SA_RESTART) */
+#define QEMU_ERESTARTSYS     512     /* Restart system call (if SA_RESTART) */
 
 /* QEMU internal, not visible to the guest. This is returned by the
  * do_sigreturn() code after a successful sigreturn syscall, to indicate
index e47f8348d56b451aff507a53c6f38cc84513f4f4..108d755ce0b4d5b04ab0b940538766b93e48cb14 100644 (file)
@@ -55,7 +55,7 @@ void cpu_loop(CPUHexagonState *env)
                              env->gpr[4],
                              env->gpr[5],
                              0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->gpr[HEX_REG_PC] -= 4;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                 env->gpr[0] = ret;
index 76a0a18a6c405682a205320c558ad6f0215dc40c..87c9580faa9468d94e6da87dd27f6631ea8e6fdf 100644 (file)
@@ -70,8 +70,7 @@ safe_syscall_end:
         b       safe_syscall_set_errno_tail
 
         /* code path when we didn't execute the syscall */
-2:      mov     w0, #TARGET_ERESTARTSYS
+2:      mov     w0, #QEMU_ERESTARTSYS
         b       safe_syscall_set_errno_tail
-
         .cfi_endproc
         .size   safe_syscall_base, .-safe_syscall_base
index 618112c6bfd3c3a5d99545c49ff8ac6e1aa66486..f1a6aabfd35f6bc2bfb3f54ade43e5053709ba67 100644 (file)
@@ -81,7 +81,7 @@ safe_syscall_end:
         pop     { r4, r5, r6, r7, r8, pc }
 
         /* code path when we didn't execute the syscall */
-2:      mov     r0, #TARGET_ERESTARTSYS
+2:      mov     r0, #QEMU_ERESTARTSYS
 
         /* code path setting errno */
 1:      pop     { r4, r5, r6, r7, r8, lr }
index f5883234bb0d1bdfaafbbc23f967a8861fdb874e..1fb031d2281b5f6a4665125cb5a600390f011ab4 100644 (file)
@@ -94,7 +94,7 @@ safe_syscall_end:
         jmp     1f
 
         /* code path when we didn't execute the syscall */
-2:      mov     $TARGET_ERESTARTSYS, %eax
+2:      mov     $QEMU_ERESTARTSYS, %eax
 
         /* code path setting errno */
 1:      pop     %ebx
index 041d1a6e6555dc814765ab76bf826911a40733ed..e9362e774d09d626d929e280cb27170fc7104e41 100644 (file)
@@ -127,7 +127,7 @@ safe_syscall_end:
         PTR_ADDIU sp, sp, FRAME
         .cfi_adjust_cfa_offset -FRAME
         .cfi_restore s0
-        li      v0, TARGET_ERESTARTSYS
+        li      v0, QEMU_ERESTARTSYS
 
         /* code path setting errno */
         /*
index 3a640cfc042818cac7eb31a02c083c246290accc..69d3c7009436f373464d2a815a26f955b622b481 100644 (file)
@@ -78,7 +78,7 @@ safe_syscall_end:
 
         /* code path when we didn't execute the syscall */
 2:      ld      14, 16(1) /* restore r14 */
-        addi    3, 0, TARGET_ERESTARTSYS
+        addi    3, 0, QEMU_ERESTARTSYS
 
         /* code path setting errno */
 1:      b       safe_syscall_set_errno_tail
index 54c2e23f7528cde2026989c2c172787ee92fb510..ca456d8a464d7e929b42a704d455c77fad5f916c 100644 (file)
@@ -72,7 +72,7 @@ safe_syscall_end:
         j       safe_syscall_set_errno_tail
 
         /* code path when we didn't execute the syscall */
-2:      li      a0, TARGET_ERESTARTSYS
+2:      li      a0, QEMU_ERESTARTSYS
         j       safe_syscall_set_errno_tail
 
         .cfi_endproc
index 899dab39e97691fcb2eed27e22bf92ae82831d6d..66f84385a295e60b3417fd5d470e8880e1bac35c 100644 (file)
@@ -91,7 +91,7 @@ safe_syscall_end:
 2:      lg      %r15,0(%r15)            /* load back chain */
         .cfi_adjust_cfa_offset -160
         lmg     %r6,%r15,48(%r15)       /* load saved registers */
-        lghi    %r2, TARGET_ERESTARTSYS
+        lghi    %r2, QEMU_ERESTARTSYS
         jg      safe_syscall_set_errno_tail
 
         .cfi_endproc
index 901db15959080a0c960dd869451a89ed2ce385dd..f4b3c0f9ae60f7913239a6efa8359c5b7fc5b061 100644 (file)
@@ -78,7 +78,7 @@ safe_syscall_end:
          nop
 
         /* code path when we didn't execute the syscall */
-2:      set     TARGET_ERESTARTSYS, %o0
+2:      set     QEMU_ERESTARTSYS, %o0
 
         /* code path setting errno */
 1:      mov     %o7, %g1
index 39b64250c3728f091b6f7b1b84a6c1bd9f444aaf..f88cbe1347eefba4bcab63841c4ce9fd2e3aa3ce 100644 (file)
@@ -82,7 +82,7 @@ safe_syscall_end:
         jmp     1f
 
         /* code path when we didn't execute the syscall */
-2:      mov     $TARGET_ERESTARTSYS, %eax
+2:      mov     $QEMU_ERESTARTSYS, %eax
 
         /* code path setting errno */
 1:      pop     %rbp
index 375576c8f09eded8e37e05a8686e13afc9637f71..5315224d1203673ea52343a7d9c495b1405e69de 100644 (file)
@@ -133,7 +133,7 @@ void cpu_loop(CPUHPPAState *env)
                 env->iaoq_f = env->gr[31];
                 env->iaoq_b = env->gr[31] + 4;
                 break;
-            case -TARGET_ERESTARTSYS:
+            case -QEMU_ERESTARTSYS:
             case -TARGET_QEMU_ESIGRETURN:
                 break;
             }
index f6a1cc632b1d0acd3636fd9d44a4e73fc15f803e..fbd9a353e564d07b402c9a30fdd5847a40c40e99 100644 (file)
@@ -180,7 +180,7 @@ static void emulate_vsyscall(CPUX86State *env)
     ret = do_syscall(env, syscall, env->regs[R_EDI], env->regs[R_ESI],
                      env->regs[R_EDX], env->regs[10], env->regs[8],
                      env->regs[9], 0, 0);
-    g_assert(ret != -TARGET_ERESTARTSYS);
+    g_assert(ret != -QEMU_ERESTARTSYS);
     g_assert(ret != -TARGET_QEMU_ESIGRETURN);
     if (ret == -TARGET_EFAULT) {
         goto sigsegv;
@@ -223,7 +223,7 @@ void cpu_loop(CPUX86State *env)
                              env->regs[R_EDI],
                              env->regs[R_EBP],
                              0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->eip -= 2;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                 env->regs[R_EAX] = ret;
@@ -241,7 +241,7 @@ void cpu_loop(CPUX86State *env)
                              env->regs[8],
                              env->regs[9],
                              0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->eip -= 2;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                 env->regs[R_EAX] = ret;
index 790bd558c3f4e64ce4ef9227db88f2d6a5af9f5f..b03c21a3dc25ed417021313d5078ea6303eb1f68 100644 (file)
@@ -80,7 +80,7 @@ void cpu_loop(CPUM68KState *env)
                                  env->dregs[5],
                                  env->aregs[0],
                                  0, 0);
-                if (ret == -TARGET_ERESTARTSYS) {
+                if (ret == -QEMU_ERESTARTSYS) {
                     env->pc -= 2;
                 } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                     env->dregs[0] = ret;
index a94467dd2da19b2cd72ed71f39a9f8b7a4954581..6e368f986eca243db9c66fb60f0d6c33ea393020 100644 (file)
@@ -53,7 +53,7 @@ void cpu_loop(CPUMBState *env)
                              env->regs[9], 
                              env->regs[10],
                              0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 /* Wind back to before the syscall. */
                 env->pc -= 4;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
index b735c99a24acf2b75f2f6eaa4eb558474a7e9df5..64f308c6ad8f08fa2a120241cfe37fd023a9a802 100644 (file)
@@ -141,7 +141,7 @@ done_syscall:
                              env->active_tc.gpr[8], env->active_tc.gpr[9],
                              env->active_tc.gpr[10], env->active_tc.gpr[11]);
 # endif /* O32 */
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->active_tc.PC -= 4;
                 break;
             }
index 3cfdbbf0372436b220b55c54ba15a95d287fee7c..3147ab2b627c8ba4980c572a96aa5bd21b4a4926 100644 (file)
@@ -48,7 +48,7 @@ void cpu_loop(CPUOpenRISCState *env)
                              cpu_get_gpr(env, 6),
                              cpu_get_gpr(env, 7),
                              cpu_get_gpr(env, 8), 0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->pc -= 4;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                 cpu_set_gpr(env, 11, ret);
index 483e669300f8c3eef02ba2b87e3e54a55d9fd1d8..5348641e9e74ef28c432c9d20d15b3a33083e3a2 100644 (file)
@@ -428,7 +428,7 @@ void cpu_loop(CPUPPCState *env)
             ret = do_syscall(env, env->gpr[0], env->gpr[3], env->gpr[4],
                              env->gpr[5], env->gpr[6], env->gpr[7],
                              env->gpr[8], 0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->nip -= 4;
                 break;
             }
index b301dac802e78d8b3d3e83e09e045c99897fde15..20f8c48b1d3c8af8b21a34f303ac9f72e7e80c31 100644 (file)
@@ -69,7 +69,7 @@ void cpu_loop(CPURISCVState *env)
                                  env->gpr[xA5],
                                  0, 0);
             }
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->pc -= 4;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                 env->gpr[xA0] = ret;
index d089c8417e766092380e129868ecb8758e70366a..043582ca7c32ea051cc1c8abe335883ca426a897 100644 (file)
@@ -83,7 +83,7 @@ void cpu_loop(CPUS390XState *env)
             ret = do_syscall(env, n, env->regs[2], env->regs[3],
                              env->regs[4], env->regs[5],
                              env->regs[6], env->regs[7], 0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->psw.addr -= env->int_svc_ilen;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                 env->regs[2] = ret;
index f43267a8fcf8f4d7adcdef7538ac33ee48da5326..61a04e2b5adf7b0306f0f97f4f2dac2e26f4c6e0 100644 (file)
  *
  * Call a system call if guest signal not pending.
  * This has the same API as the libc syscall() function, except that it
- * may return -1 with errno == TARGET_ERESTARTSYS if a signal was pending.
+ * may return -1 with errno == QEMU_ERESTARTSYS if a signal was pending.
  *
  * Returns: the system call result, or -1 with an error code in errno
- * (Errnos are host errnos; we rely on TARGET_ERESTARTSYS not clashing
+ * (Errnos are host errnos; we rely on QEMU_ERESTARTSYS not clashing
  * with any of the host errno values.)
  */
 
@@ -81,7 +81,7 @@
  * which are only technically blocking (ie which we know in practice won't
  * stay in the host kernel indefinitely) it's OK to use libc if necessary.
  * You must be able to cope with backing out correctly if some safe_syscall
- * you make in the implementation returns either -TARGET_ERESTARTSYS or
+ * you make in the implementation returns either -QEMU_ERESTARTSYS or
  * EINTR though.)
  *
  * block_signals() cannot be used for interruptible syscalls.
@@ -94,7 +94,7 @@
  * handler checks the interrupted host PC against the addresse of that
  * known section. If the PC is before or at the address of the syscall
  * instruction then we change the PC to point at a "return
- * -TARGET_ERESTARTSYS" code path instead, and then exit the signal handler
+ * -QEMU_ERESTARTSYS" code path instead, and then exit the signal handler
  * (causing the safe_syscall() call to immediately return that value).
  * Then in the main.c loop if we see this magic return value we adjust
  * the guest PC to wind it back to before the system call, and invoke
index ac9b01840c54de9ff4e6aa7a5cf75983a8c0ca6f..6c4ebfa9693b63cdcd06dd6c135fac2dc1e8d3bb 100644 (file)
@@ -50,7 +50,7 @@ void cpu_loop(CPUSH4State *env)
                              env->gregs[0],
                              env->gregs[1],
                              0, 0);
-            if (ret == -TARGET_ERESTARTSYS) {
+            if (ret == -QEMU_ERESTARTSYS) {
                 env->pc -= 2;
             } else if (ret != -TARGET_QEMU_ESIGRETURN) {
                 env->gregs[0] = ret;
index 7457f8025c477a5623b29448361af14eeff3c3b5..b9f33bb44f06f4094e9419195fc2274d755498c8 100644 (file)
@@ -76,7 +76,7 @@ abi_long do_swapcontext(CPUArchState *env, abi_ulong uold_ctx,
  * Block all signals, and arrange that the signal mask is returned to
  * its correct value for the guest before we resume execution of guest code.
  * If this function returns non-zero, then the caller should immediately
- * return -TARGET_ERESTARTSYS to the main loop, which will take the pending
+ * return -QEMU_ERESTARTSYS to the main loop, which will take the pending
  * signal and restart execution of the syscall.
  * If block_signals() returns zero, then the caller can continue with
  * emulation of the system call knowing that no signals can be taken
index ca8f24b9ecbfe1afde0a2115b4de33feb1f4d331..12b170528763c1474e791bdaa008a7839b96b34a 100644 (file)
@@ -213,7 +213,7 @@ int block_signals(void)
 
 /* Wrapper for sigprocmask function
  * Emulates a sigprocmask in a safe way for the guest. Note that set and oldset
- * are host signal set, not guest ones. Returns -TARGET_ERESTARTSYS if
+ * are host signal set, not guest ones. Returns -QEMU_ERESTARTSYS if
  * a signal was already pending and the syscall must be restarted, or
  * 0 on success.
  * If set is NULL, this is guaranteed not to fail.
@@ -230,7 +230,7 @@ int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
         int i;
 
         if (block_signals()) {
-            return -TARGET_ERESTARTSYS;
+            return -QEMU_ERESTARTSYS;
         }
 
         switch (how) {
@@ -985,7 +985,7 @@ int do_sigaction(int sig, const struct target_sigaction *act,
     }
 
     if (block_signals()) {
-        return -TARGET_ERESTARTSYS;
+        return -QEMU_ERESTARTSYS;
     }
 
     k = &sigact_table[sig - 1];
index 0ba65e431cd7fe09219a23d4cda62b0219c7626b..529337c5e0269ba0c7e7a51e9251eeacb7cb44ef 100644 (file)
@@ -181,7 +181,7 @@ void cpu_loop (CPUSPARCState *env)
                               env->regwptr[2], env->regwptr[3],
                               env->regwptr[4], env->regwptr[5],
                               0, 0);
-            if (ret == -TARGET_ERESTARTSYS || ret == -TARGET_QEMU_ESIGRETURN) {
+            if (ret == -QEMU_ERESTARTSYS || ret == -TARGET_QEMU_ESIGRETURN) {
                 break;
             }
             if ((abi_ulong)ret >= (abi_ulong)(-515)) {
index f1cfcc81048695222abc0a0f546d258f92e8f328..23fb45e0f1b7f02fc9ff1249fde08153e2b4bef7 100644 (file)
@@ -547,7 +547,7 @@ static inline abi_long get_errno(abi_long ret)
 
 const char *target_strerror(int err)
 {
-    if (err == TARGET_ERESTARTSYS) {
+    if (err == QEMU_ERESTARTSYS) {
         return "To be restarted";
     }
     if (err == TARGET_QEMU_ESIGRETURN) {
@@ -6458,7 +6458,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
         }
 
         if (block_signals()) {
-            return -TARGET_ERESTARTSYS;
+            return -QEMU_ERESTARTSYS;
         }
 
         fork_start();
@@ -8328,7 +8328,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
            Do thread termination if we have more then one thread.  */
 
         if (block_signals()) {
-            return -TARGET_ERESTARTSYS;
+            return -QEMU_ERESTARTSYS;
         }
 
         pthread_mutex_lock(&clone_lock);
@@ -9317,7 +9317,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
             ret = get_errno(safe_rt_sigsuspend(&ts->sigsuspend_mask,
                                                SIGSET_T_SIZE));
-            if (ret != -TARGET_ERESTARTSYS) {
+            if (ret != -QEMU_ERESTARTSYS) {
                 ts->in_sigsuspend = 1;
             }
         }
@@ -9336,7 +9336,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p, arg1, 0);
             ret = get_errno(safe_rt_sigsuspend(&ts->sigsuspend_mask,
                                                SIGSET_T_SIZE));
-            if (ret != -TARGET_ERESTARTSYS) {
+            if (ret != -QEMU_ERESTARTSYS) {
                 ts->in_sigsuspend = 1;
             }
         }
@@ -9452,13 +9452,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_sigreturn
     case TARGET_NR_sigreturn:
         if (block_signals()) {
-            return -TARGET_ERESTARTSYS;
+            return -QEMU_ERESTARTSYS;
         }
         return do_sigreturn(cpu_env);
 #endif
     case TARGET_NR_rt_sigreturn:
         if (block_signals()) {
-            return -TARGET_ERESTARTSYS;
+            return -QEMU_ERESTARTSYS;
         }
         return do_rt_sigreturn(cpu_env);
     case TARGET_NR_sethostname:
@@ -13145,7 +13145,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         static bool flag;
         flag = !flag;
         if (flag) {
-            return -TARGET_ERESTARTSYS;
+            return -QEMU_ERESTARTSYS;
         }
     }
 #endif
index a83490ab35a549e4dfd6ed4651c1284dac69492e..29cc6f3830b24a890234f61d29d8f3cea07d9fb1 100644 (file)
@@ -184,7 +184,7 @@ void cpu_loop(CPUXtensaState *env)
                     env->regs[2] = ret;
                     break;
 
-                case -TARGET_ERESTARTSYS:
+                case -QEMU_ERESTARTSYS:
                     env->pc -= 3;
                     break;