diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2006-02-15 01:23:13 -0500 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2006-02-15 01:23:13 -0500 |
commit | 18a0fa3e0c19e1afaf1dedb3d5a3b14a2c3aa3c7 (patch) | |
tree | d2df59785f910ac7d285ac4591a15dda8c01bf49 /sim/process.cc | |
parent | 79613686f0f6a8725e88e935a7c9ff4ede4cfc2b (diff) | |
download | gem5-18a0fa3e0c19e1afaf1dedb3d5a3b14a2c3aa3c7.tar.xz |
endian fixes and compiles on mac os x
arch/alpha/alpha_linux_process.cc:
add endian conversions for fstat functions
arch/alpha/alpha_tru64_process.cc:
add endian conversions for various functions
sim/byteswap.hh:
for some reason gcc on macos really wants long and unsigned long
Why int32_t and uint32_t isn't sufficient I don't know.
sim/process.cc:
sim/syscall_emul.hh:
endian fixes
--HG--
extra : convert_revision : ce625d5660b70867c43c74fbed856149c0d8cd36
Diffstat (limited to 'sim/process.cc')
-rw-r--r-- | sim/process.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sim/process.cc b/sim/process.cc index 395e2eb0a..59d122b48 100644 --- a/sim/process.cc +++ b/sim/process.cc @@ -251,8 +251,10 @@ static void copyStringArray(vector<string> &strings, Addr array_ptr, Addr data_ptr, FunctionalMemory *memory) { + Addr data_ptr_swap; for (int i = 0; i < strings.size(); ++i) { - memory->access(Write, array_ptr, &data_ptr, sizeof(Addr)); + data_ptr_swap = htog(data_ptr); + memory->access(Write, array_ptr, &data_ptr_swap, sizeof(Addr)); memory->writeString(data_ptr, strings[i].c_str()); array_ptr += sizeof(Addr); data_ptr += strings[i].size() + 1; @@ -334,6 +336,7 @@ LiveProcess::LiveProcess(const string &nm, ObjectFile *objFile, // write contents to stack uint64_t argc = argv.size(); + argc = htog(argc); memory->access(Write, stack_min, &argc, sizeof(uint64_t)); copyStringArray(argv, argv_array_base, arg_data_base, memory); |