Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Kmem Class Reference

The system's base facilities for kernel-memory management. More...

#include <kmem.h>

List of all members.

Public Types

enum  { mem_tcbs = Mem_layout::Tcbs, mem_user_max = Mem_layout::User_max }

Static Public Member Functions

static void init ()
static Mword is_kmem_page_fault (Mword pfa, Mword error)
static Mword is_ipc_page_fault (Mword pfa, Mword error)
static Mword is_smas_page_fault (Mword pfa)
static Mword is_io_bitmap_page_fault (Mword pfa)
static Address kcode_start ()
static Address kcode_end ()
static Address kmem_base ()
static Address virt_to_phys (const void *addr)
 Compute physical address from a kernel-virtual address.
static Mword is_tcb_page_fault (Address addr, Mword)
static const Pdirdir ()
 Return Global page directory.
static Address get_mem_max ()
static Address himem ()
static Address volatile * kernel_esp ()
 Get a pointer to the CPUs kernel stack pointer.
static void * phys_to_virt (Address addr)
 Compute a kernel-virtual address for a physical address.
static void dir_init (Pdir *d)
 Initialize a new task's page directory from the current master copy of kernel page tables (the global page directory).
static Address ipc_window (unsigned win)
 Return virtual address of an IPC window.
static Address io_bitmap_delimiter_page ()
static void map_devpage_4k (Address phys, Address virt, bool cached, bool global, Address *offs=0)

Static Protected Member Functions

static Pdir *kdir asm ("KMEM_KDIR")
 Kernel page directory.

Private Member Functions

 Kmem ()
 Kmem (const Kmem &)

Static Private Member Functions

static Address user_max ()
static Address alloc_from_page (Address *from, Address size)
 Allocate some bytes from a memory page.
static FIASCO_INIT Address himem_alloc ()

Static Private Attributes

static Address mem_max
static Address _himem
static Unsigned8 * io_bitmap_delimiter

Friends

class Jdb
class Jdb_dbinfo
class Jdb_kern_info_misc
class Kdb
class Profile
class Vmem_alloc


Detailed Description

The system's base facilities for kernel-memory management.

The kernel memory is a singleton object. We access it through a static class interface.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
mem_tcbs 
mem_user_max 


Constructor & Destructor Documentation

Kmem::Kmem  )  [private]
 

Kmem::Kmem const Kmem  )  [private]
 


Member Function Documentation

Address Kmem::alloc_from_page Address *  from,
Address  size
[inline, static, private]
 

Allocate some bytes from a memory page.

static Pdir* kdir Kmem::asm "KMEM_KDIR"   )  [static, protected]
 

Kernel page directory.

const Pdir * Kmem::dir  )  [inline, static]
 

Return Global page directory.

This is the master copy of the kernel's page directory. Kernel-memory allocations are kept here and copied to task page directories lazily upon page fault.

Returns:
kernel's global page directory

void Kmem::dir_init Pdir d  )  [static]
 

Initialize a new task's page directory from the current master copy of kernel page tables (the global page directory).

Parameters:
d pointer to first entry of new page directory

Address Kmem::get_mem_max  )  [inline, static]
 

Address Kmem::himem  )  [inline, static]
 

FIASCO_INIT Address Kmem::himem_alloc  )  [static, private]
 

FIASCO_INIT void Kmem::init  )  [static]
 

Address Kmem::io_bitmap_delimiter_page  )  [inline, static]
 

Address Kmem::ipc_window unsigned  win  )  [inline, static]
 

Return virtual address of an IPC window.

Parameters:
win number of IPC window (0 or 1)
Returns:
IPC window's virtual address

static Mword Kmem::is_io_bitmap_page_fault Mword  pfa  )  [static]
 

static Mword Kmem::is_ipc_page_fault Mword  pfa,
Mword  error
[static]
 

static Mword Kmem::is_kmem_page_fault Mword  pfa,
Mword  error
[static]
 

static Mword Kmem::is_smas_page_fault Mword  pfa  )  [static]
 

Mword Kmem::is_tcb_page_fault Address  addr,
Mword 
[inline, static]
 

Address Kmem::kcode_end  )  [inline, static]
 

Address Kmem::kcode_start  )  [inline, static]
 

Address volatile * Kmem::kernel_esp  )  [inline, static]
 

Get a pointer to the CPUs kernel stack pointer.

Address Kmem::kmem_base  )  [static]
 

void Kmem::map_devpage_4k Address  phys,
Address  virt,
bool  cached,
bool  global,
Address *  offs = 0
[static]
 

void * Kmem::phys_to_virt Address  addr  )  [inline, static]
 

Compute a kernel-virtual address for a physical address.

This function always returns virtual addresses within the physical-memory region.

Precondition:
addr <= highest kernel-accessible RAM address
Parameters:
addr a physical address
Returns:
kernel-virtual address.

Address Kmem::user_max  )  [inline, static, private]
 

Address Kmem::virt_to_phys const void *  addr  )  [inline, static]
 

Compute physical address from a kernel-virtual address.

Parameters:
addr a virtual address
Returns:
corresponding physical address if a mappings exists. -1 otherwise.


Friends And Related Function Documentation

friend class Jdb [friend]
 

friend class Jdb_dbinfo [friend]
 

friend class Jdb_kern_info_misc [friend]
 

friend class Kdb [friend]
 

friend class Profile [friend]
 

friend class Vmem_alloc [friend]
 


Member Data Documentation

Address Kmem::_himem [static, private]
 

Unsigned8 * Kmem::io_bitmap_delimiter [static, private]
 

Address Kmem::mem_max [static, private]
 


The documentation for this class was generated from the following files:
Generated on Mon Sep 26 14:20:16 2005 for Fiasco by  doxygen 1.4.2