[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] uc_mcontext differences between Darwin and Linux

From: qemu
Subject: [Qemu-devel] uc_mcontext differences between Darwin and Linux
Date: Wed, 8 Oct 2003 05:45:33 -0700 (PDT)
User-agent: SquirrelMail/1.4.0

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



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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]