Linux driver Development Common header files

Source: Internet
Author: User
Tags function definition function prototype prototype definition semaphore

There are a total of 32. h header files in the header file directory. There are 13 in the main directory, 4 in the ASM subdirectory, 10 in the Linux subdirectory, and 5 in the SYS subdirectory. The respective functions of these header files are as follows:

1. Home Directory

<a.out.h>:a.out header file that defines the a.out execution file format and some macros.
<CONST.H>: constant symbol header file, currently only defines the flag bits of the I_mode field in the I node.
<ctype.h>: A character type header file that defines some macros about character type judgments and conversions.
<ERRNO.H>: Error xwould file containing various error numbers in the system. (Linus introduced from the Minix).
<fcntl.h>: The file control header file, which is used for the operation of the file and its descriptor to control the definition of the constant symbol.
<signal.h>: Signal header file, define signal symbol constants, signal structure and signal operation function prototype.
<STDARG.H>: A standard parameter header file that defines a variable parameter list as a macro. The main description is a type (va_list) and 3 macros (Va_start, Va_arg, and Va_end) for vsprintf, vprintf, vfprintf functions.
<STDDEF.H>: standard definition header file, defines null, Offsetof (TYPE, MEMBER).
<string.h>: string header file that defines some embedded functions for string manipulation.
<TERMIOS.H>: terminal input and Output function header file, mainly defines the terminal interface to control the asynchronous communication port.
<time.h>: The time type header file, mainly defines the TM structure and some time-related function prototype.
<unistd.h>:linux a standard header file that defines various symbol constants and types, and declares various functions. For example, __library__ is defined, and the system call number and inline assembler _syscall0 () are included.
<utime.h>: User Time header file, defines the access and modification time structure, and the Utime () prototype.

2. Architecture Related header Files subdirectory include/asm

These header files primarily define data structures, macro functions, and variables that are closely related to the CPU architecture. A total of 4 files.
A <ASM/IO.H>:I/O header file that defines functions for I/O port operations in the form of an embedded assembler of macros.
<asm/memory.h>: Memory copy header file containing memcpy () embedded assembly macro function.
<asm/segment.h>: Segment operation header file, defines the embedded assembler function for the segment register operation.
<asm/system.h>: System header file, which defines the embedded assembly macros for setting or modifying descriptors/break gates, etc.

3, the Linux kernel dedicated header file subdirectory Include/linux

<linux/config.h>: Kernel configuration header file, define keyboard language and hard disk type (Hd_type) options.
<linux/fdreg.h>: Floppy drive header file containing some definitions of the floppy disk controller parameters.
<linux/fs.h>: File system header file, definition file table structure (File,buffer_head,m_inode, etc.).
<LINUX/HDREG.H>: Hard disk parameter header file, which defines information such as access to the hard disk register port, status code, and partition table.
The <linux/head.h>:head header file defines the simple structure of the segment descriptor, and several selection constants.
<linux/kernel.h>: Kernel header file, contains some of the kernel common functions of the prototype definition.
<LINUX/MM.H>: Memory management header file containing page size definitions and some page release function prototypes.
<linux/sched.h>: Dispatcher header file, defines the task structure task_struct, the initial task 0 data, and some of the descriptor parameter settings and get the embedded Assembler function macro statement.
<LINUX/SYS.H>: The system calls the header file, which contains 72 system calls to the C function handler, beginning with "Sys_".
The <linux/tty.h>:tty header file defines the parameters and constants for Tty_io, serial communication.

4, System-specific data structure sub-directory Include/sys

<sys/stat.h>: File status header file, containing file or file system state structure stat{} and constants.
<SYS/TIMES.H>: Defines a process run time structure TMS and The Times () function prototype.
<sys/types.h>: A type header file that defines the basic system data type.
<sys/utsname.h>: System name Structure header file.
<sys/wait.h>: Wait for the calling header file to define the system call Wait () and Waitpid () and the associated constant symbol.

#include <Linux/***.h>//is looking for source files under Linux-2.6.29/include/linux.
#include <asm/***.h>//is looking for source files under Linux-2.6.29/arch/arm/include/asm.
#include <mach/***.h>//is looking for source files under Linux-2.6.29/arch/arm/mach-s3c2410/include/mach.
#include <plat/regs-adc.h>//in Linux-2.6.31_tx2440a20100510\linux-2.6.31_tx2440a\arch\arm\plat-s3c\include\ Plat
#include <linux/module.h>//most basic files, support dynamic add and unload modules. Hello World Driver wants this one file on it
#include <linux/fs.h>//contains definitions of file operations related structs, such as the famous struct file_operations, which contains the definition of struct inode, M Inor, Major's header file.
#include <linux/errno.h>//contains a macro definition of the return value so that the user program can output the error message with Perror.
#include <linux/types.h>//definitions for some special types, such as dev_t, off_t, pid_t. Most of these types are unsigned int, which is changed through a series of typedef. , just for the convenience of reading.
#include <linux/cdev.h>//CDEV The structure of the character device and the definition of a series of operation functions. Contains the definitions of the CDEV structure and related functions.
#include <linux/wait.h>//Queue Related header file//kernel wait queue, it contains the spin lock header file
#include <linux/init.h>//initialization header file
#include <linux/kernel.h>//drivers to be written to kernel, kernel-related header files
#include <linux/slab.h>//contains the definition of Kcalloc, Kzalloc memory allocation function.
#include <linux/uaccess.h>//contains a function definition for kernel access to user process memory addresses such as Copy_to_user, Copy_from_user, and so on.
#include <linux/device.h>//contains definitions of device, class, and other structures
#include <linux/io.h>//contains definitions of functions such as Ioremap, Iowrite and other kernel access IO memory.
#include <linux/miscdevice.h>//contains the definition of miscdevice structure and related operation functions.
#include <linux/interrupt.h>//Use the header files that must be interrupted
#include <mach/irqs.h>//Use the header files that must be interrupted
#include <asm/bitops.h>//contains set_bit-bit operation functions, which are available when the input subsystem is implemented.
#include <linux/semaphore.h>//The header file required for semaphore usage
#include <linux/spinlock.h>//spin lock
#include <linux/sched.h>//kernel wait queue to use the Task_normal, task_interruptible contained in this header file
#include <linux/kfifo.h>//fifo ring queue
#include <linux/timer.h>//Core timers
#include <linux/input.h>//Interrupt Handling
#include <linux/delay.h>//delay header file
#include <asm/irq.h>//processor-related interrupts
#include <linux/interrupt.h>//operating system interrupt
#include <asm/uaccess.h>//processor-related portals
#include <asm/arch/regs-gpio.h>//processor-related IO port operation
#include <mach/regs-gpio.h>//Ibid.
#include <asm/hardware.h>//processor-related hardware
#include <mach/hardware.h>//Ibid.
#include <linux/poll.h>//Polling files
#include <linux/gpio.h>//OS-related IO port files
#include <stdio.h>//Standard input/output
#include <stdlib.h>//Standard library
#include <unistd.h>//unix Standard
#include <sys/ioctl.h>//io Control

Linux driver Development Common header files

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.