Loading...
Searching...
No Matches
vspace.h File Reference
`#include "kernel/mod2.h"`
`#include <fcntl.h>`
`#include <cstdio>`
`#include <cstring>`
`#include <assert.h>`
`#include <new>`

Go to the source code of this file.

## Data Structures

struct | vspace::Result< T >
struct | vspace::Status
class | vspace::internals::FastLock
struct | vspace::internals::ProcessInfo
struct | vspace::internals::MetaPage
struct | vspace::internals::ProcessChannel
struct | vspace::internals::Block
struct | vspace::internals::VSeg
struct | vspace::internals::VMem
struct | vspace::internals::refcount_t
class | vspace::internals::Mutex
struct | vspace::VRef< T >
struct | vspace::VRef< void >
struct | vspace::ZRef< T >
struct | vspace::ZRef< T >::RefCounted
class | vspace::VString
class | vspace::VMap< Spec >
struct | vspace::VMap< Spec >::Node
struct | vspace::DictSpec
class | vspace::Semaphore
class | vspace::Queue< T >
struct | vspace::Queue< T >::Node
class | vspace::SyncVar< T >
class | vspace::Event
class | vspace::EventSet
class | vspace::WaitSemaphoreEvent
class | vspace::EnqueueEvent< T >
class | vspace::DequeueEvent< T >
class | vspace::SyncReadEvent< T >

## Namespaces

namespace | vspace
namespace | vspace::internals

## Typedefs

typedef size_t | vspace::internals::segaddr_t
typedef size_t | vspace::internals::vaddr_t
typedef int | vspace::internals::ipc_signal_t
typedef VMap< DictSpec > | vspace::VDict
typedef internals::Mutex | vspace::FastLock
typedef internals::Mutex | vspace::Mutex

## Enumerations

enum | vspace::ErrCode { vspace::ErrNone , vspace::ErrGeneral , vspace::ErrFile , vspace::ErrMMap , vspace::ErrOS }
enum | vspace::internals::SignalState { vspace::internals::Waiting = 0 , vspace::internals::Pending = 1 , vspace::internals::Accepted = 2 }

## Functions

void | vspace::internals::init_flock_struct (struct flock &lock_info, size_t offset, size_t len, bool lock)
void | vspace::internals::lock_file (int fd, size_t offset, size_t len)
void | vspace::internals::unlock_file (int fd, size_t offset, size_t len)
void | vspace::internals::lock_metapage ()
void | vspace::internals::unlock_metapage ()
void | vspace::internals::init_metapage (bool create)
bool | vspace::internals::send_signal (int processno, ipc_signal_t sig, bool lock)
ipc_signal_t | vspace::internals::check_signal (bool resume, bool lock)
void | vspace::internals::accept_signals ()
ipc_signal_t | vspace::internals::wait_signal (bool lock)
void | vspace::internals::drop_pending_signals ()
Block * | vspace::internals::block_ptr (vaddr_t vaddr)
static int | vspace::internals::find_level (size_t size)
static segaddr_t | vspace::internals::find_buddy (segaddr_t addr, int level)
void | vspace::internals::vmem_free (vaddr_t vaddr)
vaddr_t | vspace::internals::vmem_alloc (size_t size)
static vaddr_t | vspace::internals::allocated_ptr_to_vaddr (void *ptr)
static Status | vspace::vmem_init ()
static void | vspace::vmem_deinit ()
template<typename T>
VRef< T > | vspace::vnull ()
template<typename T>
VRef< T > | vspace::vnew ()
template<typename T>
VRef< T > | vspace::vnew_uninitialized ()
template<typename T>
VRef< T > | vspace::vnew_array (size_t n)
template<typename T>
VRef< T > | vspace::vnew_uninitialized_array (size_t n)
template<typename T, typename Arg>
VRef< T > | vspace::vnew (Arg arg)
template<typename T, typename Arg1, typename Arg2>
VRef< T > | vspace::vnew (Arg1 arg1, Arg2 arg2)
template<typename T, typename Arg1, typename Arg2, typename Arg3>
VRef< T > | vspace::vnew (Arg1 arg1, Arg2 arg2, Arg3 arg3)
template<typename T, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
VRef< T > | vspace::vnew (Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4)
template<typename T, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
VRef< T > | vspace::vnew (Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5)
template<typename T>
ZRef< T > | vspace::znull ()
template<typename T>
ZRef< T > | vspace::znew ()
template<typename T>
ZRef< T > | vspace::znew_uninitialized ()
template<typename T>
ZRef< T > | vspace::znew_array (size_t n)
template<typename T>
ZRef< T > | vspace::znew_uninitialized_array (size_t n)
template<typename T, typename Arg>
ZRef< T > | vspace::znew (Arg arg)
template<typename T, typename Arg1, typename Arg2>
ZRef< T > | vspace::znew (Arg1 arg1, Arg2 arg2)
template<typename T, typename Arg1, typename Arg2, typename Arg3>
ZRef< T > | vspace::znew (Arg1 arg1, Arg2 arg2, Arg3 arg3)
static VRef< VString > | vspace::vstring (const char *s)
static VRef< VString > | vspace::vstring (const char *s, size_t len)
static VRef< VString > | vspace::vstring (size_t len)
pid_t | vspace::fork_process ()

## Variables

const segaddr_t | vspace::internals::SEGADDR_NULL = ~(segaddr_t) 0
const vaddr_t | vspace::internals::VADDR_NULL = ~(segaddr_t) 0
static const int | vspace::internals::MAX_PROCESS = 64
static const size_t | vspace::internals::METABLOCK_SIZE = 128 * 1024
static const int | vspace::internals::LOG2_SEGMENT_SIZE = 28
static const int | vspace::internals::LOG2_MAX_SEGMENTS = 10
static const size_t | vspace::internals::MAX_SEGMENTS = 1 << LOG2_MAX_SEGMENTS
static const size_t | vspace::internals::SEGMENT_SIZE = 1 << LOG2_SEGMENT_SIZE
static const size_t | vspace::internals::SEGMENT_MASK = (SEGMENT_SIZE - 1)
static VMem & | vspace::internals::vmem = VMem::vmem_global

## Data Structure Documentation

## vspace::internals::ProcessInfo

struct vspace::internals::ProcessInfo

Definition at line 1499 of file vspace.h.

Data Fields
pid_t | pid |
ipc_signal_t | signal |
SignalState | sigstate |

## vspace::internals::MetaPage

struct vspace::internals::MetaPage

Definition at line 1508 of file vspace.h.

Data Fields
FastLock | allocator_lock |
size_t | config_header[4] |
vaddr_t | freelist[LOG2_SEGMENT_SIZE+1] |
ProcessInfo | process_info[MAX_PROCESS] |
int | segment_count |

## vspace::internals::ProcessChannel

struct vspace::internals::ProcessChannel

Definition at line 1525 of file vspace.h.

Data Fields
int | fd_read |
int | fd_write |

## vspace::VMap::Node

struct vspace::VMap::Node

template<typename Spec>
struct vspace::VMap< Spec >::Node

Definition at line 2119 of file vspace.h.

Data Fields
size_t | hash |
VRef< K > | key |
VRef< Node > | next |
VRef< V > | value |

## vspace::Queue::Node

struct vspace::Queue::Node

template<typename T>
struct vspace::Queue< T >::Node

Definition at line 2382 of file vspace.h.

Data Fields
T | data |
VRef< Node > | next |