process.hh (8737:770ccf3af571) | process.hh (8766:b0773af78423) |
---|---|
1/* 2 * Copyright (c) 2001-2005 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; --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: Nathan Binkert 29 * Steve Reinhardt 30 */ 31 32#ifndef __PROCESS_HH__ 33#define __PROCESS_HH__ 34 | 1/* 2 * Copyright (c) 2001-2005 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; --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: Nathan Binkert 29 * Steve Reinhardt 30 */ 31 32#ifndef __PROCESS_HH__ 33#define __PROCESS_HH__ 34 |
35// 36// The purpose of this code is to fake the loader & syscall mechanism 37// when there's no OS: thus there's no reason to use it in FULL_SYSTEM 38// mode when we do have an OS. 39// 40#include "config/full_system.hh" 41 42#if !FULL_SYSTEM 43 | |
44#include <string> 45#include <vector> 46 47#include "arch/registers.hh" 48#include "base/statistics.hh" 49#include "base/types.hh" 50#include "config/the_isa.hh" 51#include "sim/sim_object.hh" 52#include "sim/syscallreturn.hh" 53 54class PageTable; | 35#include <string> 36#include <vector> 37 38#include "arch/registers.hh" 39#include "base/statistics.hh" 40#include "base/types.hh" 41#include "config/the_isa.hh" 42#include "sim/sim_object.hh" 43#include "sim/syscallreturn.hh" 44 45class PageTable; |
55struct ProcessParams; 56struct LiveProcessParams; | 46class ProcessParams; 47class LiveProcessParams; |
57class SyscallDesc; 58class System; 59class ThreadContext; | 48class SyscallDesc; 49class System; 50class ThreadContext; |
60class SETranslatingPortProxy; | 51class TranslatingPort; |
61 62template<class IntType> 63struct AuxVector 64{ 65 IntType a_type; 66 IntType a_val; 67 68 AuxVector() --- 58 unchanged lines hidden (view full) --- 127 protected: 128 // constructor 129 Process(ProcessParams *params); 130 131 virtual void initState(); 132 133 protected: 134 /// Memory object for initialization (image loading) | 52 53template<class IntType> 54struct AuxVector 55{ 56 IntType a_type; 57 IntType a_val; 58 59 AuxVector() --- 58 unchanged lines hidden (view full) --- 118 protected: 119 // constructor 120 Process(ProcessParams *params); 121 122 virtual void initState(); 123 124 protected: 125 /// Memory object for initialization (image loading) |
135 SETranslatingPortProxy *initVirtMem; | 126 TranslatingPort *initVirtMem; |
136 137 public: 138 PageTable *pTable; 139 140 //This id is assigned by m5 and is used to keep process' tlb entries 141 //separated. 142 uint64_t M5_pid; 143 --- 63 unchanged lines hidden (view full) --- 207 // find all offsets for currently open files and save them 208 void find_file_offsets(); 209 210 // set the source of this read pipe for a checkpoint resume 211 void setReadPipeSource(int read_pipe_fd, int source_fd); 212 213 virtual void syscall(int64_t callnum, ThreadContext *tc) = 0; 214 | 127 128 public: 129 PageTable *pTable; 130 131 //This id is assigned by m5 and is used to keep process' tlb entries 132 //separated. 133 uint64_t M5_pid; 134 --- 63 unchanged lines hidden (view full) --- 198 // find all offsets for currently open files and save them 199 void find_file_offsets(); 200 201 // set the source of this read pipe for a checkpoint resume 202 void setReadPipeSource(int read_pipe_fd, int source_fd); 203 204 virtual void syscall(int64_t callnum, ThreadContext *tc) = 0; 205 |
215 void allocateMem(Addr vaddr, int64_t size, bool clobber = false); 216 | |
217 /// Attempt to fix up a fault at vaddr by allocating a page on the stack. 218 /// @return Whether the fault has been fixed. 219 bool fixupStackFault(Addr vaddr); 220 221 void serialize(std::ostream &os); 222 void unserialize(Checkpoint *cp, const std::string §ion); 223}; 224 --- 89 unchanged lines hidden (view full) --- 314 315 // this function is used to create the LiveProcess object, since 316 // we can't tell which subclass of LiveProcess to use until we 317 // open and look at the object file. 318 static LiveProcess *create(LiveProcessParams *params); 319}; 320 321 | 206 /// Attempt to fix up a fault at vaddr by allocating a page on the stack. 207 /// @return Whether the fault has been fixed. 208 bool fixupStackFault(Addr vaddr); 209 210 void serialize(std::ostream &os); 211 void unserialize(Checkpoint *cp, const std::string §ion); 212}; 213 --- 89 unchanged lines hidden (view full) --- 303 304 // this function is used to create the LiveProcess object, since 305 // we can't tell which subclass of LiveProcess to use until we 306 // open and look at the object file. 307 static LiveProcess *create(LiveProcessParams *params); 308}; 309 310 |
322#endif // !FULL_SYSTEM 323 | |
324#endif // __PROCESS_HH__ | 311#endif // __PROCESS_HH__ |