kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: fs.rajat@gmail.com (Rajat Sharma)
To: kernelnewbies@lists.kernelnewbies.org
Subject: fixed memory bytes
Date: Wed, 5 Jan 2011 11:43:16 +0530	[thread overview]
Message-ID: <AANLkTikqXG06sauSdEpPudVxEouLCwtzaMTAv2g7Xkt+@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimFtAxPEU2ePWCjdmkUFon3DMtc51TXD_RKyaRd@mail.gmail.com>

A nice kernel document regarding unaligned memory access. It may not
be directly answering all the questions asked, but once gone through
and understood completely, it will become easy to figure out how to
write portable kernel code.

http://lxr.linux.no/#linux+v2.6.36/Documentation/unaligned-memory-access.txt

Rajat

On Wed, Jan 5, 2011 at 4:29 AM, julie Sullivan <kernelmail.jms@gmail.com> wrote:
>
>> 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) .
>
> Hi Mohit
>
> I'm not sure whether we are interpreting your question correctly. Do you
> mean
>
> 1. you've seen some code in the kernel which you think means the size of a
> structure/
> variable (and its resulting binary footprint) is set to be the same (in
> bytes),
> regardless of the architecture, and you are confused about it?
>
> 2. you think that there should be a way of fixing the structure/variable
> (binary footprint)
> size to be the same (in bytes) regardless of the architecture and you are
> wondering if this
> is possible?
>
> In my (uninformed) opinion (2) is not be possible with the kernel due to
> portability
> issues - not only do natural word types differ (as others here are
> explaining) but you
> have no control over what optimization settings the kernel's user might set
> in gcc,
> for example. This is one of the problems with trying to maintain
> closed-source drivers
> and other binary code for the kernel, as I understand.
>
> Thanks
> Julie
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>

      reply	other threads:[~2011-01-05  6:13 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
     [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 [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=AANLkTikqXG06sauSdEpPudVxEouLCwtzaMTAv2g7Xkt+@mail.gmail.com \
    --to=fs.rajat@gmail.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).