1/* 2 * Copyright (c) 2014 Advanced Micro Devices, Inc. 3 * Copyright (c) 2001-2005 The Regents of The University of Michigan 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 --- 36 unchanged lines hidden (view full) --- 45#include "sim/syscallreturn.hh" 46 47class PageTable; 48struct ProcessParams; 49struct LiveProcessParams; 50class SyscallDesc; 51class System; 52class ThreadContext; |
53class EmulatedDriver; |
54 55template<class IntType> 56struct AuxVector 57{ 58 IntType a_type; 59 IntType a_val; 60 61 AuxVector() --- 73 unchanged lines hidden (view full) --- 135 public: 136 int fd; 137 std::string filename; 138 int mode; 139 int flags; 140 bool isPipe; 141 int readPipeSource; 142 uint64_t fileOffset; |
143 EmulatedDriver *driver; |
144 145 FdMap() 146 : fd(-1), filename("NULL"), mode(0), flags(0), |
147 isPipe(false), readPipeSource(0), fileOffset(0), driver(NULL) |
148 { } 149 150 void serialize(std::ostream &os); 151 void unserialize(Checkpoint *cp, const std::string §ion); 152 }; 153 154 protected: 155 /// Memory proxy for initialization (image loading) --- 97 unchanged lines hidden (view full) --- 253 uint64_t __euid; 254 uint64_t __gid; 255 uint64_t __egid; 256 257 // pid of the process and it's parent 258 uint64_t __pid; 259 uint64_t __ppid; 260 |
261 // Emulated drivers available to this process 262 std::vector<EmulatedDriver *> drivers; 263 |
264 public: 265 266 enum AuxiliaryVectorType { 267 M5_AT_NULL = 0, 268 M5_AT_IGNORE = 1, 269 M5_AT_EXECFD = 2, 270 M5_AT_PHDR = 3, 271 M5_AT_PHENT = 4, --- 53 unchanged lines hidden (view full) --- 325 virtual TheISA::IntReg getSyscallArg(ThreadContext *tc, int &i, int width); 326 virtual void setSyscallArg(ThreadContext *tc, 327 int i, TheISA::IntReg val) = 0; 328 virtual void setSyscallReturn(ThreadContext *tc, 329 SyscallReturn return_value) = 0; 330 331 virtual SyscallDesc *getDesc(int callnum) = 0; 332 |
333 /** 334 * Find an emulated device driver. 335 * 336 * @param filename Name of the device (under /dev) 337 * @return Pointer to driver object if found, else NULL 338 */ 339 EmulatedDriver *findDriver(std::string filename); 340 |
341 // this function is used to create the LiveProcess object, since 342 // we can't tell which subclass of LiveProcess to use until we 343 // open and look at the object file. 344 static LiveProcess *create(LiveProcessParams *params); 345}; 346 347 348#endif // __PROCESS_HH__ |