From: Doug Evans <dje@google.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] fix typo in sim_state documentation
Date: Thu, 04 Feb 2010 21:46:00 -0000 [thread overview]
Message-ID: <e394668d1002041346q4ebe565fm89003bdd409fda31@mail.gmail.com> (raw)
In-Reply-To: <201002040205.23317.vapier@gentoo.org>
On Wed, Feb 3, 2010 at 11:05 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> the sim-base.h suggests you declare cpu storage in sim_state, but the proposed
> code causes build failures in some files such as sim-core and sim-cpu.c (since
> STATE_CPU() is supposed to return an lvalue).
>
> it also doesnt make sense with the common sim_cpu_alloc_all() which
> dynamically allocates the memory for each cpu.
>
> 2010-02-04 Mike Frysinger <vapier@gentoo.org>
>
> * sim-base.h: Declare sim_state.cpu as a pointer in the comment. Drop
> & from the STATE_CPU() examples.
>
> RCS file: /cvs/src/src/sim/common/sim-base.h,v
> retrieving revision 1.11
> diff -u -p -r1.11 sim-base.h
> --- sim/common/sim-base.h 1 Jan 2010 10:03:27 -0000 1.11
> +++ sim/common/sim-base.h 4 Feb 2010 07:02:42 -0000
> @@ -44,11 +44,11 @@ along with this program. If not, see <h
> };
>
> struct sim_state {
> - sim_cpu cpu[MAX_NR_PROCESSORS];
> + sim_cpu *cpu[MAX_NR_PROCESSORS];
> #if (WITH_SMP)
> - #define STATE_CPU(sd,n) (&(sd)->cpu[n])
> + #define STATE_CPU(sd,n) ((sd)->cpu[n])
> #else
> - #define STATE_CPU(sd,n) (&(sd)->cpu[0])
> + #define STATE_CPU(sd,n) ((sd)->cpu[0])
> #endif
> ... simulator specific members ...
> sim_state_base base;
>
This patch is ok. Thanks.
prev parent reply other threads:[~2010-02-04 21:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 7:05 Mike Frysinger
2010-02-04 21:46 ` Doug Evans [this message]
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=e394668d1002041346q4ebe565fm89003bdd409fda31@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=vapier@gentoo.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