Linux Kernel Programming Part 2 - Char Device Drivers and Kernel Synchronization by Kaiwan N Billimoria

Linux Kernel Programming Part 2 - Char Device Drivers and Kernel Synchronization by Kaiwan N Billimoria

Author:Kaiwan N Billimoria [Kaiwan N Billimoria]
Language: eng
Format: epub
Tags: COM088010 - COMPUTERS / System Administration / Linux and UNIX Administration, COM043040 - COMPUTERS / Networking / Network Protocols, COM019000 - COMPUTERS / System Administration / Disaster and Recovery
Publisher: Packt Publishing
Published: 2021-03-19T06:08:48+00:00


Initializing the tasklet

The tasklet_init() function initializes a tasklet; its signature is as follows:

#include <linux/interrupt.h>

void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data);

Let's check out its parameters:

struct tasklet_struct *t: This structure is the metadata representing the tasklet. As you already know, a pointer, by itself, has no memory! Remember to allocate memory to the data structure and then pass the pointer here.

void (*func)(unsigned long): This is the tasklet function itself – the "bottom half" that runs once the hardirq completes; this bottom half function performs the majority of the interrupt handling process.

unsigned long data: Any data item you wish to pass along to the tasklet routine (a cookie).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.