Linux核心API完全參考手冊

Linux核心API完全參考手冊

《Linux核心API完全參考手冊》是目前第一本全面介紹Linux核心API開發與編程的書籍; 基於最新的Linux核心版本2.6.30,設計核心API典型實例,並對開發場景進行詳細講解; 對Linux核心系統知識進行精心策劃,以核心模組方式對核心API進行系統分析; 在系統功能模組內部,核心API以函式名稱排序,能夠快速檢索; 立足於基礎,高效率的學習理論配合核心API經典實例,深入Linux編程實踐; 為Linux核心開發與編程提供高效的指導與參考。

基本介紹

  • 書名:Linux核心API完全參考手冊
  • 作者: 邱鐵  周玉  鄧瑩瑩
  • ISBN:9787111323570
  • 出版社:機械工業出版社
基本信息,內容簡介,目錄,

基本信息

作者: 邱鐵 周玉 鄧瑩瑩
出版社:機械工業出版社
ISBN:9787111323570
上架時間:2011-1-10
出版日期:2011 年1月
開本:16開
頁碼:684
版次:1-1

內容簡介

linux作為源碼開放的作業系統已經廣泛套用於計算機與嵌入式設備,因此學會linux核心開發與編程顯得越來越重要。本書以最新的linux核心版本2.6.30為依據,對常用的核心api作了系統分析和歸納,設計了典型實例並對開發場景進行了詳細講解。本書中分析的核心api模組包括:核心模組機制api、進程管理核心api、進程調度核心api、中斷機制核心api、記憶體管理核心api、核心定時機制api、核心同步機制api、檔案系統核心api和設備驅動及設備管理api。
本書立足linux核心api分析,深入實踐,內容翔實,讀者可以從低起點進行高效的核心分析與編程實踐。本書可作為高等院校計算機、電子、信息類大學生及研究生進行linux作業系統學習和編程的教材或參考書,也可作為linux開發人員和廣大linux編程開發愛好者的參考用書。

目錄

前言本書使用方法
第1章  Linux核心API分析必備知識 1
Linux核心編程注意事項 1
本書中模組編譯Makefile模板 1
核心調試函式printk 2
核心編譯與定製 4
溫馨提示 10
參考文獻 11
第2章  Linux核心模組機制API 12
函式:__module_address ( ) 12
函式:__module_ref_addr ( ) 14
函式:__module_text_address ( ) 16
函式:__print_symbol ( ) 18
函式:__symbol_get ( ) 20
函式:__symbol_put ( ) 22
函式:find_module ( ) 24
函式:find_symbol ( ) 27
函式:module_is_live ( ) 30
函式:module_put ( ) 32
函式:module_refcount ( ) 34
函式:sprint_symbol ( ) 36
函式:symbol_put_addr ( ) 38
函式:try_module_get ( ) 40
函式:use_module ( ) 42
參考文獻 44
第3章  Linux進程管理核心API 45
函式:__task_pid_nr_ns( ) 45
函式:find_get_pid( ) 47
函式:find_pid _ns( ) 49
函式:find_task_by_pid_ns( ) 51
函式:find_task_by_pid_type _ns( ) 53
函式:find_task_by_vpid( ) 55
函式:find_vpid( ) 57
函式:get_pid( ) 59
函式:get_task_mm( ) 60
函式:is_container_init( ) 63
函式:kernel_thread( ) 65
函式:mmput( ) 67
函式:ns_of_pid( ) 69
函式:pid_nr( ) 71
函式:pid_task( ) 73
函式:pid_vnr( ) 75
函式:put_pid( ) 77
函式:task_active_pid_ns( ) 79
函式:task_tgid_nr_ns( ) 81
參考文獻 83
第4章  Linux進程調度核心API 84
函式:__wake_up( ) 84
函式:__wake_up_sync( ) 87
函式:__wake_up_sync_key( ) 89
函式:abort_exclusive_wait( ) 91
函式:add_preempt_count( ) 95
函式:add_wait_queue( ) 97
函式:add_wait_queue_exclusive( ) 100
函式:autoremove_wake_function( ) 102
函式:complete( ) 106
函式:complete_all( ) 108
函式:complete_done( ) 111
函式:current_thread_info( ) 113
函式:default_wake_function( ) 115
函式:do_exit( ) 118
函式:finish_wait( ) 120
函式:init_waitqueue_entry( ) 123
函式:init_waitqueue_head( ) 125
函式:interruptible_sleep_on( ) 127
函式:interruptible_sleep_on_timeout( ) 130
函式:preempt_notifier_register ( ) 133
函式:preempt_notifier_unregister ( ) 136
函式:prepare_to_wait( ) 139
函式:prepare_to_wait_exclusive( ) 142
函式:remove_wait_queue( ) 146
函式:sched_setscheduler( ) 149
函式:set_cpus_allowed_ptr( ) 152
函式:set_user_nice( ) 155
函式:sleep_on( ) 158
函式:sleep_on_timeout( ) 160
函式:sub_preempt_count( ) 162
函式:task_nice( ) 164
函式:try_wait_for_completion( ) 166
函式:wait_for_completion( ) 169
函式:wait_for_completion_interruptible( ) 172
函式:wait_for_completion_interruptible_ timeout( ) 175
函式:wait_for_completion_killable( ) 179
函式:wait_for_completion_timeout( ) 182
函式:wake_up_process( ) 184
函式:yield( ) 187
參考文獻 188
第5章  Linux中斷機制核心API 189
函式:__set_irq_handler( ) 189
函式:__tasklet_hi_schedule( ) 191
函式:__tasklet_schedule( ) 194
函式:disable_irq( ) 196
函式:disable_irq_nosync( ) 196
函式:disable_irq_wake( ) 198
函式:enable_irq( ) 201
函式:enable_irq_wake( ) 203
函式:free_irq( ) 205
函式:kstat_irqs_cpu( ) 207
函式:remove_irq( ) 209
函式:request_irq( ) 213
函式:request_threaded_irq( ) 216
函式:set_irq_chained_handler( ) 219
函式:set_irq_chip( ) 221
函式:set_irq_chip_data( ) 225
函式:set_irq_data( ) 227
函式:set_irq_handler( ) 229
函式:set_irq_type( ) 232
函式:set_irq_wake( ) 234
函式:setup_irq( ) 237
函式:tasklet_disable( ) 239
函式:tasklet_disable_nosync( ) 241
函式:tasklet_enable( ) 243
函式:tasklet_hi_enable( ) 244
函式:tasklet_hi_schedule( ) 246
函式:tasklet_init( ) 248
函式:tasklet_kill( ) 250
函式:tasklet_shedule( ) 252
函式:tasklet_trylock( ) 254
函式:tasklet_unlock( ) 255
參考文獻 257
第6章  Linux記憶體管理核心API 258
函式:__free_pages( ) 258
函式:__get_free_pages( ) 258
函式:__get_vm_area( ) 260
函式:__krealloc( ) 262
函式:alloc_pages( ) 265
函式:alloc_pages_exact( ) 268
函式:alloc_vm_area( ) 270
函式:do_brk( ) 272
函式:do_mmap( ) 273
函式:do_mmap_pgoff( ) 276
函式:do_munmap( ) 279
函式:find_vma( ) 281
函式:find_vma_intersection( ) 284
函式:free_pages( ) 286
函式:free_pages_exact( ) 287
函式:free_vm_area( ) 288
函式:get_unmapped_area( ) 288
函式:get_user_pages( ) 290
函式:get_user_pages_fast( ) 292
函式:get_vm_area_size( ) 294
函式:get_zeroed_page( ) 295
函式:kcalloc( ) 297
函式:kfree( ) 299
函式:kmalloc( ) 299
函式:kmap_high( ) 301
函式:kmem_cache_alloc( ) 303
函式:kmem_cache_create( ) 305
函式:kmem_cache_destroy( ) 308
函式:kmem_cache_free( ) 308
函式:kmem_cache_zalloc( ) 309
函式:kmemdup( ) 311
函式:krealloc( ) 313
函式:ksize( ) 315
函式:kstrdup( ) 318
函式:kstrndup( ) 319
函式:kunmap_high( ) 321
函式:kzalloc( ) 321
函式:memdup_user( ) 323
函式:mempool_alloc( ) 325
函式:mempool_alloc_pages( ) 327
函式:mempool_alloc_slab( ) 329
函式:mempool_create( ) 331
函式:mempool_create_kzalloc_pool ( ) 333
函式:mempool_destroy( ) 334
函式:mempool_free( ) 335
函式:mempool_free_pages( ) 335
函式:mempool_free_slab( ) 336
函式:mempool_kfree( ) 336
函式:mempool_kmalloc( ) 337
函式:mempool_kzalloc( ) 339
函式:mempool_resize( ) 341
函式:nr_free_buffer_pages( ) 343
宏:page_address( ) 345
宏:page_cache_get( ) 346
宏:page_cache_release( ) 348
函式:page_zone( ) 349
宏:probe_kernel_address( ) 352
函式:probe_kernel_read( ) 354
函式:probe_kernel_write( ) 355
函式:vfree( ) 357
函式:vma_pages( ) 358
函式:vmalloc( ) 359
函式:vmalloc_to_page( ) 361
函式:vmalloc_to_pfn( ) 363
函式:vmalloc_user( ) 365
參考文獻 366
第7章  Linux核心定時機制API 368
函式:__round_jiffies( ) 368
函式:__round_jiffies_relative( ) 369
函式:__round_jiffies_up( ) 371
函式:__round_jiffies_up_relative( ) 373
函式:__timecompare_update( ) 375
函式:add_timer( ) 377
函式:current_kernel_time( ) 378
函式:del_timer( ) 380
函式:del_timer_sync( ) 382
函式:do_gettimeofday( ) 384
函式:do_settimeofday( ) 386
函式:get_seconds( ) 388
函式:getnstimeofday( ) 390
函式:init_timer( ) 391
函式:init_timer_deferrable( ) 393
函式:init_timer_deferrable_key( ) 395
函式:init_timer_key( ) 398
函式:init_timer_on_stack( ) 400
函式:init_timer_on_stack_key( ) 402
函式:mktime( ) 404
函式:mod_timer( ) 406
函式:mod_timer_pending( ) 408
函式:ns_to_timespec( ) 410
函式:ns_to_timeval( ) 412
函式:round_jiffies( ) 414
函式:round_jiffies_relative( ) 416
函式:round_jiffies_up( ) 418
函式:round_jiffies_up_relative( ) 420
函式:set_normalized_timespec( ) 422
函式:setup_timer( ) 424
函式:setup_timer_key( ) 426
函式:setup_timer_on_stack( ) 428
函式:setup_timer_on_stack_key( ) 430
函式:timecompare_offset( ) 432
函式:timecompare_transform( ) 435
函式:timecompare_update( ) 436
函式:timer_pending( ) 439
函式:timespec_add_ns( ) 441
函式:timespec_compare( ) 442
函式:timespec_equal( ) 444
函式:timespec_sub( ) 446
函式:timespec_to_ns( ) 448
函式:timeval_compare( ) 450
函式:timeval_to_ns( ) 452
函式:try_to_del_timer_sync( ) 453
參考文獻 456
第8章  Linux核心同步機制API 457
函式:atomic_add( ) 457
函式:atomic_add_negative( ) 458
函式:atomic_add_return( ) 460
函式:atomic_add_unless( ) 461
宏:atomic_cmpxchg( ) 463
函式:atomic_dec( ) 464
函式:atomic_dec_and_test( ) 466
函式:atomic_inc( ) 467
函式:atomic_inc_and_test( ) 469
宏:atomic_read( ) 470
宏:atomic_set( ) 471
函式:atomic_sub( ) 472
函式:atomic_sub_and_test( ) 474
函式:atomic_sub_return( ) 475
函式:down( ) 477
函式:down_interruptible( ) 479
函式:down_killable( ) 481
函式:down_read( ) 483
函式:down_read_trylock( ) 485
函式:down_timeout( ) 487
函式:down_trylock( ) 489
函式:down_write( ) 491
函式:down_write_trylock( ) 492
函式:downgrade_write( ) 494
宏:init_rwsem( ) 496
宏:read_lock( ) 498
函式:read_seqbegin( ) 499
函式:read_seqretry( ) 500
宏:read_trylock( ) 503
宏:read_unlock( ) 504
宏:rwlock_init( ) 505
函式:sema_init( ) 508
宏:seqlock_init( ) 509
宏:spin_can_lock( ) 511
宏:spin_lock( ) 513
宏:spin_lock_bh( ) 514
宏:spin_lock_init ( ) 516
宏:spin_lock_irq( ) 518
宏:spin_lock_irqsave( ) 520
宏:spin_trylock( ) 522
宏:spin_unlock( ) 525
宏:spin_unlock_bh( ) 526
宏:spin_unlock_irq( ) 526
宏:spin_unlock_irqrestore( ) 527
宏:spin_unlock_wait( ) 527
函式:up( ) 529
函式:up_read( ) 531
函式:up_write( ) 532
宏:write_lock( ) 532
函式:write_seqlock( ) 534
函式:write_sequnlock( ) 534
宏:write_trylock( ) 535
宏:write_unlock( ) 537
參考文獻 537
第9章  Linux檔案系統核心API 539
函式:__mnt_is_readonly( ) 539
函式:current_umask( ) 541
函式:d_alloc( ) 542
函式:d_alloc_root( ) 544
函式:d_delete( ) 547
函式:d_find_alias( ) 547
函式:d_invalidate( ) 549
函式:d_move( ) 550
函式:d_validate( ) 551
函式:dput( ) 553
函式:fget( ) 554
函式:find_inode_number( ) 557
函式:generic_fillattr( ) 559
函式:get_empty_filp( ) 561
函式:get_fs_type( ) 563
函式:get_max_files( ) 565
函式:get_super( ) 566
函式:get_unused_fd( ) 569
函式:have_submounts( ) 570
函式:I_BDEV( ) 572
函式:iget_locked( ) 573
函式:inode_add_bytes( ) 575
函式:inode_get_bytes( ) 576
函式:inode_needs_sync( ) 578
函式:inode_set_bytes( ) 580
函式:inode_setattr( ) 581
函式:inode_sub_bytes( ) 584
函式:invalidate_inodes( ) 586
函式:is_bad_inode( ) 587
函式:make_bad_inode( ) 588
函式:may_umount( ) 590
函式:may_umount_tree( ) 591
函式:mnt_pin( ) 593
函式:mnt_unpin( ) 594
函式:mnt_want_write( ) 596
函式:new_inode( ) 596
函式:notify_change( ) 598
函式:put_unused_fd( ) 600
函式:register_filesystem( ) 602
函式:unregister_filesystem( ) 604
函式:unshare_fs_struct( ) 604
函式:vfs_fstat( ) 606
函式:vfs_getattr( ) 608
函式:vfs_statfs( ) 610
參考文獻 613
第10章  Linux設備驅動及設備管理API 614
函式:__class_create( ) 614
函式:__class_register( ) 615
函式:cdev_add( ) 616
函式:cdev_alloc( ) 617
函式:cdev_del( ) 619
函式:cdev_init( ) 624
宏:class_create( ) 628
函式:class_destroy( ) 629
宏:class_register( ) 631
函式:class_unregister( ) 632
函式:device_add( ) 637
函式:device_create( ) 638
函式: device_del( ) 640
函式:device_destroy( ) 640
函式:device_initialize( ) 646
函式:device_register( ) 652
函式:device_rename( ) 652
函式:device_unregister( ) 657
函式:get_device( ) 663
函式:put_device( ) 663
函式:register_chrdev( ) 667
函式:register_keyboard_notifier( ) 668
函式:unregister_chrdev( ) 669
函式:unregister_keyboard_notifier( ) 675
部分相關函式說明 679
參考文獻 679
附錄  Linux核心API快速檢索表 680

相關詞條

熱門詞條

聯絡我們