gem5 v24.0.0.0
Loading...
Searching...
No Matches
syscalls.hh
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution;
11 * neither the name of the copyright holders nor the names of its
12 * contributors may be used to endorse or promote products derived from
13 * this software without specific prior written permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#ifndef __ARCH_X86_LINUX_SYSCALLS_HH__
29#define __ARCH_X86_LINUX_SYSCALLS_HH__
30
32#include "base/bitunion.hh"
33#include "sim/se_workload.hh"
34#include "sim/syscall_emul.hh"
35
36namespace gem5
37{
38
39namespace X86ISA
40{
41
42SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc,
44
45SyscallReturn archPrctlFunc(SyscallDesc *desc, ThreadContext *tc,
46 int code, uint64_t addr);
47
48BitUnion32(UserDescFlags)
49 Bitfield<0> seg_32bit;
50 Bitfield<2, 1> contents;
51 Bitfield<3> read_exec_only;
52 Bitfield<4> limit_in_pages;
53 Bitfield<5> seg_not_present;
54 Bitfield<6> useable;
55EndBitUnion(UserDescFlags)
56
57struct UserDesc32
58{
59 uint32_t entry_number;
60 uint32_t base_addr;
61 uint32_t limit;
62 uint32_t flags;
63};
64
66 VPtr<UserDesc32> userDesc);
67
68} // namespace X86ISA
69} // namespace gem5
70
71#endif // __ARCH_X86_LINUX_SYSCALLS_HH__
#define BitUnion32(name)
Definition bitunion.hh:495
This class provides the wrapper interface for the system call implementations which are defined in th...
This class represents the return value from an emulated system call, including any errno setting.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
#define EndBitUnion(name)
This closes off the class and union started by the above macro.
Definition bitunion.hh:428
uint8_t flags
Definition helpers.cc:87
Bitfield< 4 > limit_in_pages
Definition syscalls.hh:52
Bitfield< 3 > read_exec_only
Definition syscalls.hh:51
SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
Definition syscalls.cc:49
Bitfield< 2, 1 > contents
Definition syscalls.hh:50
BitfieldType< SegDescriptorLimit > limit
Definition misc.hh:959
Bitfield< 3 > addr
Definition types.hh:84
SyscallReturn archPrctlFunc(SyscallDesc *desc, ThreadContext *tc, int code, uint64_t addr)
Definition syscalls.cc:63
Bitfield< 6 > useable
Definition syscalls.hh:54
SyscallReturn setThreadArea32Func(SyscallDesc *desc, ThreadContext *tc, VPtr< UserDesc32 > userDesc)
Definition syscalls.cc:100
Bitfield< 5 > seg_not_present
Definition syscalls.hh:53
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
ProxyPtr< T, SETranslatingPortProxy > VPtr
Definition proxy_ptr.hh:400
This file defines objects used to emulate syscalls from the target application on the host machine.
const std::string & name()
Definition trace.cc:48

Generated on Tue Jun 18 2024 16:24:00 for gem5 by doxygen 1.11.0