Closed ghost closed 2 years ago
no this is not how extern "C"
works. Even if you extern the function, you still wont be able to access it from C since rust mangles the name of the functions. Looks like in the pr that you extern the functions in struct impl aswell which is useless since if you even add no_mangle on top of it, they will still be mangled for obvious reasons if you know how the compiler works. I dont think so doing this is worth the effort anyways. Also https://andy-python-programmer.github.io/opinions/c.md ftw
If you really want to do this you will have to make your own bindings in a separate crate that basically internally calls these functions. The rust does somewhere explain this, take a look at them. For now closing the pull request.
no this is not how
extern "C"
works. Even if you extern the function, you still wont be able to access it from C since rust mangles the name of the functions. Looks like in the pr that you extern the functions in struct impl aswell which is useless since if you even add no_mangle on top of it, they will still be mangled for obvious reasons if you know how the compiler works. I dont think so doing this is worth the effort anyways. Also https://andy-python-programmer.github.io/opinions/c.md ftw
Ok, Ill just not modify the kernel.
This externs some driver interfaces to C for portability.