59c59
< stack_base = ((Addr)0x80000000000ULL);
---
> stack_base = (Addr)0x80000000000ULL;
63c63
< mmap_start = mmap_end = 0x800000;
---
> mmap_start = mmap_end = 0xfffff80000000000ULL;
112a113,118
> string filename;
> if(argv.size() < 1)
> filename = "";
> else
> filename = argv[0];
>
197,198c203,209
< //Each auxilliary vector is two 8 byte words
< int aux_data_size = 2 * intSize * auxv.size();
---
> // The unaccounted for 0 at the top of the stack
> int mysterious_size = intSize;
>
> //This is the name of the file which is present on the initial stack
> //It's purpose is to let the user space linker examine the original file.
> int file_name_size = filename.size() + 1;
>
208,215c219,222
< int aux_array_size = intSize * 2 * (auxv.size() + 1);
<
< int argv_array_size = intSize * (argv.size() + 1);
< int envp_array_size = intSize * (envp.size() + 1);
<
< int argc_size = intSize;
< int window_save_size = intSize * 16;
<
---
> //The info_block needs to be padded so it's size is a multiple of the
> //alignment mask. Also, it appears that there needs to be at least some
> //padding, so if the size is already a multiple, we need to increase it
> //anyway.
217c224
< (aux_data_size +
---
> (file_name_size +
220c227
< ~alignmentMask) & alignmentMask;
---
> intSize) & alignmentMask;
224c231
< aux_data_size -
---
> file_name_size -
227a235,243
> //Each auxilliary vector is two 8 byte words
> int aux_array_size = intSize * 2 * (auxv.size() + 1);
>
> int envp_array_size = intSize * (envp.size() + 1);
> int argv_array_size = intSize * (argv.size() + 1);
>
> int argc_size = intSize;
> int window_save_size = intSize * 16;
>
228a245
> mysterious_size +
245,246c262,264
< Addr aux_data_base = stack_base - aux_data_size - info_block_padding;
< Addr env_data_base = aux_data_base - env_data_size;
---
> Addr mysterious_base = stack_base - mysterious_size;
> Addr file_name_base = mysterious_base - file_name_size;
> Addr env_data_base = file_name_base - env_data_size;
248c266
< Addr auxv_array_base = arg_data_base - aux_array_size;
---
> Addr auxv_array_base = arg_data_base - aux_array_size - info_block_padding;
258c276
< DPRINTF(Sparc, "0x%x - aux data\n", aux_data_base);
---
> DPRINTF(Sparc, "0x%x - file name\n", file_name_base);
268a287,288
>
> // figure out argc
271a292,299
> //Write out the mysterious 0
> uint64_t mysterious_zero = 0;
> initVirtMem->writeBlob(mysterious_base,
> (uint8_t*)&mysterious_zero, mysterious_size);
>
> //Write the file name
> initVirtMem->writeString(file_name_base, filename.c_str());
>