pintos/src/threads/vaddr.h File Reference

#include <debug.h>
#include <stdint.h>
#include <stdbool.h>
#include "threads/loader.h"

Go to the source code of this file.

Defines

#define BITMASK(SHIFT, CNT)   (((1ul << (CNT)) - 1) << (SHIFT))
#define PGSHIFT   0
#define PGBITS   12
#define PGSIZE   (1 << PGBITS)
#define PGMASK   BITMASK(PGSHIFT, PGBITS)
#define PHYS_BASE   ((void *) LOADER_PHYS_BASE)

Functions

static unsigned pg_ofs (const void *va)
static uintptr_t pg_no (const void *va)
static void * pg_round_up (const void *va)
static void * pg_round_down (const void *va)
static bool is_user_vaddr (const void *vaddr)
static bool is_kernel_vaddr (const void *vaddr)
static void * ptov (uintptr_t paddr)
static uintptr_t vtop (const void *vaddr)


Define Documentation

#define BITMASK ( SHIFT,
CNT   )     (((1ul << (CNT)) - 1) << (SHIFT))

Definition at line 16 of file vaddr.h.

#define PGBITS   12

Definition at line 20 of file vaddr.h.

Referenced by pg_no().

#define PGMASK   BITMASK(PGSHIFT, PGBITS)

#define PGSHIFT   0

Definition at line 19 of file vaddr.h.

#define PGSIZE   (1 << PGBITS)

#define PHYS_BASE   ((void *) LOADER_PHYS_BASE)


Function Documentation

static bool is_kernel_vaddr ( const void *  vaddr  )  [inline, static]

Definition at line 65 of file vaddr.h.

References PHYS_BASE.

Referenced by vtop().

static bool is_user_vaddr ( const void *  vaddr  )  [inline, static]

Definition at line 58 of file vaddr.h.

References PHYS_BASE.

Referenced by lookup_page(), pagedir_clear_page(), pagedir_get_page(), pagedir_set_page(), and validate_segment().

static uintptr_t pg_no ( const void *  va  )  [inline, static]

Definition at line 30 of file vaddr.h.

References PGBITS.

Referenced by page_from_pool(), palloc_free_multiple(), and uhci_tx_pkt().

static unsigned pg_ofs ( const void *  va  )  [inline, static]

static void* pg_round_down ( const void *  va  )  [inline, static]

Definition at line 40 of file vaddr.h.

References PGMASK.

Referenced by block_to_arena(), and running_thread().

static void* pg_round_up ( const void *  va  )  [inline, static]

Definition at line 35 of file vaddr.h.

References PGMASK, and PGSIZE.

static void* ptov ( uintptr_t  paddr  )  [inline, static]

static uintptr_t vtop ( const void *  vaddr  )  [inline, static]


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6