Results 1 to 1 of 1
Hello all, I write a small linux module on Suse server Interprise 9.0 to test out linux workqueue which is shown below. The function MyThread gets called but the data ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-15-2006 #1
- Join Date
- Mar 2006
Linux kernel workqueue
I write a small linux module on Suse server Interprise 9.0 to test out linux workqueue which is shown below. The function MyThread gets called but the data passed to it is wrong. Do you have any idea why? Any help is greatly appreciated. Thank you in advance.
void MyThread(void *data);
static int datapassed;
static struct work_struct *ncbWorkStruct;
static int __init TestNcb_init(void)
datapassed = 0x99;
ncbWorkStruct = kmalloc(sizeof(struct work_struct), GFP_ATOMIC);
INIT_WORK(ncbWorkStruct, MyThread, &datapassed);
printk(KERN_ALERT "End Init\n");
static void __exit TestNcb_exit(void)
printk(KERN_ALERT "End Exit\n");
void MyThread(void *data)
int local = (int)*((int *)data);
/* local is supposed to be 0x99 but it is fd968000 which is wrong */
printk("&&& DataPassed is %x\n", local);
printk("&&& Data is %x\n", datapassed);