Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mkregtable.c File Reference
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <regex.h>
#include <libgen.h>

Go to the source code of this file.

Data Structures

struct  list_head
 
struct  offset
 
struct  table
 

Macros

#define offsetof(TYPE, MEMBER)   ((size_t) &((TYPE *)0)->MEMBER)
 
#define container_of(ptr, type, member)
 
#define LIST_HEAD_INIT(name)   { &(name), &(name) }
 
#define LIST_HEAD(name)   struct list_head name = LIST_HEAD_INIT(name)
 
#define list_entry(ptr, type, member)   container_of(ptr, type, member)
 
#define list_first_entry(ptr, type, member)   list_entry((ptr)->next, type, member)
 
#define list_for_each(pos, head)
 
#define __list_for_each(pos, head)   for (pos = (head)->next; pos != (head); pos = pos->next)
 
#define list_for_each_prev(pos, head)
 
#define list_for_each_safe(pos, n, head)
 
#define list_for_each_prev_safe(pos, n, head)
 
#define list_for_each_entry(pos, head, member)
 
#define list_for_each_entry_reverse(pos, head, member)
 
#define list_prepare_entry(pos, head, member)   ((pos) ? : list_entry(head, typeof(*pos), member))
 
#define list_for_each_entry_continue(pos, head, member)
 
#define list_for_each_entry_continue_reverse(pos, head, member)
 
#define list_for_each_entry_from(pos, head, member)
 
#define list_for_each_entry_safe(pos, n, head, member)
 
#define list_for_each_entry_safe_continue(pos, n, head, member)
 
#define list_for_each_entry_safe_from(pos, n, head, member)
 
#define list_for_each_entry_safe_reverse(pos, n, head, member)
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

#define __list_for_each (   pos,
  head 
)    for (pos = (head)->next; pos != (head); pos = pos->next)

__list_for_each - iterate over a list : the &struct list_head to use as a loop cursor. : the head for your list.

This variant differs from list_for_each() in that it's the simplest possible list iteration code, no prefetching is done. Use this for code that knows the list to be very short (empty or 1 entry) most of the time.

Definition at line 385 of file mkregtable.c.

#define container_of (   ptr,
  type,
  member 
)
Value:
({ \
const typeof(((type *)0)->member)*__mptr = (ptr); \
(type *)((char *)__mptr - offsetof(type, member)); })

container_of - cast a member of a structure out to the containing structure : the pointer to the member. : the type of the container struct this is embedded in. : the name of the member within the struct.

Definition at line 27 of file mkregtable.c.

#define list_entry (   ptr,
  type,
  member 
)    container_of(ptr, type, member)

list_entry - get the struct for this entry : the &struct list_head pointer. : the type of the struct this is embedded in. : the name of the list_struct within the struct.

Definition at line 352 of file mkregtable.c.

#define list_first_entry (   ptr,
  type,
  member 
)    list_entry((ptr)->next, type, member)

list_first_entry - get the first element from a list : the list head to take the element from. : the type of the struct this is embedded in. : the name of the list_struct within the struct.

Note, that list is expected to be not empty.

Definition at line 363 of file mkregtable.c.

#define list_for_each (   pos,
  head 
)
Value:
for (pos = (head)->next; prefetch(pos->next), pos != (head); \
pos = pos->next)

list_for_each - iterate over a list : the &struct list_head to use as a loop cursor. : the head for your list.

Definition at line 371 of file mkregtable.c.

#define list_for_each_entry (   pos,
  head,
  member 
)
Value:
for (pos = list_entry((head)->next, typeof(*pos), member); \
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))

list_for_each_entry - iterate over list of given type : the type * to use as a loop cursor. : the head for your list. : the name of the list_struct within the struct.

Definition at line 424 of file mkregtable.c.

#define list_for_each_entry_continue (   pos,
  head,
  member 
)
Value:
for (pos = list_entry(pos->member.next, typeof(*pos), member); \
prefetch(pos->member.next), &pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))

list_for_each_entry_continue - continue iteration over list of given type : the type * to use as a loop cursor. : the head for your list. : the name of the list_struct within the struct.

Continue to iterate over list of given type, continuing after the current position.

Definition at line 460 of file mkregtable.c.

#define list_for_each_entry_continue_reverse (   pos,
  head,
  member 
)
Value:
for (pos = list_entry(pos->member.prev, typeof(*pos), member); \
prefetch(pos->member.prev), &pos->member != (head); \
pos = list_entry(pos->member.prev, typeof(*pos), member))

list_for_each_entry_continue_reverse - iterate backwards from the given point : the type * to use as a loop cursor. : the head for your list. : the name of the list_struct within the struct.

Start to iterate over list of given type backwards, continuing after the current position.

Definition at line 474 of file mkregtable.c.

#define list_for_each_entry_from (   pos,
  head,
  member 
)
Value:
for (; prefetch(pos->member.next), &pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))

list_for_each_entry_from - iterate over list of given type from the current point : the type * to use as a loop cursor. : the head for your list. : the name of the list_struct within the struct.

Iterate over list of given type, continuing from current position.

Definition at line 487 of file mkregtable.c.

#define list_for_each_entry_reverse (   pos,
  head,
  member 
)
Value:
for (pos = list_entry((head)->prev, typeof(*pos), member); \
prefetch(pos->member.prev), &pos->member != (head); \
pos = list_entry(pos->member.prev, typeof(*pos), member))

list_for_each_entry_reverse - iterate backwards over list of given type. : the type * to use as a loop cursor. : the head for your list. : the name of the list_struct within the struct.

Definition at line 435 of file mkregtable.c.

#define list_for_each_entry_safe (   pos,
  n,
  head,
  member 
)
Value:
for (pos = list_entry((head)->next, typeof(*pos), member), \
n = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))

list_for_each_entry_safe - iterate over list of given type safe against removal of list entry : the type * to use as a loop cursor.
: another type * to use as temporary storage : the head for your list. : the name of the list_struct within the struct.

Definition at line 498 of file mkregtable.c.

#define list_for_each_entry_safe_continue (   pos,
  n,
  head,
  member 
)
Value:
for (pos = list_entry(pos->member.next, typeof(*pos), member), \
n = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))

list_for_each_entry_safe_continue : the type * to use as a loop cursor.
: another type * to use as temporary storage : the head for your list. : the name of the list_struct within the struct.

Iterate over list of given type, continuing after current point, safe against removal of list entry.

Definition at line 514 of file mkregtable.c.

#define list_for_each_entry_safe_from (   pos,
  n,
  head,
  member 
)
Value:
for (n = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))

list_for_each_entry_safe_from : the type * to use as a loop cursor.
: another type * to use as temporary storage : the head for your list. : the name of the list_struct within the struct.

Iterate over list of given type from current point, safe against removal of list entry.

Definition at line 530 of file mkregtable.c.

#define list_for_each_entry_safe_reverse (   pos,
  n,
  head,
  member 
)
Value:
for (pos = list_entry((head)->prev, typeof(*pos), member), \
n = list_entry(pos->member.prev, typeof(*pos), member); \
&pos->member != (head); \
pos = n, n = list_entry(n->member.prev, typeof(*n), member))

list_for_each_entry_safe_reverse : the type * to use as a loop cursor.
: another type * to use as temporary storage : the head for your list. : the name of the list_struct within the struct.

Iterate backwards over list of given type, safe against removal of list entry.

Definition at line 545 of file mkregtable.c.

#define list_for_each_prev (   pos,
  head 
)
Value:
for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
pos = pos->prev)

list_for_each_prev - iterate over a list backwards : the &struct list_head to use as a loop cursor. : the head for your list.

Definition at line 393 of file mkregtable.c.

#define list_for_each_prev_safe (   pos,
  n,
  head 
)
Value:
for (pos = (head)->prev, n = pos->prev; \
prefetch(pos->prev), pos != (head); \
pos = n, n = pos->prev)

list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry : the &struct list_head to use as a loop cursor.
: another &struct list_head to use as temporary storage : the head for your list.

Definition at line 413 of file mkregtable.c.

#define list_for_each_safe (   pos,
  n,
  head 
)
Value:
for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, n = pos->next)

list_for_each_safe - iterate over a list safe against removal of list entry : the &struct list_head to use as a loop cursor.
: another &struct list_head to use as temporary storage : the head for your list.

Definition at line 403 of file mkregtable.c.

#define LIST_HEAD (   name)    struct list_head name = LIST_HEAD_INIT(name)

Definition at line 47 of file mkregtable.c.

#define LIST_HEAD_INIT (   name)    { &(name), &(name) }

Definition at line 45 of file mkregtable.c.

#define list_prepare_entry (   pos,
  head,
  member 
)    ((pos) ? : list_entry(head, typeof(*pos), member))

list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() : the type * to use as a start point : the head of the list : the name of the list_struct within the struct.

Prepares a pos entry for use as a start point in list_for_each_entry_continue().

Definition at line 448 of file mkregtable.c.

#define offsetof (   TYPE,
  MEMBER 
)    ((size_t) &((TYPE *)0)->MEMBER)

Definition at line 19 of file mkregtable.c.

Function Documentation

int main ( int  argc,
char argv[] 
)

Definition at line 710 of file mkregtable.c.