19.02.2013 Views

Module I-7410 Advanced Linux Kernel Data Structures

Module I-7410 Advanced Linux Kernel Data Structures

Module I-7410 Advanced Linux Kernel Data Structures

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Bern University of Applied Sciences<br />

School of Information Technology TI<br />

Introduction to <strong>Linux</strong> <strong>Kernel</strong> <strong>Data</strong> <strong>Structures</strong><br />

<strong>Kernel</strong> List Macros (3)<br />

<strong>Module</strong>: <strong>Advanced</strong> <strong>Linux</strong><br />

FS-2012<br />

Example: Build a LIFO list (stack) and a FIFO list (queue)<br />

<strong>Data</strong> <strong>Structures</strong> and variables<br />

struct list_el { /* a list element */<br />

int id; /* a field */<br />

struct list_head link; /* the link field */<br />

}<br />

LIST_HEAD(hdr_lifo); /*define LIFO list header*/<br />

LIST_HEAD(hdr_fifo); /*define FIFO list header*/<br />

/* define some list elements */<br />

struct list_el lifo1, lifo2, fifo1, fifo2;<br />

V1.4 © 2012 by franz.meyer@bfh.ch Slide-8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!