Linux 內核API完全參考手冊 Linux内核API完全参考手册(第2版)

邱鐵, 陳晨, 周玉

  • 出版商: 機械工業
  • 出版日期: 2016-10-01
  • 定價: $594
  • 售價: 8.5$505
  • 語言: 簡體中文
  • 頁數: 640
  • 裝訂: 平裝
  • ISBN: 7111548779
  • ISBN-13: 9787111548775
  • 相關分類: Linux
  • 已絕版

買這商品的人也買了...

商品描述

<內容簡介>

本書基於zui新的Linux內核源代碼3.19.3版本,對常用的內核API作了系統歸納,並編寫了典型驗證程序,使理論分析與實際編程做到了統一。分析的內核API模塊包括:模塊機制內核API、進程管理內核API、進程調度內核API、中斷與異常機制內核API、時間與定時機制內核API、內存管理內核API、內核同步機制API、文件系統內核API和設備驅動與設備管理模塊內核API。

<章節目錄>

前言
第1章Linux內核API分析必備知識1
1.1 Linux內核編程註意事項1
1.2本書中模塊編譯Makefile模板2
1.3內核調試函數printk 3
1.4內核編譯與定製5
1.4.1獲得Linux內核與補丁5
1.4 .2準備編譯需要的工具5
1.4.3解壓內核6
1.4.4給內核打補丁6
1.4.5設定編譯選項7
1.4.6編譯與安裝內核9
1.4.7創建initramfs 10
1.4.8設置grub 11
1.4.9啟動選項12
1.5溫馨提示12
本章參考文獻13
第2章內核模塊機制API 14
2.1函數:__module_address( ) 14
2.2函數:__module_text_address( ) 16
2.3函數:__print_symbol( ) 19
2.4函數:__symbol_get( ) 22
2.5函數:__symbol_put( ) 25
2.6函數:find_module( ) 27
2.7函數:find_symbol( ) 31
2.8函數:module_is_live( ) 36
2.9函數:module_put( ) 38
2.10函數:module_refcount( ) 40
2.11函數:sprint_symbol( ) 42
2.12函數:symbol_put_addr( ) 45
2.13函數:try_module_get( ) 48
本章參考文獻50
第3章Linux進程管理內核API 51
3.1函數:__task_pid_nr_ns( ) 51
3.2函數:find_get_pid( ) 54
3.3函數:find_pid_ns( ) 56
3.4函數: find_vpid( ) 58
3.5函數:get_pid( ) 60
3.6函數:get_task_mm( ) 62
3.7函數:mmput( ) 66
3.8函數:ns_of_pid( ) 68
3.9函數:pid_nr( ) 70
3.10函數:pid_task( ) 72
3.11函數:pid_vnr ( ) 74
3.12函數:put_pid( ) 76
3.13函數:task_active_pid_ns( ) 78
3.14函數:task_tgid_nr_ns( ) 80
本章參考文獻82
第4章Linux進程調度內核API 83
4.1函數:__wake_up( ) 83
4.2函數:__wake_up_sync( ) 88
4.3函數:__wake_up_sync_key( ) 91
4.4函數:abort_exclusive_wait( ) 94
4.5函數:add_wait_queue( ) 99
4.6函數:add_wait_queue_exclusive( ) 102
4.7函數:autoremove_wake_function( ) 105
4.8函數:complete( ) 109
4.9函數:complete_all( ) 112
4.10函數:completion_done( ) 115
4.11函數:current_thread_info( ) 118
4.12函數:default_wake_function( ) 121
4.13函數:do_exit( ) 124
4.14函數:finish_wait( ) 126
4.15函數:init_waitqueue_entry( ) 130
4.16函數:init_waitqueue_head( ) 132
4.17函數:kthread_create_on_node( ) 134
4.18函數:kthread_stop( ) 136
4.19函數:prepare_to_wait( ) 138
4.20函數:prepare_to_wait_exclusive( ) 142
4.21函數:remove_wait_queue( ) 147
4.22函數:sched_setscheduler( ) 150
4.23函數:set_cpus_allowed_ptr( ) 154
4.24函數:set_user_nice( ) 157
4.25函數:task_nice( ) 160
4.26函數:try_wait_for_completion( ) 162
4.27函數:wait_for_completion( ) 166
4.28函數:wait_for_completion_interruptible_timeout( ) 169
4.29函數:wait_for_completion_killable( ) 173
4.30函數:wait_for_completion_timeout( ) 177
4.31函數: wake_up_process( ) 180
4.32函數:yield( ) 183
本章參考文獻185
第5章Linux中斷機制內核API 187
5.1函數:__tasklet_hi_schedule( ) 187
5.2函數:__tasklet_schedule( ) 190
5.3函數:disable_irq( ) 193
5.4函數:disable_irq_nosync( ) 193
5.5函數:disable_irq_wake( ) 196
5.6函數:enable_irq( ) 199
5.7函數:enable_irq_wake( ) 201
5.8函數:free_irq( ) 204
5.9函數:irq_set_chip( ) 205
5.10函數:irq_set_chip_data( ) 209
5.11函數:irq_set_irq_type( ) 212
5.12函數:irq_set_irq_wake( ) 214
5.13函數:remove_irq( ) 217
5.14函數:request_irq( ) 221
5.15函數:request_threaded_irq( ) 225
5.16函數:setup_irq( ) 229
5.17函數:tasklet_disable( ) 232
5.18函數:tasklet_disable_nosync( ) 234
5.19函數:tasklet_enable( ) 236
5.20函數:tasklet_hi_schedule( ) 237
5.21函數:tasklet_init( ) 241
5.22函數:tasklet_kill( ) 243
5.23函數:tasklet_schedule( ) 245
5.24函數:tasklet_trylock( ) 247
5.25函數:tasklet_unlock( ) 248
本章參考文獻251
第6章Linux內存管理內核API 252
6.1函數:__free_pages( ) 252
6.2函數:__get_free_pages( ) 253
6.3函數:__get_vm_area( ) 255
6.4函數:__krealloc( ) 258
6.5函數:alloc_pages( ) 261
6.6函數: alloc_pages_exact( ) 264
6.7函數:find_vma( ) 266
6.8函數:find_vma_intersection( ) 270
6.9函數:free_pages( ) 272
6.10函數:free_pages_exact( ) 273
6.11函數:get_unmapped_area( ) 274
6.12函數:get_zeroed_pa​​ge( ) 276
6.13函數:kcalloc ( ) 278
6.14函數:kfree( ) 280
6.15函數:kmalloc( ) 281
6.16函數:kmem_cache_alloc( ) 283
6.17函數:kmem_cache_create( ) 285
6.18函數:kmem_cache_destroy( ) 288
6.19函數:kmem_cache_free( ) 289
6.20函數:kmem_cache_zalloc( ) 290
6.21函數:kmemdup( ) 292
6.22函數:ksize( ) 295
6.23函數:kstrdup( ) 298
6.24函數:kstrndup( ) 299
6.25函數:kzalloc( ) 301
6.26函數:memdup_user( ) 303
6.27函數:mempool_alloc( ) 306
6.28函數:mempool_alloc_pages( ) 308
6.29函數:mempool_alloc_slab( ) 311
6.30函數:mempool_create( ) 313
6.31函數:mempool_destroy( ) 316
6.32函數:mempool_free( ) 317
6.33函數:mempool_free_pages( ) 318
6.34函數:mempool_free_slab( ) 318
6.35函數:mempool_kfree( ) 319
6.36函數:mempool_kmalloc( ) 320
6.37函數:mempool_resize( ) 322
6.38函數:nr_free_buffer_pages( ) 325
6.39宏:page_address( ) 326
6.40宏:page_cache_get( ) 328
6.41宏:page_cache_release( ) 330
6.42函數:page_zone( ) 331
6.43宏:probe_kernel_address( ) 334
6.44函數:probe_kernel_read( ) 336
6.45函數:vfree( ) 338
6.46函數:vma_pages( ) 339
6.47函數:vmalloc( ) 341
6.48函數:vmalloc_to_page( ) 343
6.49函數:vmalloc_to_pfn( ) 345
6.50函數:vmalloc_user( ) 347
本章參考文獻349
第7章Linux內核定時機制API 350
7.1函數:__round_jiffies( ) 350
7.2函數:__round_jiffies_relative( ) 352
7.3函數:__round_jiffies_up( ) 354
7.4函數:__round_jiffies_up_relative ( ) 356
7.5函數:add_timer( ) 358
7.6函數:current_kernel_time( ) 359
7.7函數:del_timer( ) 361
7.8函數:del_timer_sync( ) 364
7.9函數:do_gettimeofday( ) 367
7.10函數:do_settimeofday( ) 369
7.11函數:get_seconds( ) 372
7.12函數:getnstimeofday( ) 374
7.13函數:init_timer( ) 376
7.14函數:init_timer_deferrable( ) 378
7.15函數:init_timer_key( ) 380
7.16函數:init_timer_on_stack( ) 382
7.17函數:init_timer_on_stack_key( ) 385
7.18函數:mktime( ) 387
7.19函數:mod_timer( ) 389
7.20函數:mod_timer_pending( ) 392
7.21函數:ns_to_timespec( ) 394
7.22函數:ns_to_timeval( ) 396
7.23函數:round_jiffies( ) 398
7.24函數:round_jiffies_relative( ) 401
7.25函數:round_jiffies_up( ) 404
7.26函數:round_jiffies_up_relative( ) 406
7.27函數:set_normalized_timespec( ) 409
7.28函數:setup_timer( ) 411
7.29函數:setup_timer_on_stack( ) 413
7.30函數:timer_pending( ) 415
7.31函數:timespec_add_ns( ) 417
7.32函數:timespec_compare( ) 420
7.33函數:timespec_equal( ) 422
7.34函數:timespec_sub( ) 424
7.35函數:timespec_to_ns( ) 426
7.36函數:timeval_compare( ) 428
7.37函數:timeval_to_ns( ) 431
7.38函數:try_to_del_timer_sync( ) 433
本章參考文獻435
第8章Linux內核同步機制API 436
8.1函數:atomic_add( ) 436
8.2函數:atomic_add_negative( ) 438
8.3函數:atomic_add_return( ) 440
8.4函數:atomic_add_unless( ) 442
8.5函數:atomic_cmpxchg( ) 444
8.6函數:atomic_dec( ) 446
8.7函數:atomic_dec_and_test ( ) 448
8.8函數:atomic_inc( ) 449
8.9函數:atomic_inc_and_test( ) 451
8.10函數:atomic_read( ) 453
8.11函數:atomic_set( ) 453
8.12函數:atomic_sub( ) 455
8.13函數:atomic_sub_and_test( ) 457
8.14函數:atomic_sub_return( ) 459
8.15函數:down( ) 461
8.16函數:down_interruptible( ) 463
8.17函數:down_killable( ) 465
8.18函數:down_read( ) 468
8.19函數:down_read_trylock( ) 470
8.20函數:down_timeout( ) 472
8.21函數:down_trylock( ) 474
8.22函數:down_write( ) 476
8.23函數:down_write_trylock( ) 479
8.24函數:downgrade_write( ) 481
8.25宏:init_rwsem( ) 483
8.26函數:read_seqbegin( ) 486
8.27函數:read_seqretry( ) 488
8.28函數:sema_init( ) 490
8.29宏:seqlock_init( ) 492
8.30函數:up( ) 494
8.31函數:up_read( ) 496
8.32函數:up_write( ) 497
8.33函數:write_seqlock( ) 498
8.34函數:write_sequnlock( ) 498
本章參考文獻499
第9章Linux文件系統內核API 500
9.1函數:__mnt_is_readonly( ) 500
9.2函數:current_umask( ) 502
9.3函數:d_alloc( ) 504
9.4函數:d_find_alias( ) 507
9.5函數:dput( ) 510
9.6函數:fget( ) 512
9.7函數: generic_fillattr( ) 515
9.8函數:get_fs_type( ) 517
9.9函數:get_max_files( ) 520
9.10函數:get_super( ) 522
9.11函數:have_submounts( ) 525
9.12函數:I_BDEV( ) 527
9.13函數:inode_add_bytes( ) 529
9.14函數:inode_get_bytes ( ) 531
9.15函數:inode_set_bytes( ) 533
9.16函數:inode_sub_bytes( ) 535
9.17函數:is_bad_inode( ) 537
9.18函數:make_bad_inode( ) 538
9.19函數:may_umount( ) 540
9.20函數:may_umount_tree( ) 542
9.21函數:mnt_want_write( ) 544
9.22函數:notify_change( ) 545
9.23函數:put_unused_fd( ) 547
9.24函數:unshare_fs_struct( ) 549
9.25函數:vfs_fstat( ) 551
9.26函數:vfs_getattr( ) 553
9.27函數:vfs_statfs( ) 556
本章參考文獻559
第10章Linux設備驅動及設備管理API 560
10.1函數:__class_create( ) 560
10.2函數:__class_register( ) 562
10.3函數:cdev_add( ) 563
10.4函數:cdev_alloc( ) 564
10.5函數:cdev_del( ) 566
10.6函數:cdev_init( ) 572
10.7宏:class_create( ) 577
10.8函數:class_destroy( ) 578
10.9宏:class_register( ) 581
10.10函數:class_unregister( ) 582
10.11函數:device_add( ) 589
10.12函數:device_create( ) 589
10.13函數:device_del( ) 592
10.14函數:device_destroy( ) 592
10.15函數:device_initialize( ) 599
10.16函數:device_register( ) 606
10.17函數:device_rename( ) 607
10.18函數:device_unregister( ) 613
10.19函數:get_device( ) 620
10.20函數:put_device( ) 621
10.21函數:register_chrdev( ) 625
10.22函數:unregister_chrdev( ) 626
10.23部分相關函數說明634
本章參考文獻635
附錄Linux內核API快速檢索表636