syscall_desc.hh (11886:43b882cada33) syscall_desc.hh (12296:e127a1bae7bd)
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

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

46#ifndef __SIM_SYSCALL_DESC_HH__
47#define __SIM_SYSCALL_DESC_HH__
48
49#include <string>
50
51#include "base/types.hh"
52
53class Process;
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

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

46#ifndef __SIM_SYSCALL_DESC_HH__
47#define __SIM_SYSCALL_DESC_HH__
48
49#include <string>
50
51#include "base/types.hh"
52
53class Process;
54class SyscallDesc;
54class SyscallReturn;
55class ThreadContext;
56
55class SyscallReturn;
56class ThreadContext;
57
58SyscallReturn unimplementedFunc(SyscallDesc *desc, int num,
59 Process *p, ThreadContext *tc);
60
57/**
58 * This class provides the wrapper interface for the system call
59 * implementations which are defined in the sim/syscall_emul files and
60 * bound to the ISAs in the architecture specific code
61 * (i.e. arch/X86/linux/process.cc).
62 */
63class SyscallDesc {
64 public:
65 /** Typedef the function pointer here to clean up code below */
66 typedef SyscallReturn (*SyscallExecutor)(SyscallDesc*, int num,
67 Process*, ThreadContext*);
68
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 Process*, ThreadContext*);
72
69 SyscallDesc(const char *name, SyscallExecutor sys_exec, int flags = 0)
73 SyscallDesc(const char *name,
74 SyscallExecutor sys_exec=unimplementedFunc, int flags=0)
70 : _name(name), executor(sys_exec), _flags(flags), _warned(false)
71 {
72 }
73
74 /** Provide a mechanism to specify behavior for abnormal system calls */
75 enum Flags {
76 /**
77 * Do not set return registers according to executor return value.

--- 55 unchanged lines hidden ---
75 : _name(name), executor(sys_exec), _flags(flags), _warned(false)
76 {
77 }
78
79 /** Provide a mechanism to specify behavior for abnormal system calls */
80 enum Flags {
81 /**
82 * Do not set return registers according to executor return value.

--- 55 unchanged lines hidden ---