summaryrefslogtreecommitdiff
path: root/src/sim/aux_vector.cc
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2018-05-04 17:55:24 -0400
committerAnthony Gutierrez <anthony.gutierrez@amd.com>2018-09-19 20:51:17 +0000
commit194d650536cb49c374efdb1fe0473b3eec5dea1e (patch)
tree38ca6c67b838f539d4e75dc05bd321f9e859091a /src/sim/aux_vector.cc
parentc428c220fd351626e2ee0005dda696940261793b (diff)
downloadgem5-194d650536cb49c374efdb1fe0473b3eec5dea1e.tar.xz
syscall_emul: expand AuxVector class
The AuxVector class is responsible for holding Process data. The data that it holds is normally setup by an OS kernel in the process address space. The purpose behind doing this is to pass in information that the process will need for various reasons. (Check out the enum in the header file for an idea of what the AuxVector holds.) The AuxVector struct was changed into a class and encapsulation methods were added to protect access to the member variables. The host ISA may have a different endianness than the simulated ISA. Since data is passed between the process address space and the simulator for auxiliary vectors, we need to worry about maintaining endianness for the right context. Change-Id: I32c5ac4b679559886e1efeb4b5483b92dfc94af9 Reviewed-on: https://gem5-review.googlesource.com/12109 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Diffstat (limited to 'src/sim/aux_vector.cc')
-rw-r--r--src/sim/aux_vector.cc23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/sim/aux_vector.cc b/src/sim/aux_vector.cc
index ef91da520..87a22e455 100644
--- a/src/sim/aux_vector.cc
+++ b/src/sim/aux_vector.cc
@@ -68,10 +68,25 @@
template<class IntType>
AuxVector<IntType>::AuxVector(IntType type, IntType val)
+ : _auxType(TheISA::htog(type)), _auxVal(TheISA::htog(val)),
+ _auxHostType(type), _auxHostVal(val)
+{ }
+
+template<class IntType>
+inline void
+AuxVector<IntType>::setAuxType(IntType type)
+{
+ _auxType = TheISA::htog(type);
+ _auxHostType = type;
+}
+
+template<class IntType>
+inline void
+AuxVector<IntType>::setAuxVal(IntType val)
{
- a_type = TheISA::htog(type);
- a_val = TheISA::htog(val);
+ _auxVal = TheISA::htog(val);
+ _auxHostVal = val;
}
-template struct AuxVector<uint32_t>;
-template struct AuxVector<uint64_t>;
+template class AuxVector<uint32_t>;
+template class AuxVector<uint64_t>;