gem5  v20.0.0.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
process.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2008 The Florida State University
3  * Copyright (c) 2009 The University of Edinburgh
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
9  * notice, this list of conditions and the following disclaimer;
10  * redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution;
13  * neither the name of the copyright holders nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef __POWER_PROCESS_HH__
31 #define __POWER_PROCESS_HH__
32 
33 #include <string>
34 #include <vector>
35 
36 #include "mem/page_table.hh"
37 #include "sim/process.hh"
38 #include "sim/syscall_abi.hh"
39 
40 namespace Loader
41 {
42 class ObjectFile;
43 } // namespace Loader;
44 
45 class PowerProcess : public Process
46 {
47  protected:
48  PowerProcess(ProcessParams * params, ::Loader::ObjectFile *objFile);
49 
50  void initState() override;
51 
52  public:
53  void argsInit(int intSize, int pageSize);
54 
56  {
58  };
59 };
60 
61 namespace GuestABI
62 {
63 
64 template <>
65 struct Result<PowerProcess::SyscallABI, SyscallReturn>
66 {
67  static void
69  {
70  if (ret.suppressed() || ret.needsRetry())
71  return;
72 
73  PowerISA::Cr cr = tc->readIntReg(PowerISA::INTREG_CR);
74  if (ret.successful()) {
75  cr.cr0.so = 0;
76  } else {
77  cr.cr0.so = 1;
78  }
81  }
82 };
83 
84 } // namespace GuestABI
85 
86 #endif // __POWER_PROCESS_HH__
87 
static void store(ThreadContext *tc, const SyscallReturn &ret)
Definition: process.hh:68
virtual RegVal readIntReg(RegIndex reg_idx) const =0
bool successful() const
Was the system call successful?
ThreadContext is the external interface to all thread state for anything outside of the CPU...
int64_t encodedValue() const
The encoded value (as described above)
static const std::vector< int > ArgumentRegs
Definition: process.hh:57
virtual void setIntReg(RegIndex reg_idx, RegVal val)=0
bool suppressed() const
Should returning this value be suppressed?
Declarations of a non-full system Page Table.
const int ReturnValueReg
Definition: registers.hh:82
bool needsRetry() const
Does the syscall need to be retried?
This class represents the return value from an emulated system call, including any errno setting...

Generated on Mon Jun 8 2020 15:34:39 for gem5 by doxygen 1.8.13