From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LsBBC-0005kl-FX for qemu-devel@nongnu.org; Fri, 10 Apr 2009 03:29:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LsBBB-0005k9-JV for qemu-devel@nongnu.org; Fri, 10 Apr 2009 03:29:37 -0400 Received: from [199.232.76.173] (port=60122 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsBBB-0005k1-Am for qemu-devel@nongnu.org; Fri, 10 Apr 2009 03:29:37 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35430 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LsBBB-00077b-3O for qemu-devel@nongnu.org; Fri, 10 Apr 2009 03:29:37 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LsBBA-0000l8-2W for qemu-devel@nongnu.org; Fri, 10 Apr 2009 07:29:36 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LsBB9-0000l4-J7 for qemu-devel@nongnu.org; Fri, 10 Apr 2009 07:29:35 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Fri, 10 Apr 2009 07:29:35 +0000 Subject: [Qemu-devel] [7065] BSD user: add support for OpenBSD/i386 host Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 7065 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7065 Author: blueswir1 Date: 2009-04-10 07:29:34 +0000 (Fri, 10 Apr 2009) Log Message: ----------- BSD user: add support for OpenBSD/i386 host Modified Paths: -------------- trunk/cpu-exec.c Modified: trunk/cpu-exec.c =================================================================== --- trunk/cpu-exec.c 2009-04-10 03:36:49 UTC (rev 7064) +++ trunk/cpu-exec.c 2009-04-10 07:29:34 UTC (rev 7065) @@ -1165,17 +1165,28 @@ # define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->ss.eip)) # define TRAP_sig(context) ((context)->uc_mcontext->es.trapno) # define ERROR_sig(context) ((context)->uc_mcontext->es.err) +# define MASK_sig(context) ((context)->uc_sigmask) +#elif defined(__OpenBSD__) +# define EIP_sig(context) ((context)->sc_eip) +# define TRAP_sig(context) ((context)->sc_trapno) +# define ERROR_sig(context) ((context)->sc_err) +# define MASK_sig(context) ((context)->sc_mask) #else # define EIP_sig(context) ((context)->uc_mcontext.gregs[REG_EIP]) # define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO]) # define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR]) +# define MASK_sig(context) ((context)->uc_sigmask) #endif int cpu_signal_handler(int host_signum, void *pinfo, void *puc) { siginfo_t *info = pinfo; +#if defined(__OpenBSD__) + struct sigcontext *uc = puc; +#else struct ucontext *uc = puc; +#endif unsigned long pc; int trapno; @@ -1190,7 +1201,7 @@ return handle_cpu_signal(pc, (unsigned long)info->si_addr, trapno == 0xe ? (ERROR_sig(uc) >> 1) & 1 : 0, - &uc->uc_sigmask, puc); + &MASK_sig(uc), puc); } #elif defined(__x86_64__)