Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

module_exit(9) [centos man page]

MODULE_EXIT(9)							   Driver Basics						    MODULE_EXIT(9)

module_exit - driver exit entry point SYNOPSIS
module_exit(x); ARGUMENTS
x function to be run when driver is removed DESCRIPTION
module_exit will wrap the driver clean-up code with cleanup_module when used with rmmod when the driver is a module. If the driver is statically compiled into the kernel, module_exit has no effect. There can only be one per module. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 MODULE_EXIT(9)

Check Out this Related Man Page

DRIVER_MODULE(9)					   BSD Kernel Developer's Manual					  DRIVER_MODULE(9)

DRIVER_MODULE -- kernel driver declaration macro SYNOPSIS
#include <sys/param.h> #include <sys/kernel.h> #include <sys/bus.h> #include <sys/module.h> DRIVER_MODULE(name, busname, driver_t driver, devclass_t devclass, modeventhand_t evh, void *arg); MULTI_DRIVER_MODULE(name, busname, driver_t drivers[], devclass_t devclass, modeventhand_t evh, void *arg); DESCRIPTION
The DRIVER_MODULE() macro declares a kernel driver. DRIVER_MODULE() expands to the real driver declaration, where the phrase name is used as the naming prefix for the driver and its functions. Note that it is supplied as plain text, and not a char or char *. busname is the parent bus of the driver (PCI, ISA, PPBUS and others), e.g. 'pci', 'isa', or 'ppbus'. The identifier used in DRIVER_MODULE() can be different from the driver name. Also, the same driver identifier can exist on different busses, which is a pretty clean way of making front ends for different cards using the same driver on the same or different busses. For example, the following is allowed: DRIVER_MODULE(foo, isa, foo_driver, foo_devclass, NULL, NULL); DRIVER_MODULE(foo, pci, foo_driver, foo_devclass, NULL, NULL); driver is the driver of type driver_t, which contains the information about the driver and is therefore one of the two most important parts of the call to DRIVER_MODULE(). The devclass argument contains the kernel-internal information about the device, which will be used within the kernel driver module. The evh argument is the event handler which is called when the driver (or module) is loaded or unloaded (see module(9)). The arg is unused at this time and should be a NULL pointer. MULTI_DRIVER_MODULE() is a special version of DRIVER_MODULE(), which takes a list of drivers instead of a single driver instance. SEE ALSO
device(9), driver(9), module(9) AUTHORS
This manual page was written by Alexander Langer <>. BSD
May 16, 2000 BSD
Man Page

11 More Discussions You Might Find Interesting

1. Linux

kernel:how to modify and read the tick rate:HZ

hi, one of our customer is facing an issue with jiffies wrap up. on a 32 bit machine, the variable jiffies count upto 472 days. the customer's server was up for 472 days ('uptime') and to reproduce the same, i tried to change the variable HZ in linux-2.6..23.9/include/asm-i386/param.h from... (0 Replies)
Discussion started by: amit4g
0 Replies

2. Linux

Locking around kmem_cache_destroy

Hi There, I want to make sure that kmem_cache_alloc is not called concurrently with kmem_cache_destroy on module exit and I want be able to use GFP_KERNEL for the kmem_cache_alloc calls. Would a read/write lock be good fro this purpose or is there another method I should be using? Regards,... (0 Replies)
Discussion started by: Brendan Kennedy
0 Replies

3. UNIX for Dummies Questions & Answers

Doubt with irq handler.......

Hello, I have develop a driver for my hardware and now, I need to handle a IRQ but I does not work. As I can understand, to handle a irq, it is necessary to make a request_irq(). If the return value is zero, ok, no problem to handle irq. Here is a easy example of my driver: #include... (8 Replies)
Discussion started by: webquinty
8 Replies

4. Programming

Compiling virtual network adapter driver problem (net_device struct)

Hi, I found on page very useful sample of virtual driver (not connected to real hardware). I try to compile it with no effect. So: I got fresh Ubuntu 9.10 (kernel 2.6.31-14) My source is saved in networkAdapter.c file in /usr/src/myModules directory. I... (21 Replies)
Discussion started by: Chrisdot
21 Replies

5. Programming

Kernel module - How to test if file doesn't exist

Hey, I'm currently getting into some kernel module progamming. As a little exercise I want to read the headers out of an ELF file. My code is very simple, here is the important part: struct file *fp; /* ... */ fp = filp_open("some/file/on/my/pc", O_RDONLY, 0); if(fp == NULL) { ... (15 Replies)
Discussion started by: disaster
15 Replies

6. Programming

Running bin file from a module

Hi I actually wrote a simple module and I need to call a bin file from that module. Could you give me some hints how to do that? (I tried with stdlib.h and 'system()', but cannot call that function from a module). Regards. (28 Replies)
Discussion started by: Chrisdot
28 Replies

7. Programming

Make cannot generate .ko linux kernel module

cannot generate .ko file on my linux, although it can generate module.symvers. But when I copy .c file and Makefile to another linux computer, there's no problem. The strange thing is: make is successfuly executed, and returned 0; make output: make -C /lib/modules/2.6.18-92.el5xen/build ... (4 Replies)
Discussion started by: vistastar
4 Replies

8. Programming

Build Error

I am facing a problem while building the device driver code. I am using suse linux "" on my Laptop. I have copied a folder containing self written device driver files from Mandriva linux to my system having Suse Linux. I copied the entire folder in "/home/netuser/sun/".... (4 Replies)
Discussion started by: rupeshkp728
4 Replies

9. Programming

Wrapper for unix program - urgent help needed

Hello all , i need some help asap i have a program that keeps killing the machine when i did google searches and 2 days later i ran strace it seems the programm keeps making a system call to gettimeofday to i guess increment a counter ? gettimeofday({1347986584, 464904}, NULL) = 0... (6 Replies)
Discussion started by: NetworkLearning
6 Replies

10. Ubuntu

Kernel panics : trying to write / read on tiny tty driver

I'm a beginner to the Linux programming and trying my hands on some device driver examples while practising. The below code (a trimmed down version of tiny_tty.c from ldd3 book) loads perfectly using insmod and I'm able to see it in /proc/tty/drivers , /proc/modules and device nodes are getting... (1 Reply)
Discussion started by: diwsdiwa
1 Replies

11. Ubuntu

Measuring the correctness of ndelay() function.

I wrote this kernel module to test the correctness of ndelay() function. Kernel mdoule: #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/time.h> #include <linux/delay.h> static int __init initialize(void) { ktime_t start, end; s64... (1 Reply)
Discussion started by: BHASKAR JUPUDI
1 Replies

Featured Tech Videos