X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fsim%2Fprocess_impl.hh;h=b1905834b342af76d6b0a8e25cbdbe728698c658;hb=072f78471d11c31b6009beb572296f704912d0f7;hp=a3519fe39ac2aff017b8edb5596ff4329f71caf0;hpb=37b45e3c8cb2aef57e1d5dd8efd46705b8d46c16;p=gem5.git diff --git a/src/sim/process_impl.hh b/src/sim/process_impl.hh index a3519fe39..b1905834b 100644 --- a/src/sim/process_impl.hh +++ b/src/sim/process_impl.hh @@ -32,44 +32,32 @@ #ifndef __SIM_PROCESS_IMPL_HH__ #define __SIM_PROCESS_IMPL_HH__ -// -// The purpose of this code is to fake the loader & syscall mechanism -// when there's no OS: thus there's no reason to use it in FULL_SYSTEM -// mode when we do have an OS. -// -#include "config/full_system.hh" - -#if !FULL_SYSTEM - #include #include -#include "mem/translating_port.hh" - +#include "mem/se_translating_port_proxy.hh" +#include "sim/byteswap.hh" //This needs to be templated for cases where 32 bit pointers are needed. template void copyStringArray(std::vector &strings, AddrType array_ptr, AddrType data_ptr, - TranslatingPort* memPort) + SETranslatingPortProxy& memProxy) { AddrType data_ptr_swap; - for (int i = 0; i < strings.size(); ++i) { - data_ptr_swap = htog(data_ptr); - memPort->writeBlob(array_ptr, (uint8_t*)&data_ptr_swap, + for (std::vector::size_type i = 0; i < strings.size(); ++i) { + data_ptr_swap = TheISA::htog(data_ptr); + memProxy.writeBlob(array_ptr, (uint8_t*)&data_ptr_swap, sizeof(AddrType)); - memPort->writeString(data_ptr, strings[i].c_str()); + memProxy.writeString(data_ptr, strings[i].c_str()); array_ptr += sizeof(AddrType); data_ptr += strings[i].size() + 1; } // add NULL terminator data_ptr = 0; - memPort->writeBlob(array_ptr, (uint8_t*)&data_ptr, sizeof(AddrType)); + memProxy.writeBlob(array_ptr, (uint8_t*)&data_ptr, sizeof(AddrType)); } - -#endif // !FULL_SYSTEM - #endif