First take a look at the __user macro definition:
#ifdef __CHECKER__ # define __user __attribute__((noderef, address_space(1))) can be seen from the macro definition, in the configuration _ Under the condition of the _CHECKER__ macro, the __user macro definition is valid, and it is obvious that the macro __CHECKER__ appears as an inspection mechanism, so we can infer that the macro __user should be used to check for error use.
And in fact it is, it is to use the make C=1 option to compile the kernel/module, open the static syntax checking tool sparse to detect possible errors. At the same time, it can be seen that it has no effect on the generation of the file, only to check the grammatical correctness.
Further research found that sparse is a static C syntax checking tool. When compiling a kernel or compiling a module under Linux, you can call the sparse check code by appending C=1.
In addition, the sparse definition A few memory spaces, sparse defines several address spaces for the Linux kernel, the kernel space is the default, the user space is 1, and the io interval is 2. This can check if there is a problem with the code of the access address. Including address_space(1) refers to user space.
For example, in driver writing, size_t hello_read(struct file *file, char __user *buff, size_t count, loff_t *offp) { return 0; }
Some users of Linux systems often encounter, showing that the disk space is full, you have to delete
A. Static library concept 1. A library is a collection of pre-compiled object files that can be lin
One: ssh schematic is: 1, is to allow the use of ssh between two Linux machines does not require a
1 dr mode introduction 1.1 lvs installation 1.2 lvs mode lvs has three modes dr, nat, tun
Linux installation JDK for Linux system
Copy and paste shortcuts under Linux
Linux how to view the size of the hard disk
How to use rsync for data backup under Linux
How to view the diskspace hard disk application under linux
Linux ulimit command usage parsing
Inux virtual machine network configuration method and solution to the problem
How does the Linux system set up a shared file server? The
Win8.1 system can not be installed on Alipay digital certificate solution graphic tutorial
Win10 Task Manager Performance Small Window Mode View Performance Information Tutorial
How does the Win10 system modify the permissions of the registry?
Win7 activation tool which is easy to use Microsoft win7 activation tool which is best to use
Dfrgfat.exe application error solution
How to solve the exclamation mark on the Win7 system network connection?
Specific steps to use automatic system failure recovery
Basic commands for learning Linux
XP operating system optimization essence to make the system run faster