Address_map Class Reference
An Address_map is a generalized two-level hierarchical map of virtual addresses to some corresponding values.
More...
#include <addrmap.h>
Inherited by Block_map, Page_map, and Segment_map.
Inheritance diagram for Address_map:
[legend]List of all members.
Detailed Description
An Address_map is a generalized two-level hierarchical map of virtual addresses to some corresponding values.
Specific implementations of address maps include the page map (page directory and tables), the disk block map, etc. For a description of how this data structure works in a particular implementation, see section 5.2 (Page Translation) of the 80386 Programmer's Reference Manual.
An address map directory contains an entry for each address map table. For present (in-memory) tables, the directory entry is the page frame address of the table in virtual memory and various flags.
The disk directory of an address map contains an entry for each address map table. An entry is the block number of the table on disk. If the table is not yet on disk, the entry is zero.
The interpretation of the entries within the tables themselves is left up to specific implementations. Typical uses for the table entries is for them to contain virtual addresses, indexes, etc.
Member Function Documentation
| unsigned * Address_map::clear_table |
( |
unsigned * |
physical_table |
) |
|
|
|
|
Temporarily map a table and clear its memory.
This should be done before a table is used so that its entries are all properly invalidated (marked as non-present). Return the virtual address of the cleared table. It is the caller's responsibility to call unmap_temp_page() on the returned virtual address when done using it. |
| unsigned* Address_map::dir_entry_to_table |
( |
unsigned * |
dir_entry |
) |
[inline, static] |
|
|
|
Convert a directory entry into the physical table address it contains.
|
| unsigned* Address_map::dir_index_to_table |
( |
unsigned |
dir_index |
) |
[inline] |
|
|
|
Convert a directory index into the physical table address it contains.
|
| void Address_map::get_dirty_dir_entries |
( |
Array< unsigned * > & |
dirty_dir_entries |
) |
|
|
|
|
Get a list of dirty entries in the directory.
|
| unsigned * Address_map::get_table |
( |
unsigned |
dir_index |
) |
|
|
|
|
Given an index into the directory, return the corresponding table, loading it from disk if necessary.
It is the caller's responsibility to call unmap_temp_page() on the returned table when done using it. |
| unsigned Address_map::get_table_block_number |
( |
unsigned |
disk_dir_index |
) |
[inline] |
|
|
|
Get the disk block number for a particular table.
|
| unsigned Address_map::get_table_entry |
( |
void * |
virtual_addr |
) |
|
|
|
|
Return the value of the table entry corresponding to the given virtual address.
|
| void Address_map::init |
( |
|
) |
|
|
|
|
Allocate and zero the directory and disk directory.
|
| void Address_map::set_table_address |
( |
unsigned |
dir_index, |
|
|
unsigned * |
physical_table |
|
) |
[inline] |
|
|
|
Set the physical memory address for a particular table.
Mark the table as present and read-write. |
| void Address_map::set_table_block_number |
( |
unsigned |
disk_dir_index, |
|
|
unsigned |
block_number |
|
) |
[inline] |
|
|
|
Set the disk block number for a particular table, given an index into the disk_directory.
|
| bool Address_map::set_table_entry |
( |
void * |
virtual_addr, |
|
|
unsigned |
entry_value |
|
) |
|
|
|
|
Set the table entry corresponding to the given virtual address.
Return true if the entry was altered at all, and false otherwise. |
| void* Address_map::table_entry_to_virtual |
( |
unsigned * |
dir_entry, |
|
|
unsigned * |
physical_table, |
|
|
unsigned * |
physical_table_entry |
|
) |
[inline] |
|
|
|
Given a page directory entry and a physical page table, convert a physical page table entry into the virtual address it maps.
|
| unsigned* Address_map::virtual_to_dir_entry |
( |
void * |
virtual_addr |
) |
const [inline] |
|
|
|
Convert a virtual address to its corresponding directory entry.
The directory itself has the same virtual and physical address, so the entry returned is both virtual and physical as well. |
| unsigned Address_map::virtual_to_dir_index |
( |
void * |
virtual_addr |
) |
const [inline] |
|
|
|
Convert a virtual address to its corresponding directory index.
|
| unsigned * Address_map::virtual_to_table_entry |
( |
void * |
virtual_addr |
) |
|
|
|
|
Convert a virtual address to its corresponding table entry (without supplying the table).
It is the caller's responsibility to call unmap_temp_page() on the returned table entry when done using it, thereby freeing the temporarily mapped page containing it. |
| unsigned* Address_map::virtual_to_table_entry |
( |
void * |
virtual_addr, |
|
|
unsigned * |
table |
|
) |
[inline, static] |
|
|
|
Convert a virtual address to its corresponding table entry.
(Whether the entry is physical or virtual depends on the table supplied.) |
Member Data Documentation
|
|
has addrs of present tables
|
The documentation for this class was generated from the following files:
Torsion Operating System, Copyright
(C) 2000-2004 Dan Helfman