From owner-freebsd-emulation@FreeBSD.ORG Sat Dec 20 23:57:44 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97BC01065670 for ; Sat, 20 Dec 2008 23:57:44 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.freebsd.org (Postfix) with ESMTP id 247F98FC13 for ; Sat, 20 Dec 2008 23:57:43 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: by gwyn.kn-bremen.de (Postfix, from userid 10) id 7E9BF1920DE; Sun, 21 Dec 2008 00:57:41 +0100 (CET) Received: from saturn.kn-bremen.de (noident@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.14.2/8.13.8) with ESMTP id mBKNjCDf055347; Sun, 21 Dec 2008 00:45:12 +0100 (CET) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.14.2/8.13.6/Submit) id mBKNjCUm055346; Sun, 21 Dec 2008 00:45:12 +0100 (CET) (envelope-from nox) Date: Sun, 21 Dec 2008 00:45:12 +0100 (CET) From: Juergen Lock Message-Id: <200812202345.mBKNjCUm055346@saturn.kn-bremen.de> To: blauwirbel@gmail.com X-Newsgroups: local.list.freebsd.emulation In-Reply-To: References: <20081218231724.GA17338@saturn.kn-bremen.de> Organization: home Cc: freebsd-emulation@freebsd.org, qemu-devel@nongnu.org Subject: Re: [Qemu-devel] testing qemu svn r6082 on FreeBSD - virtio-net, hpet, vmmouse/vga, got bsd-user to build, and an updated version of the FreeBSD -clock dynticks patch X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 23:57:44 -0000 In article you write: >On 12/19/08, Juergen Lock wrote: >> +#elif defined(__FreeBSD__) >> +# include >> + >> +# define RIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext.mc_rip)) >> +# define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) >> +# define ERROR_sig(context) ((context)->uc_mcontext.mc_err) >> #else >> #define QEMU_UC_MCONTEXT_GREGS(uc, reg) (uc)->uc_mcontext.gregs[(reg)] >> #define QEMU_UC_MACHINE_PC(uc) QEMU_UC_MCONTEXT_GREGS(uc, REG_RIP) > >> +#ifdef __FreeBSD__ >> + pc = RIP_sig(uc); >> + return handle_cpu_signal(pc, (unsigned long)info->si_addr, >> + TRAP_sig(uc) == 0xe ? >> + (ERROR_sig(uc) >> 1) & 1 : 0, >> + &uc->uc_sigmask, puc); >> +#else >> pc = QEMU_UC_MACHINE_PC(uc); >> return handle_cpu_signal(pc, (unsigned long)info->si_addr, >> QEMU_UC_MCONTEXT_GREGS(uc, REG_TRAPNO) == 0xe ? >> (QEMU_UC_MCONTEXT_GREGS(uc, REG_ERR) >> 1) & 1 : 0, >> &uc->uc_sigmask, puc); >> +#endif > >The idea here was that all OS define macros with same names so that >the code below does not get any more complex. Maybe the GREGS macro >was too generic, and should be replaced with one that only returns the >trap and error values. > Yeah I was too lazy to figure out the preprocessor magic needed to get the GREGS way working so I simply reused the macros from the i386 case. :) >> And finally the updated dynticks patch: > >This looks OK, please submit separately. OK will do. Thanx, Juergen