
The Linux Kernel API The Linux Kernel API This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For more details see the file COPYING in the source distribution of Linux. Table of Contents 1. Driver Basics...............................................................................................................1 1.1. Driver Entry and Exit points .............................................................................1 module_init ......................................................................................................1 module_exit......................................................................................................1 1.2. Atomic and pointer manipulation .....................................................................2 atomic_read......................................................................................................3 atomic_set ........................................................................................................3 atomic_add.......................................................................................................4 atomic_sub .......................................................................................................5 atomic_sub_and_test........................................................................................6 atomic_inc........................................................................................................7 atomic_dec .......................................................................................................8 atomic_dec_and_test........................................................................................9 atomic_inc_and_test ......................................................................................10 atomic_add_negative......................................................................................11 get_unaligned.................................................................................................12 put_unaligned.................................................................................................12 1.3. Delaying, scheduling, and timer routines .......................................................13 schedule_timeout ...........................................................................................14 2. Data Types ................................................................................................................16 2.1. Doubly Linked Lists .......................................................................................16 list_add...........................................................................................................16 list_add_tail....................................................................................................16 list_del............................................................................................................17 list_del_init ....................................................................................................18 list_empty.......................................................................................................19 list_splice .......................................................................................................19 list_entry ........................................................................................................20 list_for_each...................................................................................................21 list_for_each_safe ..........................................................................................22 3. Basic C Library Functions ......................................................................................24 3.1. String Conversions..........................................................................................24 simple_strtol...................................................................................................24 simple_strtoll .................................................................................................25 simple_strtoul.................................................................................................25 simple_strtoull ...............................................................................................26 vsnprintf .........................................................................................................27 i snprintf ...........................................................................................................28 vsprintf ...........................................................................................................29 sprintf .............................................................................................................30 3.2. String Manipulation ........................................................................................31 strcpy..............................................................................................................31 strncpy............................................................................................................31 strcat...............................................................................................................32 strncat.............................................................................................................33 strcmp.............................................................................................................34 strncmp...........................................................................................................35 strchr ..............................................................................................................36 strrchr .............................................................................................................36 strlen...............................................................................................................37 strnlen.............................................................................................................38 strpbrk ............................................................................................................38 strtok ..............................................................................................................39 memset ...........................................................................................................40 bcopy..............................................................................................................41 memcpy..........................................................................................................42 memmove.......................................................................................................43 memcmp.........................................................................................................43 memscan ........................................................................................................44 strstr................................................................................................................45 memchr ..........................................................................................................46 3.3. Bit Operations .................................................................................................47 set_bit.............................................................................................................47 __set_bit.........................................................................................................48 clear_bit..........................................................................................................49 __change_bit..................................................................................................49 change_bit......................................................................................................50 test_and_set_bit..............................................................................................51 __test_and_set_bit..........................................................................................52 test_and_clear_bit ..........................................................................................53 __test_and_clear_bit ......................................................................................54 test_and_change_bit.......................................................................................55 test_bit............................................................................................................56 find_first_zero_bit..........................................................................................56 find_next_zero_bit .........................................................................................57 ffz ...................................................................................................................58
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages391 Page
-
File Size-