process.cc (10223:34f48d0dac97) process.cc (10318:98771a936b61)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 44 unchanged lines hidden (view full) ---

53 // user address space. MIPS stack grows down from here
54 stack_base = 0x7FFFFFFF;
55
56 // Set pointer for next thread stack. Reserve 8M for main stack.
57 next_thread_stack_base = stack_base - (8 * 1024 * 1024);
58
59 // Set up break point (Top of Heap)
60 brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize();
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 44 unchanged lines hidden (view full) ---

53 // user address space. MIPS stack grows down from here
54 stack_base = 0x7FFFFFFF;
55
56 // Set pointer for next thread stack. Reserve 8M for main stack.
57 next_thread_stack_base = stack_base - (8 * 1024 * 1024);
58
59 // Set up break point (Top of Heap)
60 brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize();
61 brk_point = roundUp(brk_point, VMPageSize);
61 brk_point = roundUp(brk_point, PageBytes);
62
63 // Set up region for mmaps. Start it 1GB above the top of the heap.
64 mmap_start = mmap_end = brk_point + 0x40000000L;
65}
66
67void
68MipsLiveProcess::initState()
69{
70 LiveProcess::initState();
71
62
63 // Set up region for mmaps. Start it 1GB above the top of the heap.
64 mmap_start = mmap_end = brk_point + 0x40000000L;
65}
66
67void
68MipsLiveProcess::initState()
69{
70 LiveProcess::initState();
71
72 argsInit<uint32_t>(VMPageSize);
72 argsInit<uint32_t>(PageBytes);
73}
74
75template<class IntType>
76void
77MipsLiveProcess::argsInit(int pageSize)
78{
79 int intSize = sizeof(IntType);
80
81 // load object file into target memory
82 objFile->loadSections(initVirtMem);
83
84 typedef AuxVector<IntType> auxv_t;
85 std::vector<auxv_t> auxv;
86
87 ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile);
88 if (elfObject)
89 {
90 // Set the system page size
73}
74
75template<class IntType>
76void
77MipsLiveProcess::argsInit(int pageSize)
78{
79 int intSize = sizeof(IntType);
80
81 // load object file into target memory
82 objFile->loadSections(initVirtMem);
83
84 typedef AuxVector<IntType> auxv_t;
85 std::vector<auxv_t> auxv;
86
87 ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile);
88 if (elfObject)
89 {
90 // Set the system page size
91 auxv.push_back(auxv_t(M5_AT_PAGESZ, MipsISA::VMPageSize));
91 auxv.push_back(auxv_t(M5_AT_PAGESZ, MipsISA::PageBytes));
92 // Set the frequency at which time() increments
93 auxv.push_back(auxv_t(M5_AT_CLKTCK, 100));
94 // For statically linked executables, this is the virtual
95 // address of the program header tables if they appear in the
96 // executable image.
97 auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable()));
98 DPRINTF(Loader, "auxv at PHDR %08p\n", elfObject->programHeaderTable());
99 // This is the size of a program header entry from the elf file.

--- 112 unchanged lines hidden ---
92 // Set the frequency at which time() increments
93 auxv.push_back(auxv_t(M5_AT_CLKTCK, 100));
94 // For statically linked executables, this is the virtual
95 // address of the program header tables if they appear in the
96 // executable image.
97 auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable()));
98 DPRINTF(Loader, "auxv at PHDR %08p\n", elfObject->programHeaderTable());
99 // This is the size of a program header entry from the elf file.

--- 112 unchanged lines hidden ---