From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org, freebsd-emulation@freebsd.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
Date: Sat, 20 Dec 2008 23:21:19 +0200 [thread overview]
Message-ID: <f43fc5580812201321u6478cb85qa33a7bb2ec4e9038@mail.gmail.com> (raw)
In-Reply-To: <20081218231724.GA17338@saturn.kn-bremen.de>
On 12/19/08, Juergen Lock <nox@jelal.kn-bremen.de> wrote:
> +#elif defined(__FreeBSD__)
> +# include <sys/ucontext.h>
> +
> +# 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.
next prev parent reply other threads:[~2008-12-20 21:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-18 23:17 [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 Juergen Lock
2008-12-20 21:21 ` Blue Swirl [this message]
2008-12-20 23:45 ` Juergen Lock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f43fc5580812201321u6478cb85qa33a7bb2ec4e9038@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=freebsd-emulation@freebsd.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).