gem5  v22.1.0.0
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 
31 #include "arch/x86/linux/linux.hh"
32 #include "base/bitunion.hh"
33 #include "sim/se_workload.hh"
34 #include "sim/syscall_emul.hh"
35 
36 namespace gem5
37 {
38 
39 namespace X86ISA
40 {
41 
42 SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc,
43  VPtr<Linux::utsname> name);
44 
45 SyscallReturn archPrctlFunc(SyscallDesc *desc, ThreadContext *tc,
46  int code, uint64_t addr);
47 
48 BitUnion32(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;
55 EndBitUnion(UserDescFlags)
56 
57 struct 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__
This class provides the wrapper interface for the system call implementations which are defined in th...
Definition: syscall_desc.hh:70
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.
uint8_t flags
Definition: helpers.cc:66
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:931
Bitfield< 3 > addr
Definition: types.hh:84
SyscallReturn archPrctlFunc(SyscallDesc *desc, ThreadContext *tc, int code, uint64_t addr)
Definition: syscalls.cc:63
EndBitUnion(TriggerIntMessage) GEM5_DEPRECATED_NAMESPACE(DeliveryMode
Bitfield< 6 > useable
Definition: syscalls.hh:54
BitUnion32(TriggerIntMessage) Bitfield< 7
SyscallReturn setThreadArea32Func(SyscallDesc *desc, ThreadContext *tc, VPtr< UserDesc32 > userDesc)
Definition: syscalls.cc:100
Bitfield< 5 > seg_not_present
Definition: syscalls.hh:53
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
This file defines objects used to emulate syscalls from the target application on the host machine.
const std::string & name()
Definition: trace.cc:49

Generated on Wed Dec 21 2022 10:22:28 for gem5 by doxygen 1.9.1