#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 BITMASK | ( | SHIFT, | |||
CNT | ) | (((1ul << (CNT)) - 1) << (SHIFT)) |
#define PGMASK BITMASK(PGSHIFT, PGBITS) |
Definition at line 22 of file vaddr.h.
Referenced by load(), pci_alloc_mem(), pci_setup_io(), pg_ofs(), pg_round_down(), pg_round_up(), and validate_segment().
#define PGSIZE (1 << PGBITS) |
Definition at line 21 of file vaddr.h.
Referenced by block_size(), fsutil_cat(), init_pool(), init_thread(), load(), load_segment(), main(), malloc(), malloc_init(), msc_attached(), pagedir_create(), pagedir_destroy(), paging_init(), palloc_free_multiple(), palloc_get_multiple(), palloc_init(), pci_alloc_mem(), pci_setup_io(), pg_round_up(), print_stacktrace(), process_execute(), setup_stack(), tss_update(), uhci_create_info(), and validate_segment().
#define PHYS_BASE ((void *) LOADER_PHYS_BASE) |
Definition at line 54 of file vaddr.h.
Referenced by consume_some_resources_and_die(), is_kernel_vaddr(), is_user_vaddr(), pagedir_destroy(), ptov(), setup_stack(), and vtop().
static bool is_kernel_vaddr | ( | const void * | vaddr | ) | [inline, static] |
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] |
Definition at line 25 of file vaddr.h.
References PGMASK.
Referenced by block_size(), block_to_arena(), load_segment(), pagedir_clear_page(), pagedir_get_page(), pagedir_set_page(), palloc_free_multiple(), pde_create_kernel(), pde_create_user(), pte_create_kernel(), and pte_create_user().
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] |
static void* ptov | ( | uintptr_t | paddr | ) | [inline, static] |
Definition at line 73 of file vaddr.h.
References ASSERT, and PHYS_BASE.
Referenced by active_pd(), dump_qh(), init(), paging_init(), palloc_init(), pci_alloc_mem(), pde_get_pt(), pte_get_page(), read_command_line(), uhci_add_td_to_qh(), uhci_remove_error_td(), and uhci_remove_qh().
static uintptr_t vtop | ( | const void * | vaddr | ) | [inline, static] |
Definition at line 83 of file vaddr.h.
References ASSERT, is_kernel_vaddr(), and PHYS_BASE.
Referenced by dump_all_qh(), dump_qh(), pagedir_activate(), pagedir_set_page(), paging_init(), pde_create_kernel(), pde_create_user(), pte_create_kernel(), pte_create_user(), uhci_add_td_to_qh(), uhci_create_chan(), uhci_init(), uhci_remove_error_td(), uhci_remove_qh(), and uhci_setup_td().