Deleted Added
sdiff udiff text old ( 11905:4a771f8756ad ) new ( 12283:9c8f694f4e97 )
full compact
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;

--- 17 unchanged lines hidden (view full) ---

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
34/**
35 * This class holds the memory state for the Process class and all of its
36 * derived, architecture-specific children.
37 *
38 * The fields held in this class dynamically change as the process object
39 * is run in the simulator. They are updated by system calls and faults;
40 * each change represents a modification to the process address space.
41 * The stack, heap, and mmap boundaries are held with this class along with
42 * the base of the next thread stack.
43 *
44 * The class is meant to be allocated dynamically and shared through a
45 * pointer interface because two process can potentially share their virtual
46 * address space if certain options are passed into the clone(2).
47 */
48class 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 { }

--- 25 unchanged lines hidden (view full) ---

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; }
87 void setNextThreadStackBase(Addr ntsb) { _nextThreadStackBase = ntsb; }
88 void setMmapEnd(Addr mmap_end) { _mmapEnd = mmap_end; }
89
90 private:
91 Addr _brkPoint;
92 Addr _stackBase;
93 Addr _stackSize;
94 Addr _maxStackSize;
95 Addr _stackMin;
96 Addr _nextThreadStackBase;
97 Addr _mmapEnd;
98};
99
100#endif