| |

VerySource

 Forgot password?
 Register
Search
View: 1591|Reply: 1

_attribute__

[Copy link]

2

Threads

3

Posts

0.00

Credits

Newbie

Rank: 1

Credits
0.00

 China

Post time: 2020-12-22 16:58:33
| Show all posts |Read mode
_attribute__ is a keyword, it is a C language extension of gcc, and regparm(0) means that parameters are not passed from the register. If it is __attribute__((regparm(3))),
Then when the function is called, the parameters are not passed through the stack, but directly placed in the register, and the called function directly takes the parameters from the register
Add the macro asmlinkage before the function definition to indicate that these functions pass parameters through the stack instead of through registers. When the gcc compiler calls c language functions during assembly
There are two ways to pass parameters: one is through the stack, and the other is through the register. Registers are used by default. If you want to call c language functions during your assembly process and want to pass parameters through the stack, you must add the macro asmlinkage before the function when you define the c function
Reply

Use magic Report

2

Threads

3

Posts

0.00

Credits

Newbie

Rank: 1

Credits
0.00

 China

 Author| Post time: 2020-12-22 17:03:20
| Show all posts
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list