I am working on Linux Kernel Usrspace and Kernel space communication,
I am using two target boards, 1) Board with PPC -e500 processor 2) Board with intel x-86 processor
Following peace of code working on e500 processor but same code is giving kernel error after IOCTL call execution as
*error: returning IOCTL -1073460967 ERROR as -EFAULT, kernel error: 28*
//User space call
retVal = ioctl( FD, SOME_OPERATION, &myInfo );
//Definition of structures
struct user_space_struct
{
unsigned long A;
unsigned long B; //file descriptor
unsigned long C;
unsigned long D;
unsigned long E;
unsigned long F;
unsigned long G;
};
ret = copy_from_user( (void *)&kernel_space_struct,(void *)arg, sizeof(struct user_space_struct) );
//Kernel space call
if( ret != 0 ) {
printk("In Kernel space copy_from_user() failed \n");
break;
}
Can anyone please help me to understand why I am getting this error.
Thanks in advance!