gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mem_state.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Advanced Micro Devices, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * Author: Brandon Potter
29  */
30 
31 #ifndef SRC_SIM_MEM_STATE_HH
32 #define SRC_SIM_MEM_STATE_HH
33 
48 class MemState
49 {
50  public:
51  MemState(Addr brk_point, Addr stack_base, Addr max_stack_size,
52  Addr next_thread_stack_base, Addr mmap_end)
53  : _brkPoint(brk_point), _stackBase(stack_base), _stackSize(0),
54  _maxStackSize(max_stack_size), _stackMin(0),
55  _nextThreadStackBase(next_thread_stack_base), _mmapEnd(mmap_end)
56  { }
57 
58  MemState&
59  operator=(const MemState &in)
60  {
61  if (this == &in)
62  return *this;
63 
64  _brkPoint = in._brkPoint;
68  _stackMin = in._stackMin;
70  _mmapEnd = in._mmapEnd;
71  return *this;
72  }
73 
74  Addr getBrkPoint() const { return _brkPoint; }
75  Addr getStackBase() const { return _stackBase; }
76  Addr getStackSize() const { return _stackSize; }
77  Addr getMaxStackSize() const { return _maxStackSize; }
78  Addr getStackMin() const { return _stackMin; }
80  Addr getMmapEnd() const { return _mmapEnd; }
81 
82  void setBrkPoint(Addr brk_point) { _brkPoint = brk_point; }
83  void setStackBase(Addr stack_base) { _stackBase = stack_base; }
84  void setStackSize(Addr stack_size) { _stackSize = stack_size; }
85  void setMaxStackSize(Addr max_stack) { _maxStackSize = max_stack; }
86  void setStackMin(Addr stack_min) { _stackMin = stack_min; }
88  void setMmapEnd(Addr mmap_end) { _mmapEnd = mmap_end; }
89 
90  private:
98 };
99 
100 #endif
Addr getMmapEnd() const
Definition: mem_state.hh:80
void setBrkPoint(Addr brk_point)
Definition: mem_state.hh:82
Addr getStackMin() const
Definition: mem_state.hh:78
Addr getStackBase() const
Definition: mem_state.hh:75
Addr _stackBase
Definition: mem_state.hh:92
void setMaxStackSize(Addr max_stack)
Definition: mem_state.hh:85
MemState & operator=(const MemState &in)
Definition: mem_state.hh:59
Addr _stackMin
Definition: mem_state.hh:95
void setStackBase(Addr stack_base)
Definition: mem_state.hh:83
Addr _stackSize
Definition: mem_state.hh:93
Addr getMaxStackSize() const
Definition: mem_state.hh:77
void setMmapEnd(Addr mmap_end)
Definition: mem_state.hh:88
Addr getNextThreadStackBase() const
Definition: mem_state.hh:79
Addr _nextThreadStackBase
Definition: mem_state.hh:96
Addr _brkPoint
Definition: mem_state.hh:91
Addr _mmapEnd
Definition: mem_state.hh:97
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
This class holds the memory state for the Process class and all of its derived, architecture-specific...
Definition: mem_state.hh:48
void setNextThreadStackBase(Addr ntsb)
Definition: mem_state.hh:87
Addr _maxStackSize
Definition: mem_state.hh:94
void setStackMin(Addr stack_min)
Definition: mem_state.hh:86
void setStackSize(Addr stack_size)
Definition: mem_state.hh:84
Addr getBrkPoint() const
Definition: mem_state.hh:74
MemState(Addr brk_point, Addr stack_base, Addr max_stack_size, Addr next_thread_stack_base, Addr mmap_end)
Definition: mem_state.hh:51
Addr getStackSize() const
Definition: mem_state.hh:76

Generated on Fri Jun 9 2017 13:03:51 for gem5 by doxygen 1.8.6