1/* 2 * Copyright (c) 2003-2004 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; --- 385 unchanged lines hidden (view full) --- 394 int fillSize = sizeof(MachInst) * numFillInsts; 395 int spillSize = sizeof(MachInst) * numSpillInsts; 396 fillStart = stack_base; 397 spillStart = fillStart + fillSize; 398 initVirtMem->writeBlob(fillStart, (uint8_t*)fillHandler64, fillSize); 399 initVirtMem->writeBlob(spillStart, (uint8_t*)spillHandler64, spillSize); 400 401 //Set up the thread context to start running the process |
402 assert(NumArgumentRegs >= 2); 403 threadContexts[0]->setIntReg(ArgumentReg[0], argc); 404 threadContexts[0]->setIntReg(ArgumentReg[1], argv_array_base); |
405 threadContexts[0]->setIntReg(StackPointerReg, stack_min - StackBias); 406 407 Addr prog_entry = objFile->entryPoint(); 408 threadContexts[0]->setPC(prog_entry); 409 threadContexts[0]->setNextPC(prog_entry + sizeof(MachInst)); 410 threadContexts[0]->setNextNPC(prog_entry + (2 * sizeof(MachInst))); 411 412 //Align the "stack_min" to a page boundary. --- 210 unchanged lines hidden (view full) --- 623 int fillSize = sizeof(MachInst) * numFillInsts; 624 int spillSize = sizeof(MachInst) * numSpillInsts; 625 fillStart = stack_base; 626 spillStart = fillStart + fillSize; 627 initVirtMem->writeBlob(fillStart, (uint8_t*)fillHandler32, fillSize); 628 initVirtMem->writeBlob(spillStart, (uint8_t*)spillHandler32, spillSize); 629 630 //Set up the thread context to start running the process |
631 //assert(NumArgumentRegs >= 2); 632 //threadContexts[0]->setIntReg(ArgumentReg[0], argc); 633 //threadContexts[0]->setIntReg(ArgumentReg[1], argv_array_base); |
634 threadContexts[0]->setIntReg(StackPointerReg, stack_min); 635 636 uint32_t prog_entry = objFile->entryPoint(); 637 threadContexts[0]->setPC(prog_entry); 638 threadContexts[0]->setNextPC(prog_entry + sizeof(MachInst)); 639 threadContexts[0]->setNextNPC(prog_entry + (2 * sizeof(MachInst))); 640 641 //Align the "stack_min" to a page boundary. 642 stack_min = roundDown(stack_min, pageSize); 643 644// num_processes++; 645} |