The Linux Kernel API :: Linux 核心應用程式介面

Legal Notice
Table of Contents
1. 驅動程式基本函(Driver Basics)
驅動程式進入點與離開點(Driver Entry and Exit points)
module_init — 驅動程式初始化進入點(driver initialization entry point)
module_exit — 驅動程式離開點(driver exit entry point)
Atomic 變數與指標的操作(Atomic and pointer manipulation)
atomic_read — 讀取 atomic 變數(read atomic variable)
atomic_set — 設定 atomic 變數(set atomic variable)
atomic_add — atomic 變數之整數加法(add integer to atomic variable)
atomic_sub — atomic 變數之整數減法(subtract the atomic variable)
atomic_sub_and_test — atomic 變數之測試並減去某整數(subtract value from variable and test result)
atomic_inc — atomic 變數之加一(increment atomic variable)
atomic_dec — atomic 變數之減一(decrement atomic variable)
atomic_dec_and_test — atomic 變數之測試並減去一(decrement and test)
atomic_inc_and_test — atomic 變數之測試並加上一(increment and test)
atomic_add_negative — atomic 變數之負整數測試並加上一(add and test if negative)
get_unaligned — 從 mis-aligned 位址讀取 atomic 變數值(get value from possibly mis-aligned location)
put_unaligned — 從 mis-aligned 位址設定 atomic 變數值(put value to a possibly mis-aligned location)
延遲、排程與計時器相關函示(Delaying, scheduling, and timer routines)
schedule_timeout — 靜止直到逾時(sleep until timeout)
2. 資料型態(Data Types)
雙向連結(Doubly Linked Lists)
list_add — 新增一個 entry(add a new entry)
list_add_tail — 在 list head 的尾端加入一個 entry(add a new entry)
list_del — 從 list head 刪除一個 entry(deletes entry from list)
list_del_init — 從 list 刪除一個 entry 並且初始化(deletes entry from list and reinitialize it.)
list_empty — 測試 list 是否為空(tests whether a list is empty)
list_splice — 將兩個 list 結合(join two lists)
list_entry — 回傳 entry 的結構(get the struct for this entry)
list_for_each — 在 list 上 for-each 移動(iterate over a list)
list_for_each_safe — 反覆於此 list 上並且可防止在反覆時 entry 遭移除(iterate over a list safe against removal of list entry)
3. 基本的 C 應用程式庫函式(Basic C Library Functions)
字串的轉換(String Conversions)
simple_strtol — 轉換字串為 signed long(convert a string to a signed long)
simple_strtoll — 轉換字串為 unsigned long long(convert a string to a signed long long)
simple_strtoul — 轉換字串為 unsigned long(convert a string to an unsigned long)
simple_strtoull — 轉換字串為 unsigned long long(convert a string to an unsigned long long)
vsnprintf — 設定字串格式(Format a string and place it in a buffer)
snprintf — 設定字串格式(Format a string and place it in a buffer)
vsprintf — 設定字串格式(Format a string and place it in a buffer)
sprintf — 設定字串格式(Format a string and place it in a buffer)
字串的操作(String Manipulation)
strcpy — 複製字串 Copy a NUL terminated string
strncpy — 複製 N bytes 字串 Copy a length-limited, NUL-terminated string
strcat — 在字串後串接字串 Append one NUL-terminated string to another
strncat — 在字串後串接 N Bytes 字串 Append a length-limited, NUL-terminated string to another
strcmp — 比較兩個字串 Compare two strings
strncmp — 比較兩個字串 N Bytes Compare two length-limited strings
strchr — 在字串上找出第一個出現的字元 Find the first occurrence of a character in a string
strrchr — 在字串上找出最後一個出現的字元 Find the last occurrence of a character in a string
strlen — 字串的長度 Find the length of a string
strnlen — 字串長度 Find the length of a length-limited string
strpbrk — 在字串中找出第一個出現的字串 Find the first occurrence of a set of characters
strtok — 依據 Tokens 拆開字串 Split a string into tokens
memset — 設定某一個記憶體予以某值 Fill a region of memory with the given value
bcopy — 複製一塊記憶體至另外一塊 Copy one area of memory to another
memcpy — 複製一塊記憶體至另外一塊 Copy one area of memory to another
memmove — 複製一塊記憶體至另外一塊 Copy one area of memory to another
memcmp — 比較兩塊記憶體 Compare two areas of memory
memscan — 在記憶體中找出指定字元 Find a character in an area of memory.
strstr — 在字串中找出另外一個字串 Find the first substring in a NUL terminated string
memchr — 在記憶體中找出指定字元 Find a character in an area of memory.
位元操作(Bit Operations)
set_bit — 在記憶體中設定某個 bit Atomically set a bit in memory
__set_bit — 在記憶體中設定某個 bit Set a bit in memory
clear_bit — 清除某個 bit Clears a bit in memory
__change_bit — 改變某個 bit Toggle a bit in memory
change_bit — 改變某個 bit Toggle a bit in memory
test_and_set_bit — 設定某個 bit 並且回傳舊值 Set a bit and return its old value
__test_and_set_bit — 設定某個 bit 並且回傳舊值 Set a bit and return its old value
test_and_clear_bit — 清除某個 bit 並且回傳舊值 Clear a bit and return its old value
__test_and_clear_bit — 清除某個 bit 並且回傳舊值 Clear a bit and return its old value
test_and_change_bit — 改變某個 bit 並且回傳新值 Change a bit and return its new value
test_bit — 測試是否此 bit On Determine whether a bit is set
find_first_zero_bit — 找到第一個為零的 bit(被清除的) find the first zero bit in a memory region
find_next_zero_bit — 找到下一個為零的 bit(被清除的) find the first zero bit in a memory region
ffz — find first zero in word.
ffs — 找到第一個為1的 bit(被設定的)find first bit set
hweight32 — returns the hamming weight of a N-bit word
4. 記憶體管理(Memory Management in Linux)
Slab 快取(The Slab Cache)
kmem_cache_create — 產生一個 Cache Pool Create a cache.
kmem_cache_shrink — 收縮一個 Cache Pool Shrink a cache.
kmem_cache_destroy — 刪除一個 Cache Pool delete a cache
kmem_cache_alloc — 在 Cache 中配置物件 Allocate an object
kmalloc — 配置記憶體 allocate memory
kmem_cache_free — 刪除在 Cache 中已經配置的物件 Deallocate an object
kfree — 釋放配置的記憶體 free previously allocated memory
5. Proc 檔案系統(The proc filesystem)
Sysctl 介面(sysctl interface)
register_sysctl_table — 註冊 sysctl 的階級架構 register a sysctl heirarchy
unregister_sysctl_table — 反註冊 sysctl 的階級架構 unregister a sysctl table heirarchy
proc_dostring — 讀取字串 read a string sysctl
proc_dointvec — 讀取整數向量 read a vector of integers
proc_dointvec_minmax — read a vector of integers with min/max values
proc_doulongvec_minmax — read a vector of long integers with min/max values
proc_doulongvec_ms_jiffies_minmax — read a vector of millisecond values with min/max values
proc_dointvec_jiffies — read a vector of integers as seconds
6. Linux 虛擬檔案系統(The Linux VFS)
目錄快取(The Directory Cache)
d_invalidate — 使 dentry 無效 invalidate a dentry
d_find_alias — 取得 inode 雜湊別名 grab a hashed alias of inode
prune_dcache — 縮小 dcache shrink the dcache
shrink_dcache_sb — 所小 dcache 的 superblock shrink dcache for a superblock
have_submounts — 檢查是 dentry 否有 mounts check for mounts over a dentry
shrink_dcache_parent — 縮小 dcache parent, prune dcache
d_alloc — 配置 dentry 記憶體, allocate a dcache entry
d_instantiate — fill in inode information for a dentry
d_alloc_root — 配置 root dentry, allocate root dentry
d_lookup — 找 dentry, search for a dentry
d_validate — verify dentry provided from insecure source
d_delete — delete a dentry
d_rehash — add an entry back to the hash
d_move — move a dentry
__d_path — return the path of a dentry
is_subdir — is new dentry a subdirectory of old_dentry
find_inode_number — check for dentry with name
d_drop — drop a dentry
d_add — add dentry to hash queues
dget — get a reference to a dentry
d_unhashed — is dentry hashed
Inode 處理(Inode Handling)
__mark_inode_dirty — internal function
write_inode_now — write an inode to disk
clear_inode — clear an inode
invalidate_inodes — discard the inodes on a device
get_empty_inode — obtain an inode
iunique — get a unique inode number
insert_inode_hash — hash an inode
remove_inode_hash — remove an inode from the hash
iput — put an inode
bmap — find a block number in a file
update_atime — update the access time
make_bad_inode — mark an inode bad due to an I/O error
is_bad_inode — is an inode errored
註冊與 SB(Registration and Superblocks)
register_filesystem — register a new filesystem
unregister_filesystem — unregister a file system
get_super — get the superblock of a device
檔案鎖定(File Locks)
__get_lease — revoke all outstanding leases on file
posix_block_lock — blocks waiting for a file lock
posix_unblock_lock — stop waiting for a file lock
lock_may_read — checks that the region is free of locks
lock_may_write — checks that the region is free of locks
fcntl_getlease — Enquire what lease is currently active
fcntl_setlease — sets a lease on an open file
sys_flockflock system call.
get_locks_status — reports lock usage in /proc/locks
7. Linux 網路通訊(Linux Networking)
Socket Buffer 函式(Socket Buffer Functions)
skb_queue_empty — check if a queue is empty
skb_get — reference buffer
kfree_skb — free an sk_buff
skb_cloned — is the buffer a clone
skb_shared — is the buffer shared
skb_share_check — check if buffer is shared and if so clone it
skb_unshare — make a copy of a shared buffer
skb_queue_len — get queue length
__skb_queue_head — queue a buffer at the list head
skb_queue_head — queue a buffer at the list head
__skb_queue_tail — queue a buffer at the list tail
skb_queue_tail — queue a buffer at the list tail
__skb_dequeue — remove from the head of the queue
skb_dequeue — remove from the head of the queue
skb_insert — insert a buffer
skb_append — append a buffer
skb_unlink — remove a buffer from a list
__skb_dequeue_tail — remove from the tail of the queue
skb_dequeue_tail — remove from the head of the queue
skb_put — add data to a buffer
skb_push — add data to the start of a buffer
skb_pull — remove data from the start of a buffer
skb_headroom — bytes at buffer head
skb_tailroom — bytes at buffer end
skb_reserve — adjust headroom
skb_trim — remove end from a buffer
skb_orphan — orphan a buffer
skb_queue_purge — empty a list
__skb_queue_purge — empty a list
__dev_alloc_skb — allocate an skbuff for sending
dev_alloc_skb — allocate an skbuff for sending
skb_cow — copy header of skb when it is required
skb_over_panic — private function
skb_under_panic — private function
alloc_skb — allocate a network buffer
__kfree_skb — private function
skb_clone — duplicate an sk_buff
skb_copy — create private copy of an sk_buff
pskb_copy — create copy of an sk_buff with private head.
pskb_expand_head — reallocate header of sk_buff
skb_copy_expand — copy and expand sk_buff
__pskb_pull_tail — advance tail of skb header
Socket 濾器(Socket Filter)
sk_run_filter — run a filter on a socket
sk_chk_filter — verify socket filter code
8. 網路裝置驅動(Network device support)
驅動程式支援(Driver Support)
init_etherdev — Register ethernet device
alloc_etherdev — Allocates and sets up an ethernet device
init_fddidev — Register FDDI device
alloc_fddidev — Register FDDI device
init_hippi_dev — Register HIPPI device
alloc_hippi_dev — Register HIPPI device
init_trdev — Register token ring device
alloc_trdev — Register token ring device
init_fcdev — Register fibre channel device
alloc_fcdev — Register fibre channel device
dev_add_pack — add packet handler
dev_remove_pack — remove packet handler
__dev_get_by_name — find a device by its name
dev_get_by_name — find a device by its name
dev_get — test if a device exists
__dev_get_by_index — find a device by its ifindex
dev_get_by_index — find a device by its ifindex
dev_alloc_name — allocate a name for a device
dev_alloc — allocate a network device and name
netdev_state_change — device changes state
dev_load — load a network module
dev_open — prepare an interface for use.
dev_close — shutdown an interface.
register_netdevice_notifier — register a network notifier block
unregister_netdevice_notifier — unregister a network notifier block
dev_queue_xmit — transmit a buffer
netif_rx — post buffer to the network code
register_gifconf — register a SIOCGIF handler
netdev_set_master — set up master/slave pair
dev_set_promiscuity — update promiscuity count on a device
dev_set_allmulti — update allmulti count on a device
dev_ioctl — network device ioctl
dev_new_index — allocate an ifindex
netdev_finish_unregister — complete unregistration
unregister_netdevice — remove device from the kernel
8390 類網路卡(8390 Based Network Cards)
ei_open — Open/initialize the board.
ei_close — shut down network device
ei_tx_timeout — handle transmit time out condition
ei_interrupt — handle the interrupts from an 8390
ethdev_init — init rest of 8390 device struct
NS8390_init — initialize 8390 hardware
同步點對點(Synchronous PPP)
sppp_input — receive and process a WAN PPP frame
sppp_close — close down a synchronous PPP or Cisco HDLC link
sppp_open — open a synchronous PPP or Cisco HDLC link
sppp_reopen — notify of physical link loss
sppp_change_mtu — Change the link MTU
sppp_do_ioctl — Ioctl handler for ppp/hdlc
sppp_attach — attach synchronous PPP/HDLC to a device
sppp_detach — release PPP resources from a device
9. 模組支援(Module Support)
載入模組(Module Loading)
request_module — try to load a kernel module
call_usermodehelper — start a usermode application
Inter Module support
inter_module_register — register a new set of inter module data.
inter_module_unregister — unregister a set of inter module data.
inter_module_get — return arbitrary userdata from another module.
inter_module_get_request — im get with automatic request_module.
inter_module_put — release use of data from another module.
10. 硬體介面(Hardware Interfaces)
岔斷處理(Interrupt Handling)
disable_irq_nosync — disable an irq without waiting
disable_irq — disable an irq and wait for completion
enable_irq — enable handling of an irq
probe_irq_mask — scan a bitmap of interrupt lines
MTRR Handling
mtrr_add — Add a memory type region
mtrr_del — delete a memory type region
PCI 支援程式庫(PCI Support Library)
pci_find_slot — locate PCI device from a given PCI slot
pci_find_subsys — begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id
pci_find_device — begin or continue searching for a PCI device by vendor/device id
pci_find_class — begin or continue searching for a PCI device by class
pci_find_capability — query for devices' capabilities
pci_find_parent_resource — return resource region of parent bus of given region
pci_set_power_state — Set the power state of a PCI device
pci_save_state — save the PCI configuration space of a device before suspending
pci_restore_state — Restore the saved state of a PCI device
pci_enable_device — Initialize device before it's used by a driver.
pci_disable_device — Disable PCI device after use
pci_enable_wake — enable device to generate PME# when suspended
pci_release_regions — Release reserved PCI I/O and memory resources
pci_request_regions — Reserved PCI I/O and memory resources
pci_match_device — Tell if a PCI device structure has a matching PCI device id structure
pci_register_driver — register a new pci driver
pci_unregister_driver — unregister a pci driver
pci_insert_device — insert a hotplug device
pci_remove_device — remove a hotplug device
pci_dev_driver — get the pci_driver of a device
pci_set_master — enables bus-mastering for device dev
pci_setup_device — fill in class and map information of a device
pci_pool_create — Creates a pool of pci consistent memory blocks, for dma.
pci_pool_destroy — destroys a pool of pci memory blocks.
pci_pool_alloc — get a block of consistent memory
pci_pool_free — put block back into pci pool
MCA Architecture
MCA Device Functions
11. 裝置之檔案系統(The Device File System)
devfs_register — Register a device entry.
devfs_unregister — Unregister a device entry.
devfs_mk_dir — Create a directory in the devfs namespace.
devfs_find_handle — Find the handle of a devfs entry.
devfs_get_flags — Get the flags for a devfs entry.
devfs_get_maj_min — Get the major and minor numbers for a devfs entry.
devfs_get_handle_from_inode — Get the devfs handle for a VFS inode.
devfs_generate_path — Generate a pathname for an entry, relative to the devfs root.
devfs_get_ops — Get the device operations for a devfs entry.
devfs_set_file_size — Set the file size for a devfs regular file.
devfs_get_info — Get the info pointer written to private_data of de upon open.
devfs_set_info — Set the info pointer written to private_data upon open.
devfs_get_parent — Get the parent device entry.
devfs_get_first_child — Get the first leaf node in a directory.
devfs_get_next_sibling — Get the next sibling leaf node. for a device entry.
devfs_auto_unregister — Configure a devfs entry to be automatically unregistered.
devfs_get_unregister_slave — Get the slave entry which will be automatically unregistered.
devfs_get_name — Get the name for a device entry in its parent directory.
devfs_register_chrdev — Optionally register a conventional character driver.
devfs_register_blkdev — Optionally register a conventional block driver.
devfs_unregister_chrdev — Optionally unregister a conventional character driver.
devfs_unregister_blkdev — Optionally unregister a conventional block driver.
12. 電源管理(Power Management)
pm_register — register a device with power management
pm_unregister — unregister a device with power management
pm_unregister_all — unregister all devices with matching callback
pm_send — send request to a single device
pm_send_all — send request to all managed devices
pm_find — find a device
13. Block 裝置(Block Devices)
blk_cleanup_queue — release a request_queue_t when it is no longer needed
blk_queue_headactive — indicate whether head of request queue may be active
blk_queue_make_request — define an alternate make_request function for a device
blk_init_queue — prepare a request queue for use with a block device
ll_rw_block — level access to block devices
end_that_request_first — end I/O on one buffer.
14. 其他裝置(Miscellaneous Devices)
misc_register — register a miscellaneous device
misc_deregister — unregister a miscellaneous device
15. 視訊相關(Video4Linux)
video_unregister_device — unregister a video4linux device
16. 音效裝置(Sound Devices)
register_sound_special — register a special sound node
register_sound_mixer — register a mixer device
register_sound_midi — register a midi device
register_sound_dsp — register a DSP device
register_sound_synth — register a synth device
unregister_sound_special — unregister a special sound device
unregister_sound_mixer — unregister a mixer
unregister_sound_midi — unregister a midi device
unregister_sound_dsp — unregister a DSP device
unregister_sound_synth — unregister a synth device
17. USB 裝置(USB Devices)
usb_register — register a USB driver
usb_scan_devices — scans all unclaimed USB interfaces
usb_deregister — unregister a USB driver
usb_alloc_bus — creates a new USB host controller structure
usb_free_bus — frees the memory used by a bus structure
usb_register_bus — registers the USB host controller with the usb core
usb_deregister_bus — deregisters the USB host controller
usb_match_id — find first usb_device_id matching device or interface
usb_alloc_urb — creates a new urb for a USB driver to use
usb_free_urb — frees the memory used by a urb
usb_control_msg — Builds a control urb, sends it off and waits for completion
usb_bulk_msg — Builds a bulk urb, sends it off and waits for completion
18. 16x50 UART Driver
register_serial — configure a 16x50 serial port at runtime
unregister_serial — deconfigure a 16x50 serial port
19. Z85230 Support Library
z8530_interrupt — Handle an interrupt from a Z8530
z8530_sync_open — Open a Z8530 channel for PIO
z8530_sync_close — Close a PIO Z8530 channel
z8530_sync_dma_open — Open a Z8530 for DMA I/O
z8530_sync_dma_close — Close down DMA I/O
z8530_sync_txdma_open — Open a Z8530 for TX driven DMA
z8530_sync_txdma_close — Close down a TX driven DMA channel
z8530_describe — Uniformly describe a Z8530 port
z8530_init — Initialise a Z8530 device
z8530_shutdown — Shutdown a Z8530 device
z8530_channel_load — Load channel data
z8530_null_rx — Discard a packet
z8530_queue_xmit — Queue a packet
z8530_get_stats — Get network statistics
20. Frame Buffer Library
Frame Buffer Memory
register_framebuffer — registers a frame buffer device
unregister_framebuffer — releases a frame buffer device
Frame Buffer Console
fbcon_redraw_clear — clear area of the screen
fbcon_redraw_bmove — copy area of screen to another area
Frame Buffer Colormap
fb_alloc_cmap — allocate a colormap
fb_copy_cmap — copy a colormap
fb_get_cmap — get a colormap
fb_set_cmap — set the colormap
fb_default_cmap — get default colormap
fb_invert_cmaps — invert all defaults colormaps
Frame Buffer Generic Functions
fbgen_get_fix — get fixed part of display
fbgen_get_var — get user defined part of display
fbgen_set_var — set the user defined part of display
fbgen_get_cmap — get the colormap
fbgen_set_cmap — set the colormap
fbgen_pan_display — pan or wrap the display
fbgen_do_set_var — change the video mode
fbgen_set_disp — set generic display
fbgen_install_cmap — install the current colormap
fbgen_update_var — update user defined part of display
fbgen_switch — switch to a different virtual console.
fbgen_blank — blank the screen
Frame Buffer Video Mode Database
fb_find_mode — finds a valid video mode
__fb_try_mode — test a video mode
Frame Buffer Macintosh Video Mode Database
console_getmode — get current mode
console_setmode — sets current console mode
console_setcmap — sets palette color map for console
console_powermode — sets monitor power mode
mac_vmode_to_var — converts vmode/cmode pair to var structure
mac_var_to_vmode — convert var structure to MacOS vmode/cmode pair
mac_map_monitor_sense — Convert monitor sense to vmode
mac_find_mode — find a video mode
Frame Buffer Fonts
fbcon_find_font — find a font
fbcon_get_default_font — get default font

Vovo2000.Com - About Vovo2000 - Terms of Service - Privacy Policy - Type Testing Lab