process.cc (11800:54436a1784dc) | process.cc (11851:824055fe6b30) |
---|---|
1/* 2 * Copyright (c) 2007-2008 The Florida State University 3 * Copyright (c) 2009 The University of Edinburgh 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 33 unchanged lines hidden (view full) --- 42#include "mem/page_table.hh" 43#include "sim/process_impl.hh" 44#include "sim/syscall_return.hh" 45#include "sim/system.hh" 46 47using namespace std; 48using namespace PowerISA; 49 | 1/* 2 * Copyright (c) 2007-2008 The Florida State University 3 * Copyright (c) 2009 The University of Edinburgh 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 33 unchanged lines hidden (view full) --- 42#include "mem/page_table.hh" 43#include "sim/process_impl.hh" 44#include "sim/syscall_return.hh" 45#include "sim/system.hh" 46 47using namespace std; 48using namespace PowerISA; 49 |
50PowerLiveProcess::PowerLiveProcess(LiveProcessParams *params, 51 ObjectFile *objFile) 52 : LiveProcess(params, objFile) | 50PowerProcess::PowerProcess(ProcessParams *params, ObjectFile *objFile) 51 : Process(params, objFile) |
53{ 54 stack_base = 0xbf000000L; 55 56 // Set pointer for next thread stack. Reserve 8M for main stack. 57 next_thread_stack_base = stack_base - (8 * 1024 * 1024); 58 59 // Set up break point (Top of Heap) 60 brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize(); 61 brk_point = roundUp(brk_point, PageBytes); 62 63 // Set up region for mmaps. For now, start at bottom of kuseg space. 64 mmap_end = 0x70000000L; 65} 66 67void | 52{ 53 stack_base = 0xbf000000L; 54 55 // Set pointer for next thread stack. Reserve 8M for main stack. 56 next_thread_stack_base = stack_base - (8 * 1024 * 1024); 57 58 // Set up break point (Top of Heap) 59 brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize(); 60 brk_point = roundUp(brk_point, PageBytes); 61 62 // Set up region for mmaps. For now, start at bottom of kuseg space. 63 mmap_end = 0x70000000L; 64} 65 66void |
68PowerLiveProcess::initState() | 67PowerProcess::initState() |
69{ 70 Process::initState(); 71 72 argsInit(MachineBytes, PageBytes); 73} 74 75void | 68{ 69 Process::initState(); 70 71 argsInit(MachineBytes, PageBytes); 72} 73 74void |
76PowerLiveProcess::argsInit(int intSize, int pageSize) | 75PowerProcess::argsInit(int intSize, int pageSize) |
77{ 78 typedef AuxVector<uint32_t> auxv_t; 79 std::vector<auxv_t> auxv; 80 81 string filename; 82 if (argv.size() < 1) 83 filename = ""; 84 else --- 176 unchanged lines hidden (view full) --- 261 262 tc->pcState(getStartPC()); 263 264 //Align the "stack_min" to a page boundary. 265 stack_min = roundDown(stack_min, pageSize); 266} 267 268PowerISA::IntReg | 76{ 77 typedef AuxVector<uint32_t> auxv_t; 78 std::vector<auxv_t> auxv; 79 80 string filename; 81 if (argv.size() < 1) 82 filename = ""; 83 else --- 176 unchanged lines hidden (view full) --- 260 261 tc->pcState(getStartPC()); 262 263 //Align the "stack_min" to a page boundary. 264 stack_min = roundDown(stack_min, pageSize); 265} 266 267PowerISA::IntReg |
269PowerLiveProcess::getSyscallArg(ThreadContext *tc, int &i) | 268PowerProcess::getSyscallArg(ThreadContext *tc, int &i) |
270{ 271 assert(i < 5); 272 return tc->readIntReg(ArgumentReg0 + i++); 273} 274 275void | 269{ 270 assert(i < 5); 271 return tc->readIntReg(ArgumentReg0 + i++); 272} 273 274void |
276PowerLiveProcess::setSyscallArg(ThreadContext *tc, 277 int i, PowerISA::IntReg val) | 275PowerProcess::setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val) |
278{ 279 assert(i < 5); 280 tc->setIntReg(ArgumentReg0 + i, val); 281} 282 283void | 276{ 277 assert(i < 5); 278 tc->setIntReg(ArgumentReg0 + i, val); 279} 280 281void |
284PowerLiveProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) | 282PowerProcess::setSyscallReturn(ThreadContext *tc, SyscallReturn sysret) |
285{ 286 Cr cr = tc->readIntReg(INTREG_CR); 287 if (sysret.successful()) { 288 cr.cr0.so = 0; 289 } else { 290 cr.cr0.so = 1; 291 } 292 tc->setIntReg(INTREG_CR, cr); 293 tc->setIntReg(ReturnValueReg, sysret.encodedValue()); 294} | 283{ 284 Cr cr = tc->readIntReg(INTREG_CR); 285 if (sysret.successful()) { 286 cr.cr0.so = 0; 287 } else { 288 cr.cr0.so = 1; 289 } 290 tc->setIntReg(INTREG_CR, cr); 291 tc->setIntReg(ReturnValueReg, sysret.encodedValue()); 292} |