I recently compile a kernel module for mint 18 (kernel version:4.4.0-36-generic) and use these functions :
static inline unsigned long rk_disable_wp(void)
{
unsigned long cr0;
preempt_disable();
barrier();
cr0 = read_cr0();
write_cr0(cr0 & ~X86_CR0_WP);
barrier();
return cr0;
}
when I move this source code to raspbian 9.1 (kernel version: 4.9.59-v7+) I can't compile and this error throws:
error: implicit declaration of function 'read_cr0' [-Werror=implicit-function-declaration]
error: implicit declaration of function 'write_cr0' [-Werror=implicit-function-declaration]
error: 'X86_CR0_WP' undeclared (first use in this function)
is raspberry pi has no CR0
registry ? or kernel version is the reason of the problem ? or something else ?