Skip to main content.
Navigation:
DENX
>
Training2
>
LddKernelLibraryFunctions
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
Training2
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
Training2 Home
Changes
Index
Search
Go
List of pages in Training2
Search
%SECTION0{name=LddLibraryFunctions}% Kernel library functions * linux features standard implementations for various types and functions: * linked lists * circular, double linked list (_linux/list.h_) * klists, more sophisticated list with locking and ref counting (_linux/klist.h_) * kfifos (_linux/kfifo.h_) * string functions * bit and bitmap operations * (commandline) parsing * crc functions * ... * documentation? <verbatim> make htmldocs firefox Documentation/DocBook/index.html </verbatim> -> kernel api ---++ API: linked lists *type:* <verbatim> struct list_head { struct list_head *next, *prev; }; </verbatim> *Initalize head pointer:* <verbatim> struct list_head mempool; INIT_LIST_HEAD(&mempool); /* at runtime or ... */ LIST_HEAD(mempool); /* at compile time */ </verbatim> *Embedd =struct list_head= in list element:* <verbatim> struct mem_chunk { unsigned char *ptr; int len; struct list_head list; } </verbatim> *add element:* <verbatim> struct mem_chunk mc; mc.ptr = this; mc.len = 128; list_add(&mc.list, &mempool); </verbatim> *remove element:* <verbatim> struct list_head myelement = list_del(&mempool.next); </verbatim> *find superstructure:* <verbatim> mc = list_entry(myelement, struct mem_chunk, list); </verbatim> *Functions:* see _kernel-api_ documentation and _include/list.h_
5.7.6. How to delay execution
1. Denx Training Topics
5.7.8. Userspace kernel communication
Prev
Home
Next