Re: fixed memory bytes
Please reply all..I added back list. On Tue, Jan 4, 2011 at 1:58 PM, mohit verma mohit89m...@gmail.com wrote: thnx john,. but i know that this indicates to compiler to align the structure to its nearest boundries. is that so? I am not sure of your definition of boundary, but I would say it does the opposite. It tells the compiler not to align the struct to boundaries. -- John ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: fixed memory bytes
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@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: fixed memory bytes
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@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@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies