1/* 2 * Copyright (c) 2012-2013, 2015 ARM Limited 3 * Copyright (c) 2015-2016 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 --- 42 unchanged lines hidden (view full) --- 51#include "base/types.hh" 52 53class Process; 54class SyscallDesc; 55class SyscallReturn; 56class ThreadContext; 57 58SyscallReturn unimplementedFunc(SyscallDesc *desc, int num, |
59 ThreadContext *tc); |
60 61/** 62 * This class provides the wrapper interface for the system call 63 * implementations which are defined in the sim/syscall_emul files and 64 * bound to the ISAs in the architecture specific code 65 * (i.e. arch/X86/linux/process.cc). 66 */ 67class SyscallDesc { 68 public: 69 /** Typedef the function pointer here to clean up code below */ 70 typedef SyscallReturn (*SyscallExecutor)(SyscallDesc*, int num, |
71 ThreadContext*); |
72 73 SyscallDesc(const char *name, 74 SyscallExecutor sys_exec=unimplementedFunc, int flags=0) 75 : _name(name), executor(sys_exec), _flags(flags), _warned(false) 76 { 77 } 78 79 /** Provide a mechanism to specify behavior for abnormal system calls */ --- 13 unchanged lines hidden (view full) --- 93 /** 94 * Interface for invoking the system call funcion pointer. Note that 95 * this acts as a gateway for all system calls and serves a good point 96 * to add filters for behaviors or apply checks for all system calls. 97 * @param callnum Number associated with call (by operating system) 98 * @param proc Handle for the owning Process to pass information 99 * @param tc Handle for owning ThreadContext to pass information 100 */ |
101 void doSyscall(int callnum, ThreadContext *tc, Fault *fault); |
102 103 /** 104 * Return false if WarnOnce is set and a warning has already been issued. 105 * Otherwise, return true. Updates state as a side effect to help 106 * keep track of issued warnings. 107 */ 108 bool needWarning(); 109 --- 27 unchanged lines hidden --- |