Loading...
Searching...
No Matches
vspace::internals::Block Struct Reference

`#include <vspace.h>`

## Public Member Functions

bool | is_free ()
int | level ()
void | mark_as_allocated (vaddr_t vaddr, int level)
void | mark_as_free (int level)

## Data Fields

vaddr_t | prev
vaddr_t | next
size_t | data [1]

## Detailed Description

Definition at line 1529 of file vspace.h.

## Member Function Documentation

## is_free()

bool vspace::internals::Block::is_free | ( |  | ) |

inline

Definition at line 1543 of file vspace.h.

{
return (prev & 3) != 1;
}
vspace::internals::Block::prev
vaddr_t prev
Definition vspace.h:1540

## level()

int vspace::internals::Block::level | ( |  | ) |

inline

Definition at line 1546 of file vspace.h.

{
if (is_free())
return (int) data[0];
else
return (int) (prev >> (LOG2_MAX_SEGMENTS + 2));
}
vspace::internals::LOG2_MAX_SEGMENTS
static const int LOG2_MAX_SEGMENTS
Definition vspace.h:1422
vspace::internals::Block::is_free
bool is_free()
Definition vspace.h:1543
vspace::internals::Block::data
size_t data[1]
Definition vspace.h:1542

## mark_as_allocated()

void vspace::internals::Block::mark_as_allocated | ( | vaddr_t | vaddr,
|  | int | level )

inline

Definition at line 1552 of file vspace.h.

{
vaddr_t bits = level;
bits <<= LOG2_MAX_SEGMENTS;
bits |= vaddr >> LOG2_SEGMENT_SIZE;
bits <<= 2;
bits |= 1;
prev = bits;
next = 0;
}
vspace::internals::vaddr_t
size_t vaddr_t
Definition vspace.h:1414
vspace::internals::LOG2_SEGMENT_SIZE
static const int LOG2_SEGMENT_SIZE
Definition vspace.h:1421
vspace::internals::Block::next
vaddr_t next
Definition vspace.h:1541
vspace::internals::Block::level
int level()
Definition vspace.h:1546

## mark_as_free()

void vspace::internals::Block::mark_as_free | ( | int | level | ) |

inline

Definition at line 1561 of file vspace.h.

{
data[0] = level;
}

## Field Documentation

## data

size_t vspace::internals::Block::data[1]

Definition at line 1542 of file vspace.h.

## next

vaddr_t vspace::internals::Block::next

Definition at line 1541 of file vspace.h.

## prev

vaddr_t vspace::internals::Block::prev

Definition at line 1540 of file vspace.h.

The documentation for this struct was generated from the following file:

- kernel/oswrapper/vspace.h