Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12322

asmlinkage defined to nothing in linux code

$
0
0

I was looking into asmlinkage tag.

From https://kernelnewbies.org/FAQ/asmlinkage

This is a #define for some gcc magic that tells the compiler that the function should not expect to find any of its arguments in registers (a common optimization), but only on the CPU's stack.

Looking into definition, it is defined to empty for x86_64

#ifdef __cplusplus
#define CPP_ASMLINKAGE extern "C"
#else
#define CPP_ASMLINKAGE
#endif

#ifndef asmlinkage
#define asmlinkage CPP_ASMLINKAGE
#endif

Also, i read that the ABI spec says that we should place system call number in a register, and paramters in some other registers.

Then why we are looking for function parameters in stack. Is system call number also placed in stack?


Viewing all articles
Browse latest Browse all 12322

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>