]> Git Repo - qemu.git/blobdiff - cpu-i386.h
better signal/exception support
[qemu.git] / cpu-i386.h
index 9125ecadc53b24f3d2bbbf9d251a6bc8dfaff3c4..dbe18519bc6fdc11bef622a589867de01be602f1 100644 (file)
@@ -68,7 +68,7 @@
 #define EXCP11_ALGN    18
 #define EXCP12_MCHK    19
 
 #define EXCP11_ALGN    18
 #define EXCP12_MCHK    19
 
-#define EXCP_SIGNAL    256 /* async signal */
+#define EXCP_INTERRUPT         256 /* async interruption */
 
 enum {
     CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */
 
 enum {
     CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */
@@ -170,9 +170,10 @@ typedef struct CPUX86State {
     /* various CPU modes */
     int vm86;
 
     /* various CPU modes */
     int vm86;
 
-    /* exception handling */
+    /* exception/interrupt handling */
     jmp_buf jmp_env;
     int exception_index;
     jmp_buf jmp_env;
     int exception_index;
+    int interrupt_request;
 } CPUX86State;
 
 /* all CPU memory access use these macros */
 } CPUX86State;
 
 /* all CPU memory access use these macros */
@@ -383,11 +384,19 @@ int cpu_x86_inl(int addr);
 
 CPUX86State *cpu_x86_init(void);
 int cpu_x86_exec(CPUX86State *s);
 
 CPUX86State *cpu_x86_init(void);
 int cpu_x86_exec(CPUX86State *s);
+void cpu_x86_interrupt(CPUX86State *s);
 void cpu_x86_close(CPUX86State *s);
 
 /* needed to load some predefinied segment registers */
 void cpu_x86_load_seg(CPUX86State *s, int seg_reg, int selector);
 
 void cpu_x86_close(CPUX86State *s);
 
 /* needed to load some predefinied segment registers */
 void cpu_x86_load_seg(CPUX86State *s, int seg_reg, int selector);
 
+/* you can call these signal handler from you SIGBUS and SIGSEGV
+   signal handlers to inform the virtual CPU of exceptions. non zero
+   is returned if the signal was handled by the virtual CPU.  */
+struct siginfo;
+int cpu_x86_signal_handler(int host_signum, struct siginfo *info, 
+                           void *puc);
+
 /* internal functions */
 
 #define GEN_FLAG_CODE32_SHIFT 0
 /* internal functions */
 
 #define GEN_FLAG_CODE32_SHIFT 0
This page took 0.018926 seconds and 4 git commands to generate.