process.cc (4651:7401ad908eb4) process.cc (4772:f08370a81812)
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
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 threadContexts[0]->setIntReg(ArgumentReg0, argc);
403 threadContexts[0]->setIntReg(ArgumentReg1, argv_array_base);
402 assert(NumArgumentRegs >= 2);
403 threadContexts[0]->setIntReg(ArgumentReg[0], argc);
404 threadContexts[0]->setIntReg(ArgumentReg[1], argv_array_base);
404 threadContexts[0]->setIntReg(StackPointerReg, stack_min - StackBias);
405
406 Addr prog_entry = objFile->entryPoint();
407 threadContexts[0]->setPC(prog_entry);
408 threadContexts[0]->setNextPC(prog_entry + sizeof(MachInst));
409 threadContexts[0]->setNextNPC(prog_entry + (2 * sizeof(MachInst)));
410
411 //Align the "stack_min" to a page boundary.

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

622 int fillSize = sizeof(MachInst) * numFillInsts;
623 int spillSize = sizeof(MachInst) * numSpillInsts;
624 fillStart = stack_base;
625 spillStart = fillStart + fillSize;
626 initVirtMem->writeBlob(fillStart, (uint8_t*)fillHandler32, fillSize);
627 initVirtMem->writeBlob(spillStart, (uint8_t*)spillHandler32, spillSize);
628
629 //Set up the thread context to start running the process
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
630 //threadContexts[0]->setIntReg(ArgumentReg0, argc);
631 //threadContexts[0]->setIntReg(ArgumentReg1, argv_array_base);
631 //assert(NumArgumentRegs >= 2);
632 //threadContexts[0]->setIntReg(ArgumentReg[0], argc);
633 //threadContexts[0]->setIntReg(ArgumentReg[1], argv_array_base);
632 threadContexts[0]->setIntReg(StackPointerReg, stack_min);
633
634 uint32_t prog_entry = objFile->entryPoint();
635 threadContexts[0]->setPC(prog_entry);
636 threadContexts[0]->setNextPC(prog_entry + sizeof(MachInst));
637 threadContexts[0]->setNextNPC(prog_entry + (2 * sizeof(MachInst)));
638
639 //Align the "stack_min" to a page boundary.
640 stack_min = roundDown(stack_min, pageSize);
641
642// num_processes++;
643}
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}