qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for fil


From: Paul Brook
Subject: Re: [Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable
Date: Tue, 29 Jun 2010 12:30:16 +0100
User-agent: KMail/1.13.3 (Linux/2.6.33-2-amd64; KDE/4.4.4; x86_64; ; )

> On 06/28/2010 10:29 PM, Paul Brook wrote:
> >> diff --git a/exec-all.h b/exec-all.h
> >> index a775582..ebe88ad 100644
> >> --- a/exec-all.h
> >> +++ b/exec-all.h
> >> @@ -353,4 +353,8 @@ extern int singlestep;
> >> 
> >>   /* cpu-exec.c */
> >>   extern volatile sig_atomic_t exit_request;
> >> 
> >> +#ifdef NEED_GLOBAL_ENV
> >> +register CPUState *env asm(AREG0);
> >> +#endif
> > 
> > Wouldn't it be better to just put this in dyngen-exec.h ?
> > AFAICT there's a direct correlation between NEED_GLOBAL_ENV and #include
> > "exec.h".
> 
> True, see cover letter in 0/4.  I was told to make each file request
> explicitly the global variable though.  So I'd have to leave the #ifdef
> even if I moved it into dyngen-exec.h.

I don't understand what this is supposed to achieve.
The inclusion of exec.h is what defines whether this global variable is 
available.  Just as importantly, it also prevents code clobbering this value.  
Having one without the other makes no sense.

Making "env" available without including exec.h would be a different problem, 
but we never do that and would probably indicate we're doing something else 
wrong.

Paul



reply via email to

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