qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Toni <tonygio04@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Qemu user-mode MacOS
Date: Thu, 20 Aug 2009 17:43:17 -0700	[thread overview]
Message-ID: <526ddcfc0908201743x2d37a468s29c9388007060f6f@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3839 bytes --]

Hi,I have a problem: I'm trying to install on Mac OS qemu user-mode, I need
it, and so I find out that the only way is correct the wrong part of the
source code of qemu darwin_user, I correct some errors, but now I found out
something that I don't undestand:

  CC    i386-darwin-user/cpu-exec.o
/Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c: In function
‘cpu_x86_signal_handler’:
/Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1182: error: dereferencing
pointer to incomplete type
/Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1183: error: dereferencing
pointer to incomplete type
/Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1186: error: dereferencing
pointer to incomplete type
/Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1187: error: dereferencing
pointer to incomplete type
make[1]: *** [cpu-exec.o] Error 1
make: *** [subdir-i386-darwin-user] Error 2

that is this part of code:

#1154# include <sys/ucontext.h>

#1168int cpu_signal_handler(int host_signum, void *pinfo,

#1169                       void *puc)

#1170{

#1171   siginfo_t *info = pinfo;

#1172    struct ucontext *uc = puc;

#1173    unsigned long pc;

#1174    int trapno;

#1175

#1176#ifndef REG_EIP

#1177/* for glibc 2.1 */

#1178#define REG_EIP    EIP

#1179#define REG_ERR    ERR

#1180#define REG_TRAPNO TRAPNO

#1181#endif

#1182  pc = EIP_sig(uc);

#1183    trapno = TRAP_sig(uc);

#1184    return handle_cpu_signal(pc, (unsigned long)info->si_addr,

#1185                             trapno == 0xe ?

#1186                             (ERROR_sig(uc) >> 1) & 1 : 0,

#1187                             &uc->uc_sigmask, puc);


the problem may be the ucontext definition of the uc variable, that is
defined in sys/ucontext.h, that call _structs.h where finally we found the
struct:


#ifdef __need_struct_ucontext

#undef __need_struct_ucontext

#ifndef _STRUCT_UCONTEXT

#if __DARWIN_UNIX03

#define _STRUCT_UCONTEXT        struct __darwin_ucontext

#else /* !__DARWIN_UNIX03 */

#define _STRUCT_UCONTEXT        struct ucontext

#endif /* __DARWIN_UNIX03 */

_STRUCT_UCONTEXT

{

        int                     uc_onstack;

        __darwin_sigset_t       uc_sigmask;     /* signal mask used by this
context */

        _STRUCT_SIGALTSTACK     uc_stack;       /* stack used by this
context */

        _STRUCT_UCONTEXT        *uc_link;       /* pointer to resuming
context */

        __darwin_size_t         uc_mcsize;      /* size of the machine
context passed in */

        _STRUCT_MCONTEXT        *uc_mcontext;   /* pointer to machine
specific context */

#ifdef _XOPEN_SOURCE

        _STRUCT_MCONTEXT        __mcontext_data;

#endif /* _XOPEN_SOURCE */

};

#endif /* _STRUCT_UCONTEXT */

#endif /* __need_struct_ucontext */


here I found _STRUCT_SIGALTSTACK that gave me the same error in another
part, in that case I resolved the error simply with the declaration of the
struct inside the code... but I think that is better now to understand why
it gives error.


The _STRUCT_SIGALTSTACK is also declared inside _structs.h:


#ifdef __need_struct_sigaltstack

#undef __need_struct_sigaltstack

/* Structure used in sigaltstack call. */

#ifndef _STRUCT_SIGALTSTACK

#if __DARWIN_UNIX03

#define _STRUCT_SIGALTSTACK     struct __darwin_sigaltstack

#else /* !__DARWIN_UNIX03 */

#define _STRUCT_SIGALTSTACK     struct sigaltstack

#endif /* __DARWIN_UNIX03 */

_STRUCT_SIGALTSTACK

{

        void            *ss_sp;         /* signal stack base */

        __darwin_size_t ss_size;        /* signal stack length */

        int             ss_flags;       /* SA_DISABLE and/or SA_ONSTACK */

};

#endif /* _STRUCT_SIGALTSTACK */

#endif /* __need_struct_sigaltstack */

[-- Attachment #2: Type: text/html, Size: 12622 bytes --]

             reply	other threads:[~2009-08-21  0:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-21  0:43 Toni [this message]
2009-08-22 15:14 ` [Qemu-devel] Qemu user-mode MacOS Blue Swirl

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=526ddcfc0908201743x2d37a468s29c9388007060f6f@mail.gmail.com \
    --to=tonygio04@gmail.com \
    --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).