From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [patch] fix typo in sim_state documentation
Date: Thu, 04 Feb 2010 07:05:00 -0000 [thread overview]
Message-ID: <201002040205.23317.vapier@gentoo.org> (raw)
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;
next reply other threads:[~2010-02-04 7:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 7:05 Mike Frysinger [this message]
2010-02-04 21:46 ` Doug Evans
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=201002040205.23317.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.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