qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] uc_mcontext differences between Darwin and Linux
@ 2003-10-08 12:45 qemu
  0 siblings, 0 replies; only message in thread
From: qemu @ 2003-10-08 12:45 UTC (permalink / raw)
  To: qemu-devel

In cpu-exec.c, you reference the mcontext struct. The Darwin structs are a
bit different. Attached below are snippets of relevent code from the
header files. What is necessary for me to do to your code to make it work
with the darwin mcontext structs? Some of it seems obvious, but since you
are much more intimately familiar with your code, I figure you might have
some valuable input.

So far, I have changed lines like:
     struct pt_regs *regs = uc->uc_mcontext.regs;
to:
     struct pt_regs *regs = uc->uc_mcontext->ss;
Which actually is not going to compile in the end anyway. What is pt_regs?
I cannot find it defined anywhere.

Ray

---

struct mcontext {
        ppc_exception_state_t   es;
        ppc_thread_state_t      ss;
        ppc_float_state_t       fs;
        ppc_vector_state_t      vs;
};

typedef struct ppc_thread_state {
        unsigned int srr0;      /* Instruction address register (PC) */
        unsigned int srr1;      /* Machine state register (supervisor) */
        unsigned int r0;
        unsigned int r1;
        unsigned int r2;
        ... <snip> ...
        unsigned int r30;
        unsigned int r31;

        unsigned int cr;        /* Condition register */
        unsigned int xer;       /* User's integer exception register */
        unsigned int lr;        /* Link register */
        unsigned int ctr;       /* Count register */
        unsigned int mq;        /* MQ register (601 only) */

        unsigned int vrsave;    /* Vector Save Register */
} ppc_thread_state_t;

typedef struct ppc_exception_state {
        unsigned long dar;      /* Fault registers for coredump */
        unsigned long dsisr;
        unsigned long exception;/* number of powerpc exception taken */
        unsigned long pad0;     /* align to 16 bytes */

        unsigned long pad1[4];  /* space in PCB "just in case" */
} ppc_exception_state_t;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-08 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-08 12:45 [Qemu-devel] uc_mcontext differences between Darwin and Linux qemu

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).