initVirtMem.writeBlob(memState->getStackMin(), &argc, intSize);
- copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
- copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
+ copyStringArray(argv, argv_array_base, arg_data_base,
+ LittleEndianByteOrder, initVirtMem);
+ copyStringArray(envp, envp_array_base, env_data_base,
+ LittleEndianByteOrder, initVirtMem);
//Copy the aux stuff
Addr auxv_array_end = auxv_array_base;
initVirtMem.write(auxv_array_end, zero);
auxv_array_end += sizeof(zero);
- copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
- copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
+ copyStringArray(envp, envp_array_base, env_data_base,
+ LittleEndianByteOrder, initVirtMem);
+ copyStringArray(argv, argv_array_base, arg_data_base,
+ LittleEndianByteOrder, initVirtMem);
initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
initVirtMem.writeBlob(memState->getStackMin(), &argc, intSize);
- copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
+ copyStringArray(argv, argv_array_base, arg_data_base,
+ LittleEndianByteOrder, initVirtMem);
- copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
+ copyStringArray(envp, envp_array_base, env_data_base,
+ LittleEndianByteOrder, initVirtMem);
// Copy the aux vector
Addr auxv_array_end = auxv_array_base;
initVirtMem.write(auxv_array_end, zero);
auxv_array_end += sizeof(zero);
- copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
- copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
+ copyStringArray(envp, envp_array_base, env_data_base,
+ BigEndianByteOrder, initVirtMem);
+ copyStringArray(argv, argv_array_base, arg_data_base,
+ BigEndianByteOrder, initVirtMem);
initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
initVirtMem.write(auxv_array_end, zero);
auxv_array_end += sizeof(zero);
- copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
- copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
+ copyStringArray(envp, envp_array_base, env_data_base,
+ BigEndianByteOrder, initVirtMem);
+ copyStringArray(argv, argv_array_base, arg_data_base,
+ BigEndianByteOrder, initVirtMem);
initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
initVirtMem.writeString(aux_data_base, platform.c_str());
- copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
- copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
+ copyStringArray(envp, envp_array_base, env_data_base,
+ LittleEndianByteOrder, initVirtMem);
+ copyStringArray(argv, argv_array_base, arg_data_base,
+ LittleEndianByteOrder, initVirtMem);
initVirtMem.writeBlob(argc_base, &guestArgc, intSize);
void
copyStringArray(std::vector<std::string> &strings,
AddrType array_ptr, AddrType data_ptr,
- PortProxy& memProxy)
+ const ByteOrder bo, PortProxy& memProxy)
{
AddrType data_ptr_swap;
for (std::vector<std::string>::size_type i = 0; i < strings.size(); ++i) {
- data_ptr_swap = TheISA::htog(data_ptr);
+ data_ptr_swap = htog(data_ptr, bo);
memProxy.writeBlob(array_ptr, &data_ptr_swap, sizeof(AddrType));
memProxy.writeString(data_ptr, strings[i].c_str());
array_ptr += sizeof(AddrType);