process.hh (4117:2807cee7b892) | process.hh (4434:2ea7b6e0b78f) |
---|---|
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; --- 31 unchanged lines hidden (view full) --- 40#include "config/full_system.hh" 41 42#if !FULL_SYSTEM 43 44#include <string> 45#include <vector> 46 47#include "base/statistics.hh" | 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; --- 31 unchanged lines hidden (view full) --- 40#include "config/full_system.hh" 41 42#if !FULL_SYSTEM 43 44#include <string> 45#include <vector> 46 47#include "base/statistics.hh" |
48#include "mem/translating_port.hh" | |
49#include "sim/host.hh" 50#include "sim/sim_object.hh" 51 52class ThreadContext; 53class SyscallDesc; 54class PageTable; 55class TranslatingPort; 56class System; 57class GDBListener; 58namespace TheISA 59{ 60 class RemoteGDB; 61} 62 | 48#include "sim/host.hh" 49#include "sim/sim_object.hh" 50 51class ThreadContext; 52class SyscallDesc; 53class PageTable; 54class TranslatingPort; 55class System; 56class GDBListener; 57namespace TheISA 58{ 59 class RemoteGDB; 60} 61 |
63//This needs to be templated for cases where 32 bit pointers are needed. 64template<class AddrType> 65void 66copyStringArray(std::vector<std::string> &strings, 67 AddrType array_ptr, AddrType data_ptr, 68 TranslatingPort* memPort) 69{ 70 AddrType data_ptr_swap; 71 for (int i = 0; i < strings.size(); ++i) { 72 data_ptr_swap = htog(data_ptr); 73 memPort->writeBlob(array_ptr, (uint8_t*)&data_ptr_swap, 74 sizeof(AddrType)); 75 memPort->writeString(data_ptr, strings[i].c_str()); 76 array_ptr += sizeof(AddrType); 77 data_ptr += strings[i].size() + 1; 78 } 79 // add NULL terminator 80 data_ptr = 0; 81 82 memPort->writeBlob(array_ptr, (uint8_t*)&data_ptr, sizeof(AddrType)); 83} 84 | |
85class Process : public SimObject 86{ 87 public: 88 89 /// Pointer to object representing the system this process is 90 /// running on. 91 System *system; 92 --- 96 unchanged lines hidden (view full) --- 189 // free target fd (e.g., after close) 190 void free_fd(int tgt_fd); 191 192 // look up simulator fd for given target fd 193 int sim_fd(int tgt_fd); 194 195 virtual void syscall(int64_t callnum, ThreadContext *tc) = 0; 196 | 62class Process : public SimObject 63{ 64 public: 65 66 /// Pointer to object representing the system this process is 67 /// running on. 68 System *system; 69 --- 96 unchanged lines hidden (view full) --- 166 // free target fd (e.g., after close) 167 void free_fd(int tgt_fd); 168 169 // look up simulator fd for given target fd 170 int sim_fd(int tgt_fd); 171 172 virtual void syscall(int64_t callnum, ThreadContext *tc) = 0; 173 |
174 // check if the this addr is on the next available page and allocate it 175 // if it's not we'll panic 176 bool checkAndAllocNextPage(Addr vaddr); 177 |
|
197 void serialize(std::ostream &os); 198 void unserialize(Checkpoint *cp, const std::string §ion); 199}; 200 201// 202// "Live" process with system calls redirected to host system 203// 204class ObjectFile; --- 75 unchanged lines hidden --- | 178 void serialize(std::ostream &os); 179 void unserialize(Checkpoint *cp, const std::string §ion); 180}; 181 182// 183// "Live" process with system calls redirected to host system 184// 185class ObjectFile; --- 75 unchanged lines hidden --- |