siginfo fix for Darwin/Mac OS X, by Pierre d'Herbemont.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2369 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
		
							parent
							
								
									fd6776422b
								
							
						
					
					
						commit
						5a7b542bbd
					
				
							
								
								
									
										27
									
								
								cpu-exec.c
								
								
								
								
							
							
						
						
									
										27
									
								
								cpu-exec.c
								
								
								
								
							| 
						 | 
					@ -1280,9 +1280,10 @@ static void cpu_send_trap(unsigned long pc, int trap,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int cpu_signal_handler(int host_signum, struct siginfo *info, 
 | 
					int cpu_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
                       void *puc)
 | 
					                       void *puc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    siginfo_t *info = pinfo;
 | 
				
			||||||
    struct ucontext *uc = puc;
 | 
					    struct ucontext *uc = puc;
 | 
				
			||||||
    unsigned long pc;
 | 
					    unsigned long pc;
 | 
				
			||||||
    int trapno;
 | 
					    int trapno;
 | 
				
			||||||
| 
						 | 
					@ -1310,9 +1311,10 @@ int cpu_signal_handler(int host_signum, struct siginfo *info,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(__x86_64__)
 | 
					#elif defined(__x86_64__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int cpu_signal_handler(int host_signum, struct siginfo *info,
 | 
					int cpu_signal_handler(int host_signum, void *pinfo,
 | 
				
			||||||
                       void *puc)
 | 
					                       void *puc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    siginfo_t *info = pinfo;
 | 
				
			||||||
    struct ucontext *uc = puc;
 | 
					    struct ucontext *uc = puc;
 | 
				
			||||||
    unsigned long pc;
 | 
					    unsigned long pc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1374,9 +1376,10 @@ typedef struct ucontext SIGCONTEXT;
 | 
				
			||||||
# define TRAP_sig(context)			EXCEPREG_sig(exception, context) /* number of powerpc exception taken */
 | 
					# define TRAP_sig(context)			EXCEPREG_sig(exception, context) /* number of powerpc exception taken */
 | 
				
			||||||
#endif /* __APPLE__ */
 | 
					#endif /* __APPLE__ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int cpu_signal_handler(int host_signum, struct siginfo *info, 
 | 
					int cpu_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
                       void *puc)
 | 
					                       void *puc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    siginfo_t *info = pinfo;
 | 
				
			||||||
    struct ucontext *uc = puc;
 | 
					    struct ucontext *uc = puc;
 | 
				
			||||||
    unsigned long pc;
 | 
					    unsigned long pc;
 | 
				
			||||||
    int is_write;
 | 
					    int is_write;
 | 
				
			||||||
| 
						 | 
					@ -1397,9 +1400,10 @@ int cpu_signal_handler(int host_signum, struct siginfo *info,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(__alpha__)
 | 
					#elif defined(__alpha__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int cpu_signal_handler(int host_signum, struct siginfo *info, 
 | 
					int cpu_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
                           void *puc)
 | 
					                           void *puc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    siginfo_t *info = pinfo;
 | 
				
			||||||
    struct ucontext *uc = puc;
 | 
					    struct ucontext *uc = puc;
 | 
				
			||||||
    uint32_t *pc = uc->uc_mcontext.sc_pc;
 | 
					    uint32_t *pc = uc->uc_mcontext.sc_pc;
 | 
				
			||||||
    uint32_t insn = *pc;
 | 
					    uint32_t insn = *pc;
 | 
				
			||||||
| 
						 | 
					@ -1426,9 +1430,10 @@ int cpu_signal_handler(int host_signum, struct siginfo *info,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#elif defined(__sparc__)
 | 
					#elif defined(__sparc__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int cpu_signal_handler(int host_signum, struct siginfo *info, 
 | 
					int cpu_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
                       void *puc)
 | 
					                       void *puc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    siginfo_t *info = pinfo;
 | 
				
			||||||
    uint32_t *regs = (uint32_t *)(info + 1);
 | 
					    uint32_t *regs = (uint32_t *)(info + 1);
 | 
				
			||||||
    void *sigmask = (regs + 20);
 | 
					    void *sigmask = (regs + 20);
 | 
				
			||||||
    unsigned long pc;
 | 
					    unsigned long pc;
 | 
				
			||||||
| 
						 | 
					@ -1459,9 +1464,10 @@ int cpu_signal_handler(int host_signum, struct siginfo *info,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(__arm__)
 | 
					#elif defined(__arm__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int cpu_signal_handler(int host_signum, struct siginfo *info, 
 | 
					int cpu_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
                       void *puc)
 | 
					                       void *puc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    siginfo_t *info = pinfo;
 | 
				
			||||||
    struct ucontext *uc = puc;
 | 
					    struct ucontext *uc = puc;
 | 
				
			||||||
    unsigned long pc;
 | 
					    unsigned long pc;
 | 
				
			||||||
    int is_write;
 | 
					    int is_write;
 | 
				
			||||||
| 
						 | 
					@ -1476,9 +1482,10 @@ int cpu_signal_handler(int host_signum, struct siginfo *info,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(__mc68000)
 | 
					#elif defined(__mc68000)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int cpu_signal_handler(int host_signum, struct siginfo *info, 
 | 
					int cpu_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
                       void *puc)
 | 
					                       void *puc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    siginfo_t *info = pinfo;
 | 
				
			||||||
    struct ucontext *uc = puc;
 | 
					    struct ucontext *uc = puc;
 | 
				
			||||||
    unsigned long pc;
 | 
					    unsigned long pc;
 | 
				
			||||||
    int is_write;
 | 
					    int is_write;
 | 
				
			||||||
| 
						 | 
					@ -1498,8 +1505,9 @@ int cpu_signal_handler(int host_signum, struct siginfo *info,
 | 
				
			||||||
# define __ISR_VALID	1
 | 
					# define __ISR_VALID	1
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int cpu_signal_handler(int host_signum, struct siginfo *info, void *puc)
 | 
					int cpu_signal_handler(int host_signum, void *pinfo, void *puc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    siginfo_t *info = pinfo;
 | 
				
			||||||
    struct ucontext *uc = puc;
 | 
					    struct ucontext *uc = puc;
 | 
				
			||||||
    unsigned long ip;
 | 
					    unsigned long ip;
 | 
				
			||||||
    int is_write = 0;
 | 
					    int is_write = 0;
 | 
				
			||||||
| 
						 | 
					@ -1526,9 +1534,10 @@ int cpu_signal_handler(int host_signum, struct siginfo *info, void *puc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#elif defined(__s390__)
 | 
					#elif defined(__s390__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int cpu_signal_handler(int host_signum, struct siginfo *info, 
 | 
					int cpu_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
                       void *puc)
 | 
					                       void *puc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    siginfo_t *info = pinfo;
 | 
				
			||||||
    struct ucontext *uc = puc;
 | 
					    struct ucontext *uc = puc;
 | 
				
			||||||
    unsigned long pc;
 | 
					    unsigned long pc;
 | 
				
			||||||
    int is_write;
 | 
					    int is_write;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,8 +133,7 @@ void switch_mode(CPUARMState *, int);
 | 
				
			||||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
 | 
					/* you can call this signal handler from your SIGBUS and SIGSEGV
 | 
				
			||||||
   signal handlers to inform the virtual CPU of exceptions. non zero
 | 
					   signal handlers to inform the virtual CPU of exceptions. non zero
 | 
				
			||||||
   is returned if the signal was handled by the virtual CPU.  */
 | 
					   is returned if the signal was handled by the virtual CPU.  */
 | 
				
			||||||
struct siginfo;
 | 
					int cpu_arm_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
int cpu_arm_signal_handler(int host_signum, struct siginfo *info, 
 | 
					 | 
				
			||||||
                           void *puc);
 | 
					                           void *puc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define CPSR_M (0x1f)
 | 
					#define CPSR_M (0x1f)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -628,8 +628,7 @@ void cpu_x86_frstor(CPUX86State *s, uint8_t *ptr, int data32);
 | 
				
			||||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
 | 
					/* you can call this signal handler from your SIGBUS and SIGSEGV
 | 
				
			||||||
   signal handlers to inform the virtual CPU of exceptions. non zero
 | 
					   signal handlers to inform the virtual CPU of exceptions. non zero
 | 
				
			||||||
   is returned if the signal was handled by the virtual CPU.  */
 | 
					   is returned if the signal was handled by the virtual CPU.  */
 | 
				
			||||||
struct siginfo;
 | 
					int cpu_x86_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
int cpu_x86_signal_handler(int host_signum, struct siginfo *info, 
 | 
					 | 
				
			||||||
                           void *puc);
 | 
					                           void *puc);
 | 
				
			||||||
void cpu_x86_set_a20(CPUX86State *env, int a20_state);
 | 
					void cpu_x86_set_a20(CPUX86State *env, int a20_state);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,8 +97,7 @@ void cpu_m68k_close(CPUM68KState *s);
 | 
				
			||||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
 | 
					/* you can call this signal handler from your SIGBUS and SIGSEGV
 | 
				
			||||||
   signal handlers to inform the virtual CPU of exceptions. non zero
 | 
					   signal handlers to inform the virtual CPU of exceptions. non zero
 | 
				
			||||||
   is returned if the signal was handled by the virtual CPU.  */
 | 
					   is returned if the signal was handled by the virtual CPU.  */
 | 
				
			||||||
struct siginfo;
 | 
					int cpu_m68k_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
int cpu_m68k_signal_handler(int host_signum, struct siginfo *info, 
 | 
					 | 
				
			||||||
                           void *puc);
 | 
					                           void *puc);
 | 
				
			||||||
void cpu_m68k_flush_flags(CPUM68KState *, int);
 | 
					void cpu_m68k_flush_flags(CPUM68KState *, int);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -575,8 +575,7 @@ void cpu_ppc_close(CPUPPCState *s);
 | 
				
			||||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
 | 
					/* you can call this signal handler from your SIGBUS and SIGSEGV
 | 
				
			||||||
   signal handlers to inform the virtual CPU of exceptions. non zero
 | 
					   signal handlers to inform the virtual CPU of exceptions. non zero
 | 
				
			||||||
   is returned if the signal was handled by the virtual CPU.  */
 | 
					   is returned if the signal was handled by the virtual CPU.  */
 | 
				
			||||||
struct siginfo;
 | 
					int cpu_ppc_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
int cpu_ppc_signal_handler(int host_signum, struct siginfo *info, 
 | 
					 | 
				
			||||||
                           void *puc);
 | 
					                           void *puc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void do_interrupt (CPUPPCState *env);
 | 
					void do_interrupt (CPUPPCState *env);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -121,9 +121,8 @@ typedef struct CPUSH4State {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CPUSH4State *cpu_sh4_init(void);
 | 
					CPUSH4State *cpu_sh4_init(void);
 | 
				
			||||||
int cpu_sh4_exec(CPUSH4State * s);
 | 
					int cpu_sh4_exec(CPUSH4State * s);
 | 
				
			||||||
struct siginfo;
 | 
					int cpu_sh4_signal_handler(int host_signum, void *pinfo, 
 | 
				
			||||||
int cpu_sh4_signal_handler(int hostsignum, struct siginfo *info,
 | 
					                           void *puc);
 | 
				
			||||||
			   void *puc);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "softfloat.h"
 | 
					#include "softfloat.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -275,8 +275,7 @@ void cpu_set_cwp(CPUSPARCState *env1, int new_cwp);
 | 
				
			||||||
    } while (0)
 | 
					    } while (0)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct siginfo;
 | 
					int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
 | 
				
			||||||
int cpu_sparc_signal_handler(int hostsignum, struct siginfo *info, void *puc);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "cpu-all.h"
 | 
					#include "cpu-all.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue