No pbr in extern call?

I'm trying to do a pass by reference in an extern function call.

extern void getCpuid(int &a, int &b, int &c, int &d);

kernel.c:4:26: error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token
4 | extern void getCpuid(int &a, int &b, int &c, int &d);

I'm going to read the systemV abi pdf found here: https://uclibc.org/docs/psABI-x86_64.pdf
I don't know if I'll find an answer there, so I'm hoping someone with more experience in calling assembly from C/C++ might get me a quicker answer.

Is it possible to do pass by reference from an external function that's defined in assembly?
Should I instead pass the pointers of those integers?
Last edited on
kernel.c
You're trying to compile C++ syntax as C.

Should I instead pass the pointers of those integers?
If you need to modify the ints, and you're compiling as C, then yes you have to use pointers.
Last edited on
Registered users can post here. Sign in or register to post.