What is "asmlinkage "? Jollen posted at October 26,200 A friend sent me a message saying that the system call data in the kernel is (c ), why is there a "asmlinkage" string before each prototype declaration? For example: AsmlinkageLong sys_nice (INT increment) "Asmlinkage" is an important GCC tag in i386 system call ). When System Call handler calls the corresponding system call routine, it pushes the value of the general-purpose memory recorder to the stack, therefore, the system call routine is used by the stack to retrieve the number of records of the System Call handler. This is the intention of asmlinkage standards. System Call handler is the assembly code, and system call routine (for example, sys_nice) is the C code. When assembly code calls the C function and uses the stack-based parameter data, add "asmlinkage" before the prototype of C function ". After "asmlinkage" is added, the C function retrieves the dynamic number from the stack instead of the Register (probably after Optimized Program ). More advanced description... The 80x86 assembly has two ways to calculate the number of rows: 1. Register Method 2. Stack Method Most of the Register Methods use the general-purpose Memory to collect statistics. This method is simple and fast. Another kind of practice is to use stack. The mode of assembly code is as follows: Push number1 Push number2 Push Number3 Call sum The simplest way to set values in 'sum' procedure is: Pop ax Pop ax Pop BX Pop CX Stack top is an IP address. The number of records that we assign to sum procedure is obtained from the last entry of the stack. Other related asmlinkage 1. asmlinkage is a definition 2. "asmlinkage" is specified in/Usr/include/Linux/linkage. h 3. If you have readLinkage. h, The "_ attribute _" method will be found. This method is used by GCC to define function attribute. -- Jollen |