Understanding disassembly x86 + understanding function call + parameter pass and stack frame

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Wed Aug 14 06:55:07 EDT 2013


On Wed, 14 Aug 2013 15:51:20 +0530, nidhi mittal hada said:

> *for x86_64 architecture and linux as operating system , GCC as compiler ,
> the calling convention to be followed is AMD64 ABI.*
> right?
>
> *My doubt is :-*
> 1) Is the above statement true only for stack frames function call etc ?
> OR
> Is the above statement true for other things related to architecture,
> like for knowing data type sizes, endianness, alignment ..
>
> as http://www.uclibc.org/docs/psABI-x86_64.pdf, mentions , data type size
> alignment etc everything ...
> are these things same for AMD and x86 architecture both ???

AMD developed the 64-bit extensions, Intel adopted them as well. The two
architectures are identical for alignment, word sizes, opcodes, and all that
stuff, until you get to truly processor-dependent things like whether it has
SSE3, SSE4, SSE42 extension opcodes, specific MSRs that are only available on
certain family/model/stepping, and so on.  So unless you're looking at *very
specific* things like "Does this particular Intel i5 chipset have the VT-D
extension?" or "how does this CPU handle on the fly firmware updates?" you can
treat the AMD and Intel 64-bit architectures the same.  By the time you're
looking at *that* level of detail, there's more difference between an Intel
Atom N4xx and an Intel Sandy Bridge-based Xeon than there is between Intel and
AMD, even though they're all able to run x86_64.

And if you're doing *that* sort of coding, you want to go look at how
the code that handles the /proc/cpuinfo pseudo-file handles the the
'flags' line, and how code uses the bits presented there, and how the
kernel determines which cpufreq driver to use, and so on...


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130814/87245ed6/attachment.bin 


More information about the Kernelnewbies mailing list