From owner-freebsd-emulation@FreeBSD.ORG Sat Dec 20 21:21:26 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 6D20D1065678 for ; Sat, 20 Dec 2008 21:21:26 +0000 (UTC) (envelope-from blauwirbel@gmail.com) Received: from mail-bw0-f19.google.com (mail-bw0-f19.google.com [209.85.218.19]) by mx1.freebsd.org (Postfix) with ESMTP id BBB7F8FC0C for ; Sat, 20 Dec 2008 21:21:25 +0000 (UTC) (envelope-from blauwirbel@gmail.com) Received: by bwz12 with SMTP id 12so4270019bwz.19 for ; Sat, 20 Dec 2008 13:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=etJJB2pD7czcpbqguBccCgXhwo2RB/ACcFgJL1UXl6A=; b=TPMVK6Ba33z/XRKceCmr9XAVRUl3Rl2R3/bPJy0wi1KjwIyXhBZuxQ5zEWW+c+WFZy PkBKs7UNgNv+SPVcR+JWbSXa928CwJ1NTCEMdEFBQyCORNg5O8MFFn35KjIR0PybLlnq jI7J4Cvt58xAVqE8abZIEUr+Nkda/Y1yM3LeU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=eqj3fg5KWyYCxIJLePsnG/83pqaaroI9oDzHQ4u2NsPNvEHfJkLxJ0tTKYDqfsRL+G ya0iLjEzM/eb/HlpSy6elHueRIz/8i65dgRXKY5S0AAR8iQO+T5z9xwzJfbfI8daPvvh /pqZy4Oo7WUJKvQfa02KW4O/BBjud3pRnCxQ0= Received: by 10.223.111.205 with SMTP id t13mr3905679fap.62.1229808084252; Sat, 20 Dec 2008 13:21:24 -0800 (PST) Received: by 10.223.126.84 with HTTP; Sat, 20 Dec 2008 13:21:19 -0800 (PST) Message-ID: Date: Sat, 20 Dec 2008 23:21:19 +0200 From: "Blue Swirl" To: qemu-devel@nongnu.org, freebsd-emulation@freebsd.org In-Reply-To: <20081218231724.GA17338@saturn.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081218231724.GA17338@saturn.kn-bremen.de> Cc: 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 21:21:26 -0000 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. > And finally the updated dynticks patch: This looks OK, please submit separately.