Deleted Added
sdiff udiff text old ( 5963:f541a09c5916 ) new ( 5973:07444c3d0a07 )
full compact
1/*
2 * Copyright (c) 2003-2006 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;

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

147 // Set pointer for next thread stack. Reserve 8M for main stack.
148 next_thread_stack_base = stack_base - (8 * 1024 * 1024);
149
150 // Set up region for mmaps. This was determined empirically and may not
151 // always be correct.
152 mmap_start = mmap_end = (Addr)0x2aaaaaaab000ULL;
153}
154
155I386LiveProcess::I386LiveProcess(LiveProcessParams *params,
156 ObjectFile *objFile, SyscallDesc *_syscallDescs,
157 int _numSyscallDescs) :
158 X86LiveProcess(params, objFile, _syscallDescs, _numSyscallDescs)
159{
160 stack_base = (Addr)0xffffe000ULL;
161
162 // Set pointer for next thread stack. Reserve 8M for main stack.
163 next_thread_stack_base = stack_base - (8 * 1024 * 1024);
164
165 // Set up region for mmaps. This was determined empirically and may not
166 // always be correct.
167 mmap_start = mmap_end = (Addr)0xf7ffd000ULL;
168}
169

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

250 return;
251
252 argsInit(sizeof(uint32_t), VMPageSize);
253
254 /*
255 * Set up a GDT for this process. The whole GDT wouldn't really be for
256 * this process, but the only parts we care about are.
257 */
258 _gdtStart = stack_base;
259 _gdtSize = VMPageSize;
260 pTable->allocate(_gdtStart, _gdtSize);
261 uint64_t zero = 0;
262 assert(_gdtSize % sizeof(zero) == 0);
263 for (Addr gdtCurrent = _gdtStart;
264 gdtCurrent < _gdtStart + _gdtSize; gdtCurrent += sizeof(zero)) {
265 initVirtMem->write(gdtCurrent, zero);
266 }
267
268 for (int i = 0; i < contextIds.size(); i++) {
269 ThreadContext * tc = system->getThreadContext(contextIds[i]);
270
271 SegAttr dataAttr = 0;
272 dataAttr.writable = 1;
273 dataAttr.readable = 1;
274 dataAttr.expandDown = 0;
275 dataAttr.dpl = 3;

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

327 efer.svme = 0; // Disable svm support for now. It isn't implemented.
328 efer.ffxsr = 1; // Turn on fast fxsave and fxrstor.
329 tc->setMiscReg(MISCREG_EFER, efer);
330 }
331}
332
333template<class IntType>
334void
335X86LiveProcess::argsInit(int pageSize)
336{
337 int intSize = sizeof(IntType);
338
339 typedef AuxVector<IntType> auxv_t;
340 std::vector<auxv_t> auxv;
341
342 string filename;
343 if(argv.size() < 1)
344 filename = "";
345 else
346 filename = argv[0];
347
348 //We want 16 byte alignment

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

603 stack_min = roundDown(stack_min, pageSize);
604
605// num_processes++;
606}
607
608void
609X86_64LiveProcess::argsInit(int intSize, int pageSize)
610{
611 X86LiveProcess::argsInit<uint64_t>(pageSize);
612}
613
614void
615I386LiveProcess::argsInit(int intSize, int pageSize)
616{
617 X86LiveProcess::argsInit<uint32_t>(pageSize);
618}
619
620void
621X86LiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn return_value)
622{
623 tc->setIntReg(INTREG_RAX, return_value.value());
624}
625

--- 27 unchanged lines hidden ---