My Project
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
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.

1543 {
1544 return (prev & 3) != 1;
1545 }

◆ level()

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

Definition at line 1546 of file vspace.h.

1546 {
1547 if (is_free())
1548 return (int) data[0];
1549 else
1550 return (int) (prev >> (LOG2_MAX_SEGMENTS + 2));
1551 }
static const int LOG2_MAX_SEGMENTS
Definition: vspace.h:1422

◆ mark_as_allocated()

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

Definition at line 1552 of file vspace.h.

1552 {
1553 vaddr_t bits = level;
1554 bits <<= LOG2_MAX_SEGMENTS;
1555 bits |= vaddr >> LOG2_SEGMENT_SIZE;
1556 bits <<= 2;
1557 bits |= 1;
1558 prev = bits;
1559 next = 0;
1560 }
size_t vaddr_t
Definition: vspace.h:1414
static const int LOG2_SEGMENT_SIZE
Definition: vspace.h:1421

◆ mark_as_free()

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

Definition at line 1561 of file vspace.h.

1561 {
1562 data[0] = level;
1563 }

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: