Linux环境下一些主要实用数据结构简介
本文列出了Linux一些主要的实用数据结构。
& h9 n8 y+ K& b& F; M8 ?block_dev_struct 8 m0 p. E* T" ^3 K/ z5 {
此结构用于向核心登记块设备,它还被buffer cache实用。所有此类结构都位于blk_dev数组中。
, U3 E: a- y3 `! U5 I$ [( C& T A7 s. ^) N
- h. }* E) F: A! S) U0 h1 m0 Q" O/ ]1 E5 E3 ?( l; T
3 x p) {1 J7 v% K# [; I3 n$ K3 T0 i# N* M
7 `+ l: ~* H; p2 b% bstruct blk_dev_struct {" Q' M% f8 F, q) S& k( K+ P' k
void (*request_fn)(void);
2 W9 L2 [# {& Wstruct request * current_request;
# g5 c0 I$ R8 D' A5 c. Estruct request plug;
# T) ]- w( w. h, y; j, lstruct tq_struct plug_tq;
& S6 p. Y0 }5 i# g4 x};
: b- D+ Y1 \5 rbuffer_head
2 _: c$ J! R& Z此结构包含关于buffer cache中一块缓存的信息。 : C& J9 |$ W w N4 Q* s
3 y# { g: L* E @0 q) Y6 g# F
2 d1 Y/ |$ B* T( B$ e" b \5 f
; a* O' B0 W; p! L! b( s: S* K, B9 M; x# J" A9 j2 E3 `9 R
6 s# R D6 y: c/* bh state bits */
( D3 a; E1 }- F! i#define BH_Uptodate 0 /* 1 if the buffer contains valid data */
) t, @3 w" z! T8 c8 T* {#define BH_Dirty 1 /* 1 if the buffer is dirty */
8 r' ^. |/ a5 c- {6 x. u#define BH_Lock 2 /* 1 if the buffer is locked */
2 E% Z) k* n5 z: l, H, j9 f8 ?#define BH_Req 3 /* 0 if the buffer has been invalidated */
p( h6 o4 i. c% U! C8 e#define BH_Touched 4 /* 1 if the buffer has been touched (aging) */
6 n( r, K7 h# F# T/ U#define BH_Has_aged 5 /* 1 if the buffer has been aged (aging) */$ {, b% F" u8 c8 [
#define BH_Protected 6 /* 1 if the buffer is protected */
: U/ J$ c H1 q* g% k#define BH_FreeOnIO 7 /* 1 to discard the buffer_head after IO */
1 F' x; G" `! M6 d* c* ]% x" Vstruct buffer_head {' e* q% ~ |0 T3 e
/* First cache line: */
: A$ x) G2 g0 j+ ~4 r8 s2 wunsigned long b_blocknr; /* block number */
3 N: }1 I6 B% K; Bkdev_t b_dev; /* device (B_FREE = free) */
4 L% o# e8 I$ v3 F3 Y6 H/ Ikdev_t b_rdev; /* Real device */
- \% u/ p# R1 A1 ^( kunsigned long b_rsector; /* Real buffer location on disk */
5 U. ?8 o; l; u* J5 u9 Q2 kstruct buffer_head *b_next; /* Hash queue list */. ?, W( ?! ?# f& B) m
struct buffer_head *b_this_page; /* circular list of buffers in one
/ q9 [9 g, o& ]8 `! zpage */$ Z8 E, G- P5 @/ e% p9 n- R
/* Second cache line: */
) V, ?1 b1 l2 u0 \unsigned long b_state; /* buffer state bitmap (above) */ S$ Q* _' z, U+ A$ M3 L) u8 `
struct buffer_head *b_next_free;4 c! b/ N/ F& K& I' k
unsigned int b_count; /* users using this block */
" d' U" w3 ]8 y* M% Qunsigned long b_size; /* block size */; ~2 `& O: l- m, P
/* Non-performance-critical data follows. */
. G' W. ]; F! D- tchar *b_data; /* pointer to data block */
. s+ E) ~! h0 _8 d, U* Cunsigned int b_list; /* List that this buffer appears */9 `$ ^1 F+ x' X. J5 M
unsigned long b_flushtime; /* Time when this (dirty) buffer* k* ^7 H& v/ b) i4 e$ N" ^6 \" D/ ?: p
* should be written */
/ A) W n$ d5 [; e" r0 Qunsigned long b_lru_time; /* Time when this buffer was
# U. `: g6 l" a+ \' w, d* last used. */) ~. \( e; N# ]" Z5 `; S
struct wait_queue *b_wait;' z6 J1 b5 L. o7 d# i3 V6 j8 d
struct buffer_head *b_prev; /* doubly linked hash list */
( ~5 O. ]1 R0 r; e2 d" Ystruct buffer_head *b_prev_free; /* doubly linked list of buffers */
' L& o6 h6 k' m5 ustruct buffer_head *b_reqnext; /* request queue */
( _. R2 f2 I: L% K: Q$ D2 H};) o: x/ X, @6 O$ }! d
device # Y3 K$ a: u* u$ |& s$ i
系统中每个网络设备都用一个设备数据结构来表示。
i) s5 P8 K( ]* k- W0 p& R- v. p( m+ I3 Q* e
0 F4 l/ B$ w4 s" H/ e
) y+ u" k% f1 e* j- G1 C/ y: {* \# C" ]0 ~
& G" R, Y$ ]2 B4 p& I* W- ]5 \
struct device
( g9 }: ~2 Z0 Z) z{5 @/ C k7 | g4 [/ g m
/*
; O6 Y4 j& E3 M6 i. \/ B* This is the first field of the "visible" part of this structure
9 l3 X! N, r% V4 u! f' k2 @+ I( h w* (i.e. as seen by users in the "Space.c" file). It is the name8 ~- Q- k% R" g
* the interface.
3 Y9 ?- M2 N) ^ i0 ]6 ]*/9 ~5 G2 J0 U( G; b1 ^
char *name;
; H4 j: {5 U9 P' W4 u$ x/* I/O specific fields */& ^; Y7 @, V/ q8 K
unsigned long rmem_end; /* shmem "recv" end */
# C* h; ^6 D/ O0 a' }8 c' tunsigned long rmem_start; /* shmem "recv" start */
9 [( W. ? I% g3 i) r0 E5 p% Kunsigned long mem_end; /* shared mem end */4 T' {; [1 J) E, S* a6 W
unsigned long mem_start; /* shared mem start */2 F/ V1 r& N! E2 Y3 p- l
unsigned long base_addr; /* device I/O address */! t' P, _" m( M2 {; x8 X" [
unsigned char irq; /* device IRQ number */4 s! H' }* G* s N5 x9 L
/* Low-level status flags. */( P- X/ V8 ]4 y& G( [2 w$ U( Z
volatile unsigned char start, /* start an operation */
5 ^4 P5 K# } b5 P, `" kinterrupt; /* interrupt arrived */
! ^0 h0 b' n/ p% w& |2 z$ @/ ^unsigned long tbusy; /* transmitter busy */+ g% Q$ U5 N* v- e; s5 F
struct device *next;, ]# s. V3 v. j- A& m' j, B
/* The device initialization function. Called only once. */ {( C: F! J* a* U! C, n U
int (*init)(struct device *dev);/ e. B: d4 M5 G( J7 E, a2 g, D
/* Some hardware also needs these fields, but they are not part of
' H0 U* ^) x/ @* v& h$ Gthe usual set specified in Space.c. */9 H' i$ E6 {% S x% ^. ]. A
unsigned char if_port; /* Selectable AUI,TP, */
- Z5 g( P) i$ C8 kunsigned char dma; /* DMA channel */- t! N* a* K3 p! z
struct enet_statistics* (*get_stats)(struct device *dev);
$ D0 Q! Y4 p6 O$ n4 N2 q& ?/*6 L( |& w5 \$ Y, e E( T
* This marks the end of the "visible" part of the structure. All
0 k# y1 d) I* B: E* fields hereafter are internal to the system, and may change at
9 @' p: X% o) G2 J" l6 ?* will (read: may be cleaned up at will).
7 `9 Z( ^! I' c! d5 _5 S4 E*/
6 s/ c7 j* k$ w- s/* These may be needed for future network-power-down code. */& O6 u2 \* w7 t. L
unsigned long trans_start; /* Time (jiffies) of last transmit */. J g k& x% }: l6 F& j( G
unsigned long last_rx; /* Time of last Rx */
8 s6 [7 H% U- `+ r X6 zunsigned short flags; /* interface flags (BSD)*/' H$ D2 _, F1 L( P( x( E
unsigned short family; /* address family ID */6 m5 h, p. Y! ^
unsigned short metric; /* routing metric */ b: A6 ~! S; z1 M
unsigned short mtu; /* MTU value */3 _, ?9 Y4 p# _: @
unsigned short type; /* hardware type */ P$ ]% S D! o8 j+ D
unsigned short hard_header_len; /* hardware hdr len */
. i) R( Z: k `# S) y0 lvoid *priv; /* private data */) J# e2 v) c' K% p1 l
/* Interface address info. */7 \! C. N2 [; @8 {# x: [7 I
unsigned char broadcast[MAX_ADDR_LEN];
5 y# R+ M/ z ?' Y- I5 H1 Runsigned char pad;
- D: I# @# j0 K w+ m0 F3 Eunsigned char dev_addr[MAX_ADDR_LEN];
, `3 y% p. ]+ A& i3 hunsigned char addr_len; /* hardware addr len */" n2 M% I7 y B! n8 m
unsigned long pa_addr; /* protocol address */
- M: }5 o) |6 c! N* D: P7 A0 M0 Punsigned long pa_brdaddr; /* protocol broadcast addr*/
5 U6 f% `9 C& F( J9 j) |unsigned long pa_dstaddr; /* protocol P-P other addr*/
% F4 p! o7 T- }- ]/ n9 {7 hunsigned long pa_mask; /* protocol netmask */ ^% [! ]' I. k+ M) C' ^
unsigned short pa_alen; /* protocol address len */
9 d; T; H; f' Zstruct dev_mc_list *mc_list; /* M'cast mac addrs */
8 N# Y9 v3 g7 F( z9 F5 Aint mc_count; /* No installed mcasts */
* `0 s) H" C# y7 |struct ip_mc_list *ip_mc_list; /* IP m'cast filter chain */, C+ M/ T7 e, A# m% y
__u32 tx_queue_len; /* Max frames per queue */
- g ?3 L' J, l; b' M/* For load balancing driver pair support */
/ A0 g( I( x% [5 G) I N6 sunsigned long pkt_queue; /* Packets queued */( V c3 Q# o! Y ^) c3 O+ H9 o* J+ ?
struct device *slave; /* Slave device */; s" E4 b! J& g
struct net_alias_info *alias_info; /* main dev alias info */, S+ X) F3 ~" x
struct net_alias *my_alias; /* alias devs */ {* p3 ^2 j7 |0 c' U/ L- Z
/* Pointer to the interface buffers. */# T, X+ w" B0 z2 ]
struct sk_buff_head buffs[DEV_NUMBUFFS];8 k+ d9 B: k/ J5 ^2 a( D
/* Pointers to interface service routines. */
/ r- k% l4 N8 c% aint (*open)(struct device *dev);8 k7 C) m, O( U2 j9 c, Z
int (*stop)(struct device *dev);
" z! x% [- ]- ~8 i1 V: P* x2 `int (*hard_start_xmit) (struct sk_buff *skb,
. ?3 k3 T" ], jstruct device *dev);" D3 m1 v' a+ Y1 o) C" E# ]
int (*hard_header) (struct sk_buff *skb,
5 h% h$ u# L" l# g S$ Istruct device *dev,' M3 t; t p ^+ ~' G3 {/ m% h
unsigned short type,( A; b' s$ h& |
void *daddr,
" M1 g9 }2 D* i' _0 C- l0 c% Rvoid *saddr," [3 i7 V" W7 }! K3 Q9 m, M
unsigned len);
" Q) X2 p( w* a: iint (*rebuild_header)(void *eth,. {! @/ D, M4 m! C) C b
struct device *dev,
' A9 T6 Y$ C' e' H8 o2 R3 k. Junsigned long raddr," ?, y; S$ y# k1 |( l
struct sk_buff *skb);
& F0 p7 I7 p8 x0 hvoid (*set_multicast_list)(struct device *dev);8 F) h8 x Q! i% \2 b) C8 [/ G
int (*set_mac_address)(struct device *dev,) F0 U/ [9 C& p9 ]; ?3 o" U
void *addr);2 G1 |- v7 k+ v W6 y: A: M
int (*do_ioctl)(struct device *dev,
: N! L) F1 T$ S5 u( X3 _9 h* X$ ostruct ifreq *ifr,. n8 ^; v% x) A& ?3 g! _
int cmd);/ T5 b' G C- q* C7 ]( k
int (*set_config)(struct device *dev,
3 m9 G2 T* x; J. D P( bstruct ifmap *map);, G4 Z0 W# b: v* K
void (*header_cache_bind)(struct hh_cache **hhp,% h6 ~9 h) T( H' |/ a
struct device *dev,
# C _8 d2 d5 R6 S/ bunsigned short htype,
& m3 d' Y2 [. Q0 I( f__u32 daddr);
- g& G. E5 \( i! W1 J' U. T' ~void (*header_cache_update)(struct hh_cache *hh,( E, |! r: e/ p# S) V
struct device *dev,, _! y, A2 C# u. H1 o4 L5 n
unsigned char * haddr);
8 i# ^, f, @1 U5 nint (*change_mtu)(struct device *dev,0 q. I0 n; S+ C3 d; j
int new_mtu);! s! x+ b& g# a) v( `" t
struct iw_statistics* (*get_wireless_stats)(struct device *dev);% d: q" N" c$ y: ]
};0 m) U9 k+ R9 `7 c8 @% b' W5 k0 d
device_struct
6 w: ^: X r! ~" a3 i0 x此结构被块设备和字符设备用来向核心登记(包含设备名称以及可对此设备进行的文件操作)。chrdevs和blkdevs中的每个有效分别表示一个字符设备和块设备。 ' \# {$ j3 q$ e6 y1 a2 K0 l
# {. o" l& A( N" \
% \4 f( i8 Y$ N% }
# W+ u9 ]( i- g: j7 v+ a
& y& k5 b& _' N( i9 ~4 ?7 s: `& O0 l% o2 G% p( j4 s
struct device_struct {& _; U$ n0 J. t" h' `
const char * name;
: ]0 \8 a' Z, F, ~. h o' T/ u7 ostruct file_operations * fops;4 q/ S- J& A0 D% F/ s- H6 s
};
: |1 j- l' r5 g5 K9 V- P3 J! D2 S+ yfile # M& \2 ^4 c$ p
每个打开的文件、套接口都用此结构表示。 # D& `& n# R$ l! B. R/ I' M0 L
; }; e' f5 R, f& l
/ U1 N" P) C# f, r( X
p# [4 n1 u& v) [9 W
4 W9 e7 a3 c3 s7 j7 f% T; U0 [0 ]% ^8 \6 \" C$ N
struct file {
. T$ u2 j- A; Pmode_t f_mode;
; C+ v& i! z1 K1 M2 E% E- aloff_t f_pos;
; H% g* q1 ]7 X& z& runsigned short f_flags;
+ V' d( }7 [- N" _3 Sunsigned short f_count;, T% [6 `8 a' J1 [" K0 |
unsigned long f_reada, f_ramax, f_raend, f_ralen, f_rawin;* v2 u4 r; R% U% v
struct file *f_next, *f_prev;: L% O: F" M* g7 Q" |
int f_owner; /* pid or -pgrp where SIGIO should be sent */
1 ~3 R( I% r% ~& K% bstruct inode * f_inode;1 u. y! k* [- m: o
struct file_operations * f_op;
. x% }- J/ e9 P" b I6 r. d5 W8 y! Cunsigned long f_version;
4 C8 s. J0 F: _. d, Y6 |) Vvoid *private_data; /* needed for tty driver, and maybe others */
- e; w; W6 I- ^( b! {};
( C' k9 R# v3 F a1 Rfiles_struct 4 w# D, s( r- J, q2 }. E, a6 I; q
描叙被某进程打开的所有文件。
7 K; l$ f! y! k1 q" Q, p; f+ O! U9 [+ Z
8 J5 r" L( \; X6 D# [7 A# E2 f" i$ y8 H7 o
4 i! J9 n/ h5 t$ h# z# y% f/ @
3 {6 q3 Y, ^% [, K, Rstruct files_struct {. S; g$ T, T" j0 O7 `
int count;
9 Y x+ |( [3 o0 Ifd_set close_on_exec;: I- b5 _# n# T: [6 g/ v( m, G7 E; \
fd_set open_fds;+ U# r4 |* A6 n, x! d: X/ r
struct file * fd[NR_OPEN];
$ e3 D& U7 A& u# Y% c};
. y, _' H6 h& T) zfs_struct
% G% B/ I1 v+ Rstruct fs_struct {% ]8 W5 F6 i) a0 \: ~- h0 [
int count;
2 o( Z _* }- R7 ?7 e6 Lunsigned short umask;! J4 k" `5 E4 p( u- w
struct inode * root, * pwd;
- r7 A3 _1 E0 Z$ x" y- X3 E};
7 k* C' Z+ z$ O, d6 v9 |. Pgendisk
# k+ z/ k: Q- p, S7 L包含关于某个硬盘的信息。用于磁盘初始化与分区检查时。 ' ?/ |5 k1 [9 `
3 M j7 g; x" ~% h* C6 ], n& E2 t
2 I4 `0 v; ]- s3 V8 L$ {! U, N) U9 U
, e1 \. w6 P5 j; \' N; R: j' A1 C c; i. m5 A) B2 b# x' K( B
struct hd_struct {1 o- f7 i& P9 W- f/ M. t0 W
long start_sect;
$ [! W5 F1 F7 ~- H! \# B) r" Rlong nr_sects;; E! H, Z4 J3 U7 y i8 A
};
4 ~7 x5 M/ f: ?) S9 p" v; D" Rstruct gendisk {. T7 m9 }2 Z3 V5 X1 }* }& I
int major; /* major number of driver */
2 u5 N! _8 d+ U) ]- pconst char *major_name; /* name of major driver */
* Z) x, L* j$ i& Cint minor_shift; /* number of times minor is shifted to get real minor */# f, G* {4 D N$ r; ~+ k8 }
int max_p; /* maximum partitions per device */# p/ y& R4 q; j0 a
int max_nr; /* maximum number of real devices */
5 B# o' H8 c9 q# N# j) vvoid (*init)(struct gendisk *);
@+ M4 }- s# r7 f. I7 O: I$ q( ?/* Initialization called before we do our thing */" e2 d4 G) q& E( M p d @
struct hd_struct *part; /* partition table */
) Y8 _; G% S" J6 D! r( L- f- e3 Mint *sizes; /* device size in blocks, copied to blk_size[] */
0 S3 P0 m y" Wint nr_real; /* number of real devices */' ^: ^+ m) U4 v$ a9 i
void *real_devices; /* internal use */
; K0 ?, b2 V- |/ u' l! e/ d: J5 {struct gendisk *next;- ?* C" x2 \* p0 D; D( F
};
. P" V; ?; K7 S& Xinode ; v$ N, v' \- d" G6 c# A+ \6 F+ V
此VFS inode结构描叙磁盘上一个文件或目录的信息。
' Z a- w' W" N0 M, E: ]4 D- N' h8 U) z) j
( g+ y$ z% q- V+ p x) V, t! _* p/ F+ y% j! u. P
/ S) ` l) X" H7 O5 o
$ l: |1 ^& z" w2 W
struct inode { B1 }3 U7 {: ^$ {5 T! F1 W
kdev_t i_dev;
; L- m" E$ P1 B5 o3 G* ?0 kunsigned long i_ino;; j4 t9 [' H; M2 h
umode_t i_mode;
7 d' p- `) g# unlink_t i_nlink;
0 H4 R) R5 w' D: g7 ?9 M' m7 auid_t i_uid;# `5 m+ \. m' T) x) Q4 P
gid_t i_gid;
1 L( x; l9 [# m3 U: c* V* l3 ^kdev_t i_rdev;9 a; f& Z$ O. G9 g, N
off_t i_size;
$ p$ K2 ~( b2 T5 y6 ~5 [time_t i_atime;* Y% w0 D. T' S5 z6 y5 G
time_t i_mtime;8 [: A, D; \3 _: K
time_t i_ctime;
# n( E5 p% f1 |unsigned long i_blksize;9 p& ?/ {6 x' J2 p
unsigned long i_blocks;$ z7 W2 t% \" k% @4 c/ ]2 M
unsigned long i_version;
. | a7 a/ H7 R* H |- Iunsigned long i_nrpages;
% A; \' l* k, Cstruct semaphore i_sem;# g9 r; G5 z2 k; ?8 F8 y' n
struct inode_operations *i_op;
. ?. G% c4 x5 u6 @7 N& ?struct super_block *i_sb;
( J# w. Y: f; o; z/ `4 xstruct wait_queue *i_wait;
' T. G) V. l" g( A; B- D+ gstruct file_lock *i_flock;
. g; x, i/ p7 s) o* {struct vm_area_struct *i_mmap;
( g8 U1 m* |( `' Hstruct page *i_pages;( z6 w) U5 {/ E3 k8 g b
struct dquot *i_dquot[MAXQUOTAS];& V8 G! v9 A! e/ V7 }; i# Y4 k
struct inode *i_next, *i_prev;
8 q9 E% o% j) G2 v' W& vstruct inode *i_hash_next, *i_hash_prev;7 B" O$ ~! @2 b1 P+ o+ W4 T2 J
struct inode *i_bound_to, *i_bound_by;
8 H) R! ]- O* y+ v% f6 estruct inode *i_mount;% R7 P L- A* g& A3 d1 y, L- w
unsigned short i_count;
+ K! p2 U, Z) ]9 @4 {' k6 Wunsigned short i_flags;" F, n" v7 P0 S1 T. V$ ]! o0 v
unsigned char i_lock;* _9 F; f( P9 j( ^+ k
unsigned char i_dirt;
* t' M6 {7 d; g* A8 M4 N( c9 f) |unsigned char i_pipe;5 b+ `6 `8 i% J) G+ ], g9 j
unsigned char i_sock;
. o+ L- {5 E* o& }# {, ~unsigned char i_seek;* V/ l7 B# h, d" l, y
unsigned char i_update;
1 M) e. y, N' Y- X1 E2 {9 dunsigned short i_writecount;
' e3 J, [0 D$ U& p3 g: bunion {5 k# Q; e( j1 F. Y6 u* H2 q
struct pipe_inode_info pipe_i;$ Y8 F3 g& y! r. U( g7 x2 a' z
struct minix_inode_info minix_i;
( f m, |/ w6 I) [* H2 bstruct ext_inode_info ext_i;. H) J9 e% P* x8 n
struct ext2_inode_info ext2_i;
, B5 Y, S# a* M% }$ [8 {struct hpfs_inode_info hpfs_i;
* g# ?* }" M' S! Ystruct msdos_inode_info msdos_i;8 O$ i+ Z7 Q- g$ u3 V1 `
struct umsdos_inode_info umsdos_i;0 n( M, c n2 i8 S
struct iso_inode_info isofs_i;' F, `& S- S, h; c( Z9 k7 |
struct nfs_inode_info nfs_i;+ P% M# R6 B& g% a5 r, }8 V+ C
struct xiafs_inode_info xiafs_i;
. f# T5 `# X+ U$ A) }! A2 r. xstruct sysv_inode_info sysv_i;- I8 ^+ P2 B! _6 i6 v5 s
struct affs_inode_info affs_i;4 N& X }- o6 N L$ w4 T
struct ufs_inode_info ufs_i;6 k" F! d, n) ]+ c
struct socket socket_i;
3 J( L4 C, V! |* h$ r P4 fvoid *generic_ip;' g& ~, Y5 i; F& ]
} u;5 d' F1 S v9 D. E/ C% Y5 ^3 T
};" j* P0 p; i2 _4 \+ N$ p
ipc_perm
" ]6 G& ]4 q( m$ p" a1 x( y! G此结构描叙对一个系统V IPC对象的存取权限。
: f' q; s2 v) h2 m) v; S) m
. j. {$ X( z7 Z& M
2 x! b# }- }+ D2 V( Q) x2 `7 q7 {% P8 `$ g
6 J) ~- ]* Y$ \; l
1 [+ E( i- C* H* H& e% y
struct ipc_perm
0 f) l* ^% t( A! a; \{4 M, |6 \( @ q. E. b! Y" O
key_t key;
4 C/ ~: s( f0 R: `ushort uid; /* owner euid and egid */
; {# d/ A7 ]+ Nushort gid;% O3 G+ O$ l# T. B+ k1 g% V, q
ushort cuid; /* creator euid and egid */
4 f/ }& A* G P6 X( Z( eushort cgid;
, K, ]# K& b# u5 V& T2 uushort mode; /* access modes see mode flags below */
( [6 R6 o: L' k$ ]8 mushort seq; /* sequence number */
8 ^* ^. W% d9 E; o% \# W2 \};3 ^' Q% b, K" I0 {4 F3 j9 w
irqaction
N5 q, c# N+ n$ B+ D i用来描叙系统的中断处理过程。 * y1 O; I" r0 {8 }5 y, n
/ ^" h2 B- r% T3 ~3 T0 b2 l" n; H, R. ~$ T+ y* i/ N8 W
A6 V5 i: q: r! I+ }- n X" Q
?! L0 M3 G# O" d( p l: p" e9 H5 V# c" D$ ?! C J) W
struct irqaction {
6 m$ d7 z9 b. L9 {void (*handler)(int, void *, struct pt_regs *);2 T/ X$ }. [& N5 F" M, H: D1 W8 T
unsigned long flags;$ G0 q6 z) O; Y! U3 u
unsigned long mask;
& C+ U' l* P# a( y) m, b) Aconst char *name;; b" M3 B3 b9 Y$ d
void *dev_id;
% s6 b6 S& {3 q6 F4 z+ lstruct irqaction *next;! a/ z3 I9 j5 X8 `- y! w
};
f. F3 z( j r$ w& nlinux_binfmt
+ F8 H8 l* `2 O2 _; G以上就是Linux中主要的数据结构及其功能,要想把Linux学好必须掌握这些数据结构。
点击图标进入精品网摘收藏 欢迎大家加入网络收藏夹