linux-5.15/list_entry()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#v6f6bcbe]
#backlinks
*説明 [#g9785666]
-パス: [[linux-5.15/include/linux/list.h]]
-リストを含む構造体のポインタを取得するマクロ。
--container_of() も参照のこと。
--[[linux-5.15/container_of()]]
**引数 [#od493f7a]
-struct list_head *ptr
--構造体内のリスト先頭へのポインタを指定する。
--struct list_head *以外の型を指定してもコンパイルエラー...
--[[linux-5.15/list_head]]
-type
--ptr に指定したポインタが指すメンバ、これを含む「構造体...
-member
--ptr に指定したポインタが指す「メンバ名」を指定する。
--type に指定した型は member に指定した名前のメンバを持っ...
**返り値 [#icb199b8]
-type *
--例えばlist_entry(a, struct hogehoge, b)とすれば、struct...
**参考 [#ldaf87bc]
*実装 [#q51f3057]
/**
* list_entry - get the struct for this entry
* @ptr: the &struct list_head pointer.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_head within the struct.
*/
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
-container_of()を呼ぶだけ。
--[[linux-5.15/container_of()]]
*コメント [#pfc01476]
終了行:
*参照元 [#v6f6bcbe]
#backlinks
*説明 [#g9785666]
-パス: [[linux-5.15/include/linux/list.h]]
-リストを含む構造体のポインタを取得するマクロ。
--container_of() も参照のこと。
--[[linux-5.15/container_of()]]
**引数 [#od493f7a]
-struct list_head *ptr
--構造体内のリスト先頭へのポインタを指定する。
--struct list_head *以外の型を指定してもコンパイルエラー...
--[[linux-5.15/list_head]]
-type
--ptr に指定したポインタが指すメンバ、これを含む「構造体...
-member
--ptr に指定したポインタが指す「メンバ名」を指定する。
--type に指定した型は member に指定した名前のメンバを持っ...
**返り値 [#icb199b8]
-type *
--例えばlist_entry(a, struct hogehoge, b)とすれば、struct...
**参考 [#ldaf87bc]
*実装 [#q51f3057]
/**
* list_entry - get the struct for this entry
* @ptr: the &struct list_head pointer.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_head within the struct.
*/
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
-container_of()を呼ぶだけ。
--[[linux-5.15/container_of()]]
*コメント [#pfc01476]
ページ名: