syscall_desc.hh (11794:97eebddaae84) | syscall_desc.hh (11851:824055fe6b30) |
---|---|
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 --- 34 unchanged lines hidden (view full) --- 43 * Brandon Potter 44 */ 45 46#ifndef __SIM_SYSCALL_DESC_HH__ 47#define __SIM_SYSCALL_DESC_HH__ 48 49#include <string> 50 | 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 --- 34 unchanged lines hidden (view full) --- 43 * Brandon Potter 44 */ 45 46#ifndef __SIM_SYSCALL_DESC_HH__ 47#define __SIM_SYSCALL_DESC_HH__ 48 49#include <string> 50 |
51class LiveProcess; | 51class Process; |
52class SyscallReturn; 53class ThreadContext; 54 55/** 56 * This class provides the wrapper interface for the system call 57 * implementations which are defined in the sim/syscall_emul files and 58 * bound to the ISAs in the architecture specific code 59 * (i.e. arch/X86/linux/process.cc). 60 */ 61class SyscallDesc { 62 public: 63 /** Typedef the function pointer here to clean up code below */ 64 typedef SyscallReturn (*SyscallExecutor)(SyscallDesc*, int num, | 52class SyscallReturn; 53class ThreadContext; 54 55/** 56 * This class provides the wrapper interface for the system call 57 * implementations which are defined in the sim/syscall_emul files and 58 * bound to the ISAs in the architecture specific code 59 * (i.e. arch/X86/linux/process.cc). 60 */ 61class SyscallDesc { 62 public: 63 /** Typedef the function pointer here to clean up code below */ 64 typedef SyscallReturn (*SyscallExecutor)(SyscallDesc*, int num, |
65 LiveProcess*, ThreadContext*); | 65 Process*, ThreadContext*); |
66 67 SyscallDesc(const char *name, SyscallExecutor sys_exec, int flags = 0) 68 : _name(name), executor(sys_exec), _flags(flags), _warned(false) 69 { 70 } 71 72 /** Provide a mechanism to specify behavior for abnormal system calls */ 73 enum Flags { --- 12 unchanged lines hidden (view full) --- 86 /** 87 * Interface for invoking the system call funcion pointer. Note that 88 * this acts as a gateway for all system calls and serves a good point 89 * to add filters for behaviors or apply checks for all system calls. 90 * @param callnum Number associated with call (by operating system) 91 * @param proc Handle for the owning Process to pass information 92 * @param tc Handle for owning ThreadContext to pass information 93 */ | 66 67 SyscallDesc(const char *name, SyscallExecutor sys_exec, int flags = 0) 68 : _name(name), executor(sys_exec), _flags(flags), _warned(false) 69 { 70 } 71 72 /** Provide a mechanism to specify behavior for abnormal system calls */ 73 enum Flags { --- 12 unchanged lines hidden (view full) --- 86 /** 87 * Interface for invoking the system call funcion pointer. Note that 88 * this acts as a gateway for all system calls and serves a good point 89 * to add filters for behaviors or apply checks for all system calls. 90 * @param callnum Number associated with call (by operating system) 91 * @param proc Handle for the owning Process to pass information 92 * @param tc Handle for owning ThreadContext to pass information 93 */ |
94 void doSyscall(int callnum, LiveProcess *proc, ThreadContext *tc); | 94 void doSyscall(int callnum, Process *proc, ThreadContext *tc); |
95 96 /** 97 * Return false if WarnOnce is set and a warning has already been issued. 98 * Otherwise, return true. Updates state as a side effect to help 99 * keep track of issued warnings. 100 */ 101 bool needWarning(); 102 --- 23 unchanged lines hidden --- | 95 96 /** 97 * Return false if WarnOnce is set and a warning has already been issued. 98 * Otherwise, return true. Updates state as a side effect to help 99 * keep track of issued warnings. 100 */ 101 bool needWarning(); 102 --- 23 unchanged lines hidden --- |