
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......................................................................................................2 1.2. Atomics.............................................................................................................3 atomic_read......................................................................................................3 atomic_set ........................................................................................................4 atomic_add.......................................................................................................5 atomic_sub .......................................................................................................6 atomic_sub_and_test........................................................................................7 atomic_inc........................................................................................................8 atomic_dec .......................................................................................................8 atomic_dec_and_test........................................................................................9 atomic_inc_and_test ......................................................................................10 atomic_add_negative......................................................................................11 1.3. Delaying, scheduling, and timer routines .......................................................12 schedule_timeout ...........................................................................................13 2. Data Types ..................................................................................................................1 2.1. Doubly Linked Lists .........................................................................................1 list_add.............................................................................................................1 list_add_tail......................................................................................................2 list_del..............................................................................................................3 list_del_init ......................................................................................................4 list_empty.........................................................................................................4 list_splice .........................................................................................................5 list_entry ..........................................................................................................6 list_for_each.....................................................................................................7 3. Basic C Library Functions ........................................................................................9 3.1. String Conversions............................................................................................9 simple_strtol.....................................................................................................9 simple_strtoll .................................................................................................10 3 simple_strtoul.................................................................................................11 simple_strtoull ...............................................................................................12 vsprintf ...........................................................................................................13 sprintf .............................................................................................................14 3.2. String Manipulation ........................................................................................15 strcpy..............................................................................................................15 strncpy............................................................................................................16 strcat...............................................................................................................17 strncat.............................................................................................................18 strcmp.............................................................................................................19 strncmp...........................................................................................................20 strchr ..............................................................................................................21 strrchr .............................................................................................................22 strlen...............................................................................................................22 strnlen.............................................................................................................23 strpbrk ............................................................................................................24 strtok ..............................................................................................................25 memset ...........................................................................................................26 bcopy..............................................................................................................27 memcpy..........................................................................................................28 memmove.......................................................................................................29 memcmp.........................................................................................................31 memscan ........................................................................................................31 strstr................................................................................................................33 memchr ..........................................................................................................33 3.3. Bit Operations .................................................................................................35 set_bit.............................................................................................................35 __set_bit.........................................................................................................36 clear_bit..........................................................................................................37 change_bit......................................................................................................38 test_and_set_bit..............................................................................................39 __test_and_set_bit..........................................................................................40 test_and_clear_bit ..........................................................................................41 __test_and_clear_bit ......................................................................................42 4 test_and_change_bit.......................................................................................43 test_bit............................................................................................................44 find_first_zero_bit..........................................................................................44 find_next_zero_bit .........................................................................................45 ffz ...................................................................................................................46 ffs ...................................................................................................................47 hweight32.......................................................................................................48 4. Memory Management in Linux..............................................................................50 4.1. The Slab Cache ...............................................................................................50 kmem_cache_create.......................................................................................50 kmem_cache_shrink ......................................................................................52
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages448 Page
-
File Size-