gem5  v20.1.0.0
flag_tables.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2003-2005, 2006 The Regents of The University of Michigan
15  * Copyright (c) 2007-2008 The Florida State University
16  * Copyright (c) 2009 The University of Edinburgh
17  * All rights reserved.
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions are
21  * met: redistributions of source code must retain the above copyright
22  * notice, this list of conditions and the following disclaimer;
23  * redistributions in binary form must reproduce the above copyright
24  * notice, this list of conditions and the following disclaimer in the
25  * documentation and/or other materials provided with the distribution;
26  * neither the name of the copyright holders nor the names of its
27  * contributors may be used to endorse or promote products derived from
28  * this software without specific prior written permission.
29  *
30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41  */
42 
43 /*
44  * @file flag_tables.hh
45  *
46  * This file contains definitions of flag translation tables for the
47  * open() system call. Since the tables are nearly identical
48  * across target platforms (other than the values of the target flags),
49  * we use a single copy of the tables but include it separately for
50  * each target platform. The TARGET macro must be #defined before including
51  * to indicate the class for which the table is being defined.
52  *
53  * See src/arch/<*>/linux/linux.cc.
54  */
55 
56 // open(2) flags translation table
57 SyscallFlagTransTable TARGET::openFlagTable[] = {
58 #ifdef _MSC_VER
59  { TARGET::TGT_O_RDONLY, _O_RDONLY },
60  { TARGET::TGT_O_WRONLY, _O_WRONLY },
61  { TARGET::TGT_O_RDWR, _O_RDWR },
62  { TARGET::TGT_O_CREAT, _O_CREAT },
63  { TARGET::TGT_O_EXCL, _O_EXCL },
64  { TARGET::TGT_O_TRUNC, _O_TRUNC },
65  { TARGET::TGT_O_APPEND, _O_APPEND },
66 #else /* !_MSC_VER */
67  { TARGET::TGT_O_RDONLY, O_RDONLY },
68  { TARGET::TGT_O_WRONLY, O_WRONLY },
69  { TARGET::TGT_O_RDWR, O_RDWR },
70  { TARGET::TGT_O_CREAT, O_CREAT },
71  { TARGET::TGT_O_EXCL, O_EXCL },
72  { TARGET::TGT_O_TRUNC, O_TRUNC },
73  { TARGET::TGT_O_APPEND, O_APPEND },
74  { TARGET::TGT_O_NOCTTY, O_NOCTTY },
75  { TARGET::TGT_O_NONBLOCK, O_NONBLOCK },
76 #ifdef O_DSYNC
77  { TARGET::TGT_O_DSYNC, O_DSYNC },
78 #endif
79 #ifdef O_ASYNC
80  { TARGET::TGT_FASYNC, O_ASYNC },
81 #endif
82 #ifdef O_DIRECT
83  { TARGET::TGT_O_DIRECT, O_DIRECT },
84 #endif
85 #ifdef O_LARGEFILE
86  { TARGET::TGT_O_LARGEFILE, O_LARGEFILE },
87 #endif
88 #ifdef O_DIRECTORY
89  { TARGET::TGT_O_DIRECTORY, O_DIRECTORY },
90 #endif
91 #ifdef O_NOFOLLOW
92  { TARGET::TGT_O_NOFOLLOW, O_NOFOLLOW },
93 #endif
94 #ifdef O_NOATIME
95  { TARGET::TGT_O_NOATIME, O_NOATIME },
96 #endif
97 #ifdef O_CLOEXEC
98  { TARGET::TGT_O_CLOEXEC, O_CLOEXEC },
99 #endif
100 #ifdef O_SYNC
101  { TARGET::TGT_O_SYNC, O_SYNC },
102 #endif
103 #ifdef O_PATH
104  { TARGET::TGT_O_PATH, O_PATH },
105 #endif
106 #endif /* _MSC_VER */
107 };
108 
109 const int TARGET::NUM_OPEN_FLAGS =
110  sizeof(TARGET::openFlagTable) / sizeof(TARGET::openFlagTable[0]);
SyscallFlagTransTable
This struct is used to build target-OS-dependent tables that map the target's flags to the host's fla...
Definition: operatingsystem.hh:41

Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17