]> git.proxmox.com Git - qemu.git/blobdiff - darwin-user/signal.c
Merge branch 'stable-0.15' of git://git.qemu.org/qemu
[qemu.git] / darwin-user / signal.c
index a0b9f89dcc4eef2d3c545afbbff4a08d07ee9f5f..e2adca3918aca91f3654bb90016e0a91b76fc406 100644 (file)
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <signal.h>
 #include <errno.h>
 #include <sys/ucontext.h>
 
@@ -33,9 +31,8 @@
 #undef uc_link
 #endif
 
-#include <signal.h>
-
 #include "qemu.h"
+#include "qemu-common.h"
 
 #define DEBUG_SIGNAL
 
@@ -54,7 +51,7 @@ struct emulated_sigaction {
                              first signal, we put it here */
 };
 
-struct sigaltstack target_sigaltstack_used = {
+static struct sigaltstack target_sigaltstack_used = {
     0, 0, SA_DISABLE
 };
 
@@ -131,7 +128,7 @@ static inline void free_sigqueue(struct sigqueue *q)
 }
 
 /* abort execution with signal */
-void __attribute((noreturn)) force_sig(int sig)
+void QEMU_NORETURN force_sig(int sig)
 {
     int host_sig;
     host_sig = target_to_host_signal(sig);
@@ -198,11 +195,7 @@ static void host_signal_handler(int host_signum, siginfo_t *info,
 
     /* the CPU emulator uses some host signals to detect exceptions,
        we we forward to it some signals */
-    if (host_signum == SIGSEGV || host_signum == SIGBUS
-#if defined(TARGET_I386) && defined(USE_CODE_COPY)
-        || host_signum == SIGFPE
-#endif
-        ) {
+    if (host_signum == SIGSEGV || host_signum == SIGBUS) {
         if (cpu_signal_handler(host_signum, (void*)info, puc))
             return;
     }
@@ -217,7 +210,7 @@ static void host_signal_handler(int host_signum, siginfo_t *info,
 #endif
     if (queue_signal(sig, &tinfo) == 1) {
         /* interrupt the virtual CPU as soon as possible */
-        cpu_interrupt(global_env, CPU_INTERRUPT_EXIT);
+        cpu_exit(global_env);
     }
 }
 
@@ -459,5 +452,3 @@ handle_signal:
     if (q != &k->info)
         free_sigqueue(q);
 }
-
-