process.hh (10930:ddc3d96d6313) | process.hh (10932:cafae9abd4e4) |
---|---|
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 --- 139 unchanged lines hidden (view full) --- 148 std::shared_ptr<std::array<FDEntry, NUM_FDS>> fd_array; 149 150 // Standard file descriptor options for initialization and checkpoints. 151 std::map<std::string, int> imap; 152 std::map<std::string, int> oemap; 153 154 public: 155 // inherit file descriptor map from another process (necessary for clone) | 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 --- 139 unchanged lines hidden (view full) --- 148 std::shared_ptr<std::array<FDEntry, NUM_FDS>> fd_array; 149 150 // Standard file descriptor options for initialization and checkpoints. 151 std::map<std::string, int> imap; 152 std::map<std::string, int> oemap; 153 154 public: 155 // inherit file descriptor map from another process (necessary for clone) |
156 void inheritFdArray(Process *p); | 156 void inheritFDArray(Process *p); |
157 158 // override of virtual SimObject method: register statistics 159 virtual void regStats(); 160 161 // After getting registered with system object, tell process which 162 // system-wide context id it is assigned. 163 void assignThreadContext(int context_id) 164 { 165 contextIds.push_back(context_id); 166 } 167 168 // Find a free context to use 169 ThreadContext *findFreeContext(); 170 171 // provide program name for debug messages 172 virtual const char *progName() const { return "<unknown>"; } 173 174 // generate new target fd for sim_fd | 157 158 // override of virtual SimObject method: register statistics 159 virtual void regStats(); 160 161 // After getting registered with system object, tell process which 162 // system-wide context id it is assigned. 163 void assignThreadContext(int context_id) 164 { 165 contextIds.push_back(context_id); 166 } 167 168 // Find a free context to use 169 ThreadContext *findFreeContext(); 170 171 // provide program name for debug messages 172 virtual const char *progName() const { return "<unknown>"; } 173 174 // generate new target fd for sim_fd |
175 int alloc_fd(int sim_fd, const std::string& filename, int flags, int mode, 176 bool pipe); | 175 int allocFD(int sim_fd, const std::string& filename, int flags, int mode, 176 bool pipe); |
177 178 // disassociate target fd with simulator fd and cleanup subsidiary fields | 177 178 // disassociate target fd with simulator fd and cleanup subsidiary fields |
179 void reset_fd_entry(int tgt_fd); | 179 void resetFDEntry(int tgt_fd); |
180 181 // look up simulator fd for given target fd | 180 181 // look up simulator fd for given target fd |
182 int sim_fd(int tgt_fd); | 182 int getSimFD(int tgt_fd); |
183 184 // look up fd entry for a given target fd | 183 184 // look up fd entry for a given target fd |
185 FDEntry *get_fd_entry(int tgt_fd); | 185 FDEntry *getFDEntry(int tgt_fd); |
186 187 // look up target fd for given host fd 188 // Assumes a 1:1 mapping between target file descriptor and host file 189 // descriptor. Given the current API, this must be true given that it's 190 // not possible to map multiple target file descriptors to the same host 191 // file descriptor | 186 187 // look up target fd for given host fd 188 // Assumes a 1:1 mapping between target file descriptor and host file 189 // descriptor. Given the current API, this must be true given that it's 190 // not possible to map multiple target file descriptors to the same host 191 // file descriptor |
192 int tgt_fd(int sim_fd); | 192 int getTgtFD(int sim_fd); |
193 194 // fix all offsets for currently open files and save them | 193 194 // fix all offsets for currently open files and save them |
195 void fix_file_offsets(); | 195 void fixFileOffsets(); |
196 197 // find all offsets for currently open files and save them | 196 197 // find all offsets for currently open files and save them |
198 void find_file_offsets(); | 198 void findFileOffsets(); |
199 200 // set the source of this read pipe for a checkpoint resume 201 void setReadPipeSource(int read_pipe_fd, int source_fd); 202 203 virtual void syscall(int64_t callnum, ThreadContext *tc) = 0; 204 205 void allocateMem(Addr vaddr, int64_t size, bool clobber = false); 206 --- 135 unchanged lines hidden --- | 199 200 // set the source of this read pipe for a checkpoint resume 201 void setReadPipeSource(int read_pipe_fd, int source_fd); 202 203 virtual void syscall(int64_t callnum, ThreadContext *tc) = 0; 204 205 void allocateMem(Addr vaddr, int64_t size, bool clobber = false); 206 --- 135 unchanged lines hidden --- |