process.cc (7629:0f0c231e3e97) process.cc (7720:65d338a8dba4)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

111 // Set up region for mmaps. This was determined empirically and may not
112 // always be correct.
113 mmap_start = mmap_end = (Addr)0x2aaaaaaab000ULL;
114}
115
116void
117I386LiveProcess::syscall(int64_t callnum, ThreadContext *tc)
118{
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

111 // Set up region for mmaps. This was determined empirically and may not
112 // always be correct.
113 mmap_start = mmap_end = (Addr)0x2aaaaaaab000ULL;
114}
115
116void
117I386LiveProcess::syscall(int64_t callnum, ThreadContext *tc)
118{
119 Addr eip = tc->readPC();
119 TheISA::PCState pc = tc->pcState();
120 Addr eip = pc.pc();
120 if (eip >= vsyscallPage.base &&
121 eip < vsyscallPage.base + vsyscallPage.size) {
121 if (eip >= vsyscallPage.base &&
122 eip < vsyscallPage.base + vsyscallPage.size) {
122 tc->setNextPC(vsyscallPage.base + vsyscallPage.vsysexitOffset);
123 pc.npc(vsyscallPage.base + vsyscallPage.vsysexitOffset);
124 tc->pcState(pc);
123 }
124 X86LiveProcess::syscall(callnum, tc);
125}
126
127
128I386LiveProcess::I386LiveProcess(LiveProcessParams *params,
129 ObjectFile *objFile, SyscallDesc *_syscallDescs,
130 int _numSyscallDescs) :

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

640 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
641
642 initVirtMem->writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
643
644 ThreadContext *tc = system->getThreadContext(contextIds[0]);
645 //Set the stack pointer register
646 tc->setIntReg(StackPointerReg, stack_min);
647
125 }
126 X86LiveProcess::syscall(callnum, tc);
127}
128
129
130I386LiveProcess::I386LiveProcess(LiveProcessParams *params,
131 ObjectFile *objFile, SyscallDesc *_syscallDescs,
132 int _numSyscallDescs) :

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

642 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
643
644 initVirtMem->writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
645
646 ThreadContext *tc = system->getThreadContext(contextIds[0]);
647 //Set the stack pointer register
648 tc->setIntReg(StackPointerReg, stack_min);
649
648 Addr prog_entry = objFile->entryPoint();
649 // There doesn't need to be any segment base added in since we're dealing
650 // with the flat segmentation model.
650 // There doesn't need to be any segment base added in since we're dealing
651 // with the flat segmentation model.
651 tc->setPC(prog_entry);
652 tc->setNextPC(prog_entry + sizeof(MachInst));
652 tc->pcState(objFile->entryPoint());
653
654 //Align the "stack_min" to a page boundary.
655 stack_min = roundDown(stack_min, pageSize);
656
657// num_processes++;
658}
659
660void

--- 64 unchanged lines hidden ---
653
654 //Align the "stack_min" to a page boundary.
655 stack_min = roundDown(stack_min, pageSize);
656
657// num_processes++;
658}
659
660void

--- 64 unchanged lines hidden ---