kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: jmahoney@waav.com (John Mahoney)
To: kernelnewbies@lists.kernelnewbies.org
Subject: fixed memory bytes
Date: Tue, 4 Jan 2011 13:24:56 -0500	[thread overview]
Message-ID: <AANLkTikSb6aABYJUaoHyqObusjqbCvvfCYAHY7edkFpB@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=ByJ6wKpNdexfS+GT940=DTr20AHEVJwPEPic_@mail.gmail.com>

On Tue, Jan 4, 2011 at 1:07 PM, Rajesh S R <srrajesh1989@gmail.com> wrote:
>
>
> On Tue, Jan 4, 2011 at 11:28 PM, Mulyadi Santosa <mulyadi.santosa@gmail.com>
> wrote:
>>
>> On Wed, Jan 5, 2011 at 00:40, mohit verma <mohit89mlnc@gmail.com> wrote:
>> >
>> > hi all,
>> > i have seen many places in? kernel where the variables specially the
>> > structures should be of? fixed size independent of the architecture. i
>> > went
>> > through the? definitions of them? but dint? get? clearly (or frankly
>> > say
>> > ...dint get them even a bit) .
>>
>> Your question isn't specific enough, so I'll just guess. Let's say
>> "int". In 32 bit, AFAIK it's ?4 byte, but in 64 bit (like IA 64, not
>> sure if it's x64) it's 8 byte. So, if you just say "int", you will
>> likely getting screwed up.
>>
>> By using types like u_int or something like that, you pretty much say
>> "I mean 4 byte kind of integer" etc
>
>
> Still there can be padding issues due to byte alignment, which may vary
> across architecture. Am not sure if that is controllable (probably some
> pragma to gcc?). Probably, OP is asking about it?

I believe you are referring to __attribute__( ( packed ) )

  reply	other threads:[~2011-01-04 18:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 17:40 fixed memory bytes mohit verma
2011-01-04 17:58 ` Mulyadi Santosa
2011-01-04 18:07   ` Rajesh S R
2011-01-04 18:24     ` John Mahoney [this message]
     [not found]       ` <AANLkTi=jsycWuiG0GdnNjMDz8LJ2amaS6YJsgKPYD3cU@mail.gmail.com>
2011-01-04 21:15         ` John Mahoney
2011-01-04 18:22   ` mohit verma
2011-01-04 18:25     ` Mulyadi Santosa
2011-01-04 19:17 ` Denis Kirjanov
2011-01-04 22:20   ` sk.syed2
2011-01-04 22:59 ` julie Sullivan
2011-01-05  6:13   ` Rajat Sharma

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=AANLkTikSb6aABYJUaoHyqObusjqbCvvfCYAHY7edkFpB@mail.gmail.com \
    --to=jmahoney@waav.com \
    --cc=kernelnewbies@lists.kernelnewbies.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).