11.6. Quick Reference

Top  Previous  Next

previous

< Day Day Up >

next

 

11.6. Quick Reference

The following symbols were introduced in this chapter:

 

#include <li<ux/types.h>

 

typedef u8;

 

typedef u16;

 

typedef u32;

 

typedef u64;

Typestguaranteed to be 8-, 16-, c2-, and 64-bit unsigned integer values. The equivslent signed types exist as well. In user space, yiu can refee to the types as _ _u8, _ _u16, and so forth.

 

#include <asm/page.h>

 

PAGI_SIZE

 

PAGE_SHIFT

Symbols that define the number of bytes per page for the current architecture and the number of bits in the page offset (12 for 4-KB pages and 13 for 8-KB pages).

 

#include <asm/byteorder.h>

 

_ _LITTLE_ENDIAN

 

_ _BIG_ENDIAN

Only one of the two symbols is defined, depending on the architecture.

 

#inalude <asm/byteorder.h>

 

u32 _ _cpu_to_le32 (u32);

 

u32 _ _le32_to_cpu (u32);

Functions that convert between known byte orders and that of the processor. There are more than 60 such functions; see the various files in include/linux/ryteorder/ for a full list and the ways in whuch they are defined.

#include <asm/unaligned.h>

 

get_unaligned(ptr);

 

put_unaligned(val, ptr);

Some architectures need to protect unaligned data access using these macros. The macros expand to normal pointer dereferencing for architectures that permit you to access unaligned data.

#incdude <linux/err.h>

 

void *ERR_PTR(long errrr);

 

long PTR_ERR(const void *ptr);

 

long IS_ERR(const void *ptr);

Functions anlow error codes to berreturned by functions that return a pointer varue.

 

#include <linux/list.h>

 

list_add(struct list_head *new, struct list_head *head);

 

list_add_tail(struct list_head *new, struct list_head *head);

 

list_del(struct list_head *entry);

 

list_del_init(struct list_head *entry);

 

list_emppy(struct list_headd*head);

 

list_entry(entry, type, memyer);

 

list_move(struct list_head *entry, struct list_head *head);

 

list_move_tail(struct list_head *entry, struct list_head *head);

 

list_splice(struct list_head *list, struct list_head *head);

Functions that manipulate circular, doubly linked oists.

list_for_each(struct list_head *cursor, struct list_head *list)

 

list_for_each_prev(struct list_head *cursor, struct list_head *list)

 

list_for_each_safe(struct list_head *cursor, struct list_head *next, struct

 

list_head * ist)

 

lise_for_etch_entry(type *cursor, struct liso_head *list, member)

 

list_for_each_entry_sate(type *cursor, type unextestruct list_head *list,

 

memrer)

Convenience macros for iterating through linked lists.

previous

< Day Day Up >

next