gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
MemState Class Reference

This class holds the memory state for the Process class and all of its derived, architecture-specific children. More...

#include <mem_state.hh>

Inheritance diagram for MemState:
Serializable

Public Member Functions

 MemState (Addr brk_point, Addr stack_base, Addr max_stack_size, Addr next_thread_stack_base, Addr mmap_end)
 
MemStateoperator= (const MemState &in)
 
Addr getBrkPoint () const
 
Addr getStackBase () const
 
Addr getStackSize () const
 
Addr getMaxStackSize () const
 
Addr getStackMin () const
 
Addr getNextThreadStackBase () const
 
Addr getMmapEnd () const
 
void setBrkPoint (Addr brk_point)
 
void setStackBase (Addr stack_base)
 
void setStackSize (Addr stack_size)
 
void setMaxStackSize (Addr max_stack)
 
void setStackMin (Addr stack_min)
 
void setNextThreadStackBase (Addr ntsb)
 
void setMmapEnd (Addr mmap_end)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Private Attributes

Addr _brkPoint
 
Addr _stackBase
 
Addr _stackSize
 
Addr _maxStackSize
 
Addr _stackMin
 
Addr _nextThreadStackBase
 
Addr _mmapEnd
 

Additional Inherited Members

- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 

Detailed Description

This class holds the memory state for the Process class and all of its derived, architecture-specific children.

The fields held in this class dynamically change as the process object is run in the simulator. They are updated by system calls and faults; each change represents a modification to the process address space. The stack, heap, and mmap boundaries are held with this class along with the base of the next thread stack.

The class is meant to be allocated dynamically and shared through a pointer interface because two process can potentially share their virtual address space if certain options are passed into the clone(2).

Definition at line 50 of file mem_state.hh.

Constructor & Destructor Documentation

◆ MemState()

MemState::MemState ( Addr  brk_point,
Addr  stack_base,
Addr  max_stack_size,
Addr  next_thread_stack_base,
Addr  mmap_end 
)
inline

Definition at line 53 of file mem_state.hh.

Member Function Documentation

◆ getBrkPoint()

Addr MemState::getBrkPoint ( ) const
inline

Definition at line 76 of file mem_state.hh.

References _brkPoint.

◆ getMaxStackSize()

Addr MemState::getMaxStackSize ( ) const
inline

Definition at line 79 of file mem_state.hh.

References _maxStackSize.

◆ getMmapEnd()

Addr MemState::getMmapEnd ( ) const
inline

Definition at line 82 of file mem_state.hh.

References _mmapEnd.

◆ getNextThreadStackBase()

Addr MemState::getNextThreadStackBase ( ) const
inline

Definition at line 81 of file mem_state.hh.

References _nextThreadStackBase.

◆ getStackBase()

Addr MemState::getStackBase ( ) const
inline

Definition at line 77 of file mem_state.hh.

References _stackBase.

◆ getStackMin()

Addr MemState::getStackMin ( ) const
inline

Definition at line 80 of file mem_state.hh.

References _stackMin.

◆ getStackSize()

Addr MemState::getStackSize ( ) const
inline

Definition at line 78 of file mem_state.hh.

References _stackSize.

◆ operator=()

MemState& MemState::operator= ( const MemState in)
inline

◆ serialize()

void MemState::serialize ( CheckpointOut cp) const
inlineoverridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 93 of file mem_state.hh.

References _brkPoint, _maxStackSize, _mmapEnd, _nextThreadStackBase, _stackBase, _stackMin, _stackSize, and paramOut().

◆ setBrkPoint()

void MemState::setBrkPoint ( Addr  brk_point)
inline

Definition at line 84 of file mem_state.hh.

References _brkPoint.

◆ setMaxStackSize()

void MemState::setMaxStackSize ( Addr  max_stack)
inline

Definition at line 87 of file mem_state.hh.

References _maxStackSize.

◆ setMmapEnd()

void MemState::setMmapEnd ( Addr  mmap_end)
inline

Definition at line 90 of file mem_state.hh.

References _mmapEnd.

◆ setNextThreadStackBase()

void MemState::setNextThreadStackBase ( Addr  ntsb)
inline

Definition at line 89 of file mem_state.hh.

References _nextThreadStackBase.

◆ setStackBase()

void MemState::setStackBase ( Addr  stack_base)
inline

Definition at line 85 of file mem_state.hh.

References _stackBase.

◆ setStackMin()

void MemState::setStackMin ( Addr  stack_min)
inline

Definition at line 88 of file mem_state.hh.

References _stackMin.

◆ setStackSize()

void MemState::setStackSize ( Addr  stack_size)
inline

Definition at line 86 of file mem_state.hh.

References _stackSize.

◆ unserialize()

void MemState::unserialize ( CheckpointIn cp)
inlineoverridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 104 of file mem_state.hh.

References _brkPoint, _maxStackSize, _mmapEnd, _nextThreadStackBase, _stackBase, _stackMin, _stackSize, and paramIn().

Member Data Documentation

◆ _brkPoint

Addr MemState::_brkPoint
private

Definition at line 116 of file mem_state.hh.

Referenced by getBrkPoint(), operator=(), serialize(), setBrkPoint(), and unserialize().

◆ _maxStackSize

Addr MemState::_maxStackSize
private

Definition at line 119 of file mem_state.hh.

Referenced by getMaxStackSize(), operator=(), serialize(), setMaxStackSize(), and unserialize().

◆ _mmapEnd

Addr MemState::_mmapEnd
private

Definition at line 122 of file mem_state.hh.

Referenced by getMmapEnd(), operator=(), serialize(), setMmapEnd(), and unserialize().

◆ _nextThreadStackBase

Addr MemState::_nextThreadStackBase
private

◆ _stackBase

Addr MemState::_stackBase
private

Definition at line 117 of file mem_state.hh.

Referenced by getStackBase(), operator=(), serialize(), setStackBase(), and unserialize().

◆ _stackMin

Addr MemState::_stackMin
private

Definition at line 120 of file mem_state.hh.

Referenced by getStackMin(), operator=(), serialize(), setStackMin(), and unserialize().

◆ _stackSize

Addr MemState::_stackSize
private

Definition at line 118 of file mem_state.hh.

Referenced by getStackSize(), operator=(), serialize(), setStackSize(), and unserialize().


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

Generated on Fri Feb 28 2020 16:27:13 for gem5 by doxygen 1.8.13