Deleted Added
sdiff udiff text old ( 10796:5bcba8001c7e ) new ( 10831:fbdaa08aaa42 )
full compact
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * Copyright (c) 2015 Advanced Micro Devices, Inc.
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

92
93 /// Typedef for target syscall handler functions.
94 typedef SyscallReturn (*FuncPtr)(SyscallDesc *, int num,
95 LiveProcess *, ThreadContext *);
96
97 const char *name; //!< Syscall name (e.g., "open").
98 FuncPtr funcPtr; //!< Pointer to emulation function.
99 int flags; //!< Flags (see Flags enum).
100
101 /// Flag values for controlling syscall behavior.
102 enum Flags {
103 /// Don't set return regs according to funcPtr return value.
104 /// Used for syscalls with non-standard return conventions
105 /// that explicitly set the ThreadContext regs (e.g.,
106 /// sigreturn).
107 SuppressReturnValue = 1
108 };
109
110 /// Constructor.
111 SyscallDesc(const char *_name, FuncPtr _funcPtr, int _flags = 0)
112 : name(_name), funcPtr(_funcPtr), flags(_flags)
113 {
114 }
115
116 /// Emulate the syscall. Public interface for calling through funcPtr.
117 void doSyscall(int callnum, LiveProcess *proc, ThreadContext *tc);
118};
119
120
121//////////////////////////////////////////////////////////////////////
122//
123// The following emulation functions are generic enough that they
124// don't need to be recompiled for different emulated OS's. They are
125// defined in sim/syscall_emul.cc.

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

132 LiveProcess *p, ThreadContext *tc);
133
134/// Handler for unimplemented syscalls that we never intend to
135/// implement (signal handling, etc.) and should not affect the correct
136/// behavior of the program. Print a warning only if the appropriate
137/// trace flag is enabled. Return success to the target program.
138SyscallReturn ignoreFunc(SyscallDesc *desc, int num,
139 LiveProcess *p, ThreadContext *tc);
140SyscallReturn ignoreWarnOnceFunc(SyscallDesc *desc, int num,
141 LiveProcess *p, ThreadContext *tc);
142
143/// Target exit() handler: terminate current context.
144SyscallReturn exitFunc(SyscallDesc *desc, int num,
145 LiveProcess *p, ThreadContext *tc);
146
147/// Target exit_group() handler: terminate simulation. (exit all threads)
148SyscallReturn exitGroupFunc(SyscallDesc *desc, int num,
149 LiveProcess *p, ThreadContext *tc);

--- 1325 unchanged lines hidden ---