process.cc (11877:5ea85692a53e) process.cc (11884:e8536709cbc0)
1/*
2 * Copyright (c) 2014 Advanced Micro Devices, Inc.
3 * Copyright (c) 2007 The Hewlett-Packard Development Company
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

183 return &syscallDescs[callnum];
184}
185
186void
187X86_64Process::initState()
188{
189 X86Process::initState();
190
1/*
2 * Copyright (c) 2014 Advanced Micro Devices, Inc.
3 * Copyright (c) 2007 The Hewlett-Packard Development Company
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

183 return &syscallDescs[callnum];
184}
185
186void
187X86_64Process::initState()
188{
189 X86Process::initState();
190
191 argsInit(sizeof(uint64_t), PageBytes);
191 argsInit(PageBytes);
192
193 // Set up the vsyscall page for this process.
194 allocateMem(vsyscallPage.base, vsyscallPage.size);
195 uint8_t vtimeBlob[] = {
196 0x48,0xc7,0xc0,0xc9,0x00,0x00,0x00, // mov $0xc9,%rax
197 0x0f,0x05, // syscall
198 0xc3 // retq
199 };

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

627 }
628}
629
630void
631I386Process::initState()
632{
633 X86Process::initState();
634
192
193 // Set up the vsyscall page for this process.
194 allocateMem(vsyscallPage.base, vsyscallPage.size);
195 uint8_t vtimeBlob[] = {
196 0x48,0xc7,0xc0,0xc9,0x00,0x00,0x00, // mov $0xc9,%rax
197 0x0f,0x05, // syscall
198 0xc3 // retq
199 };

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

627 }
628}
629
630void
631I386Process::initState()
632{
633 X86Process::initState();
634
635 argsInit(sizeof(uint32_t), PageBytes);
635 argsInit(PageBytes);
636
637 /*
638 * Set up a GDT for this process. The whole GDT wouldn't really be for
639 * this process, but the only parts we care about are.
640 */
641 allocateMem(_gdtStart, _gdtSize);
642 uint64_t zero = 0;
643 assert(_gdtSize % sizeof(zero) == 0);

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

744
745 tc->setMiscReg(MISCREG_MXCSR, 0x1f80);
746 }
747}
748
749template<class IntType>
750void
751X86Process::argsInit(int pageSize,
636
637 /*
638 * Set up a GDT for this process. The whole GDT wouldn't really be for
639 * this process, but the only parts we care about are.
640 */
641 allocateMem(_gdtStart, _gdtSize);
642 uint64_t zero = 0;
643 assert(_gdtSize % sizeof(zero) == 0);

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

744
745 tc->setMiscReg(MISCREG_MXCSR, 0x1f80);
746 }
747}
748
749template<class IntType>
750void
751X86Process::argsInit(int pageSize,
752 std::vector > extraAuxvs)
752 std::vector<AuxVector<IntType> > extraAuxvs)
753{
754 int intSize = sizeof(IntType);
755
756 typedef AuxVector<IntType> auxv_t;
757 std::vector<auxv_t> auxv = extraAuxvs;
758
759 string filename;
760 if (argv.size() < 1)

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

1029 // with the flat segmentation model.
1030 tc->pcState(getStartPC());
1031
1032 //Align the "stack_min" to a page boundary.
1033 stack_min = roundDown(stack_min, pageSize);
1034}
1035
1036void
753{
754 int intSize = sizeof(IntType);
755
756 typedef AuxVector<IntType> auxv_t;
757 std::vector<auxv_t> auxv = extraAuxvs;
758
759 string filename;
760 if (argv.size() < 1)

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

1029 // with the flat segmentation model.
1030 tc->pcState(getStartPC());
1031
1032 //Align the "stack_min" to a page boundary.
1033 stack_min = roundDown(stack_min, pageSize);
1034}
1035
1036void
1037X86_64Process::argsInit(int intSize, int pageSize)
1037X86_64Process::argsInit(int pageSize)
1038{
1039 std::vector<AuxVector<uint64_t> > extraAuxvs;
1040 extraAuxvs.push_back(AuxVector<uint64_t>(M5_AT_SYSINFO_EHDR,
1041 vsyscallPage.base));
1042 X86Process::argsInit<uint64_t>(pageSize, extraAuxvs);
1043}
1044
1045void
1038{
1039 std::vector<AuxVector<uint64_t> > extraAuxvs;
1040 extraAuxvs.push_back(AuxVector<uint64_t>(M5_AT_SYSINFO_EHDR,
1041 vsyscallPage.base));
1042 X86Process::argsInit<uint64_t>(pageSize, extraAuxvs);
1043}
1044
1045void
1046I386Process::argsInit(int intSize, int pageSize)
1046I386Process::argsInit(int pageSize)
1047{
1048 std::vector<AuxVector<uint32_t> > extraAuxvs;
1049 //Tell the binary where the vsyscall part of the vsyscall page is.
1050 extraAuxvs.push_back(AuxVector<uint32_t>(M5_AT_SYSINFO,
1051 vsyscallPage.base + vsyscallPage.vsyscallOffset));
1052 extraAuxvs.push_back(AuxVector<uint32_t>(M5_AT_SYSINFO_EHDR,
1053 vsyscallPage.base));
1054 X86Process::argsInit<uint32_t>(pageSize, extraAuxvs);

--- 46 unchanged lines hidden ---
1047{
1048 std::vector<AuxVector<uint32_t> > extraAuxvs;
1049 //Tell the binary where the vsyscall part of the vsyscall page is.
1050 extraAuxvs.push_back(AuxVector<uint32_t>(M5_AT_SYSINFO,
1051 vsyscallPage.base + vsyscallPage.vsyscallOffset));
1052 extraAuxvs.push_back(AuxVector<uint32_t>(M5_AT_SYSINFO_EHDR,
1053 vsyscallPage.base));
1054 X86Process::argsInit<uint32_t>(pageSize, extraAuxvs);

--- 46 unchanged lines hidden ---