/[lkdp]/lkdp/misc/list.tex
ViewVC logotype

Diff of /lkdp/misc/list.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by nayaniabhishek, Wed Jun 5 15:06:24 2002 UTC revision 1.2 by nayaniabhishek, Sat Jun 22 18:26:30 2002 UTC
# Line 1  Line 1 
1  \chapter{List}  \chapter{Lists}
2            Linux provides simple doubly linked list implementation for various internal uses. The main header file is \url{include/linux/list.h}. The structure used to implement the list is \texttt{struct list\_head}. It is defined as:
3            \begin{verbatim}
4            struct list_head {
5                   struct list_head *next, *prev;
6            };
7            \end{verbatim}
8            The \texttt{list} member of the \texttt{struct page} is of the above type and is used to link up pages in various lists such as the per zone \textit{free\_list}.
9    
10            
11    \section{list\_entry}\label{mac:me}
12         \textit{Macro: }
13            \begin{verbatim}
14            #define list_entry(ptr, type, member) \
15            ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
16            \end{verbatim}
17            This macro is used to return the pointer to the structure being linked [remember, \textit{list} is a member of \texttt{struct page} and it is used to point to other list members and not the pages themselves].
18    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26