DECLARE_TASKLET

 

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>

MODULE_LICENSE(“GPL”);

char my_tasklet_data[]=”my_tasklet_function was called”;

/* Bottom Half Function */
void my_tasklet_function( unsigned long data )
{
printk( “%s\n”, (char *)data );
return;
}

DECLARE_TASKLET( my_tasklet, my_tasklet_function,(unsigned long) &my_tasklet_data );

int init_module( void )
{
/* Schedule the Bottom Half */
tasklet_schedule( &my_tasklet );

return 0;
}

void cleanup_module( void )
{
/* Stop the tasklet before we exit */
tasklet_kill( &my_tasklet );

return;
}

 

 

 

 

https://www.ibm.com/developerworks/library/l-tasklets/