From: Richard Henderson <rth@twiddle.net>
To: li guang <lig.fnst@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] tcg-arm: Implement tcg_register_jit
Date: Wed, 05 Jun 2013 05:49:44 -0700 [thread overview]
Message-ID: <51AF33E8.4010704@twiddle.net> (raw)
In-Reply-To: <1370397380.17798.73.camel@liguang.fnst.cn.fujitsu.com>
On 06/04/2013 06:56 PM, li guang wrote:
>> > +typedef struct {
>> > + uint32_t len __attribute__((aligned((sizeof(void *)))));
>> > + uint32_t cie_offset;
>> > + tcg_target_long func_start __attribute__((packed));
>> > + tcg_target_long func_len __attribute__((packed));
> suspicious usage of packed attribute here,
> since tcg_targe_long is either 32 or 64 bits,
> not a struct or union.
>
> Thanks!
>
Your question is worded poorly -- what has struct/union got to do with it? One
can adjust the alignment of any type. Perhaps you don't know what it is that
__attribute__((packed)) actually does?
While it's true that for ARM all four of these data members are 32-bit, and
thus none of the attributes are required, it's not actually wrong. Given that
this sort of boiler-plate tends to get copied from target to target, and since
the attributes *are* required for 64-bit hosts, I prefer to keep all such
structures defined similarly.
r~
next prev parent reply other threads:[~2013-06-05 12:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-24 21:20 [Qemu-devel] [PATCH 1/2] tcg-arm: Implement tcg_register_jit Richard Henderson
2013-05-24 21:20 ` [Qemu-devel] [PATCH 2/2] tcg: Fix high_pc fields in .debug_info Richard Henderson
2013-06-04 20:03 ` [Qemu-devel] [PATCH 1/2] tcg-arm: Implement tcg_register_jit Richard Henderson
2013-06-05 1:56 ` li guang
2013-06-05 12:49 ` Richard Henderson [this message]
2013-06-05 13:02 ` Andreas Färber
2013-06-05 13:04 ` Richard Henderson
2013-06-05 13:10 ` Peter Maydell
2013-06-05 13:17 ` Richard Henderson
2013-06-06 0:28 ` li guang
2013-06-06 12:48 ` Richard Henderson
2013-06-10 0:56 ` li guang
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=51AF33E8.4010704@twiddle.net \
--to=rth@twiddle.net \
--cc=lig.fnst@cn.fujitsu.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).