process.hh (10913:38dbdeea7f1f) process.hh (10929:b2bbfec74eca)
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

--- 147 unchanged lines hidden (view full) ---

156 void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
157 };
158
159 protected:
160 /// Memory proxy for initialization (image loading)
161 SETranslatingPortProxy initVirtMem;
162
163 private:
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

--- 147 unchanged lines hidden (view full) ---

156 void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
157 };
158
159 protected:
160 /// Memory proxy for initialization (image loading)
161 SETranslatingPortProxy initVirtMem;
162
163 private:
164 // file descriptor remapping support
165 static const int MAX_FD = 256; // max legal fd value
166 FdMap fd_map[MAX_FD+1];
164 static const int NUM_FDS = 1024;
167
165
166 // File descriptor remapping support.
167 FdMap *fd_map;
168
169 public:
170 // static helper functions to generate file descriptors for constructor
171 static int openInputFile(const std::string &filename);
172 static int openOutputFile(const std::string &filename);
173
174 // override of virtual SimObject method: register statistics
175 virtual void regStats();

--- 6 unchanged lines hidden (view full) ---

182 }
183
184 // Find a free context to use
185 ThreadContext *findFreeContext();
186
187 // provide program name for debug messages
188 virtual const char *progName() const { return "<unknown>"; }
189
168
169 public:
170 // static helper functions to generate file descriptors for constructor
171 static int openInputFile(const std::string &filename);
172 static int openOutputFile(const std::string &filename);
173
174 // override of virtual SimObject method: register statistics
175 virtual void regStats();

--- 6 unchanged lines hidden (view full) ---

182 }
183
184 // Find a free context to use
185 ThreadContext *findFreeContext();
186
187 // provide program name for debug messages
188 virtual const char *progName() const { return "<unknown>"; }
189
190 // map simulator fd sim_fd to target fd tgt_fd
191 void dup_fd(int sim_fd, int tgt_fd);
192
193 // generate new target fd for sim_fd
194 int alloc_fd(int sim_fd, const std::string& filename, int flags, int mode,
195 bool pipe);
196
190 // generate new target fd for sim_fd
191 int alloc_fd(int sim_fd, const std::string& filename, int flags, int mode,
192 bool pipe);
193
197 // free target fd (e.g., after close)
198 void free_fd(int tgt_fd);
194 // disassociate target fd with simulator fd and cleanup subsidiary fields
195 void free_fdmap_entry(int tgt_fd);
199
200 // look up simulator fd for given target fd
201 int sim_fd(int tgt_fd);
202
203 // look up simulator fd_map object for a given target fd
204 FdMap *sim_fd_obj(int tgt_fd);
205
196
197 // look up simulator fd for given target fd
198 int sim_fd(int tgt_fd);
199
200 // look up simulator fd_map object for a given target fd
201 FdMap *sim_fd_obj(int tgt_fd);
202
203 // look up target fd for given host fd
204 // Assumes a 1:1 mapping between target file descriptor and host file
205 // descriptor. Given the current API, this must be true given that it's
206 // not possible to map multiple target file descriptors to the same host
207 // file descriptor
208 int tgt_fd(int sim_fd);
209
206 // fix all offsets for currently open files and save them
207 void fix_file_offsets();
208
209 // find all offsets for currently open files and save them
210 void find_file_offsets();
211
212 // set the source of this read pipe for a checkpoint resume
213 void setReadPipeSource(int read_pipe_fd, int source_fd);

--- 140 unchanged lines hidden ---
210 // fix all offsets for currently open files and save them
211 void fix_file_offsets();
212
213 // find all offsets for currently open files and save them
214 void find_file_offsets();
215
216 // set the source of this read pipe for a checkpoint resume
217 void setReadPipeSource(int read_pipe_fd, int source_fd);

--- 140 unchanged lines hidden ---