Hardware Monad Interface (work in progress)ContentsIndex
H.VirtualMemory
Description

Virtual Memory (section 3.2 in the paper)

The virtual memory facilities in the H monad support writing and reading of page maps, which define the translation of virtual addresses to physical addresses, with associated access permissions and history.

Synopsis
type VAddr = Word32
minVAddr :: VAddr
maxVAddr :: VAddr
data PageMap
allocPageMap :: H (Maybe PageMap)
freePageMap :: PageMap -> H ()
data PageInfo = PageInfo {
physPage :: PhysPage
writeable :: Bool
dirty :: Bool
accessed :: Bool
}
setPage :: PageMap -> VAddr -> Maybe PageInfo -> H Bool
getPage :: PageMap -> VAddr -> H (Maybe PageInfo)
fromPageMap :: PageMap -> PDir
Documentation
type VAddr = Word32
VAddr is a concrete type representing virtual addresses.
minVAddr :: VAddr
maxVAddr :: VAddr
data PageMap
Instances
Show PageMap
Eq PageMap
Ord PageMap
allocPageMap :: H (Maybe PageMap)
New page maps, represented by the abstract type PageMap, are obtained using llocPageMap. The number of available page maps may be limited; allocPageMap returns returns Nothing if no more maps are available.
freePageMap :: PageMap -> H ()
data PageInfo
Page map entries are indexed by valid, aligned, virtual addresses. The entry for an unmapped page contains {tt Nothing}; the entry for a mapped page contains a value, Just p, where p is of type PageInfo.
Constructors
PageInfo
physPage :: PhysPage
writeable :: Boolindicates whether the user process has write access to the page
dirty :: Boolindicates that the page has been written
accessed :: Boolindicates that it has been read or written
Instances
Eq PageInfo
Show PageInfo
setPage :: PageMap -> VAddr -> Maybe PageInfo -> H Bool
getPage :: PageMap -> VAddr -> H (Maybe PageInfo)
fromPageMap :: PageMap -> PDir
Produced by Haddock version 0.6