dev, virtio: properly set PCI address space to use IOREG
[gem5.git] / src / gpu-compute / code_enums.hh
1 /*
2 * Copyright (c) 2015 Advanced Micro Devices, Inc.
3 * All rights reserved.
4 *
5 * For use for simulation and test purposes only
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright notice,
11 * this list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 * 3. Neither the name of the copyright holder nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Author: Anthony Gutierrez
34 */
35
36 #ifndef __CODE_ENUMS_HH__
37 #define __CODE_ENUMS_HH__
38
39 #define IS_OT_GLOBAL(a) ((a)>=Enums::OT_GLOBAL_READ \
40 && (a)<=Enums::OT_GLOBAL_LDAS)
41 #define IS_OT_SHARED(a) ((a)>=Enums::OT_SHARED_READ \
42 && (a)<=Enums::OT_SHARED_LDAS)
43 #define IS_OT_PRIVATE(a) ((a)>=Enums::OT_PRIVATE_READ \
44 && (a)<=Enums::OT_PRIVATE_LDAS)
45 #define IS_OT_SPILL(a) ((a)>=Enums::OT_SPILL_READ \
46 && (a)<=Enums::OT_SPILL_LDAS)
47 #define IS_OT_READONLY(a) ((a)>=Enums::OT_READONLY_READ \
48 && (a)<=Enums::OT_READONLY_LDAS)
49 #define IS_OT_FLAT(a) ((a)>=Enums::OT_FLAT_READ && (a)<=Enums::OT_FLAT_LDAS)
50
51 #define IS_OT_LDAS(a) ((a)==Enums::OT_GLOBAL_LDAS||(a)==Enums::OT_SHARED_LDAS \
52 ||(a)==Enums::OT_PRIVATE_LDAS||(a)==Enums::OT_SPILL_LDAS \
53 ||(a)==Enums::OT_READONLY_LDAS||(a)==Enums::OT_FLAT_LDAS)
54
55 #define IS_OT_READ(a) ((a)==Enums::OT_GLOBAL_READ||(a)==Enums::OT_SHARED_READ \
56 ||(a)==Enums::OT_PRIVATE_READ||(a)==Enums::OT_SPILL_READ \
57 ||(a)==Enums::OT_READONLY_READ||(a)==Enums::OT_FLAT_READ)
58
59 #define IS_OT_READ_GM(a) \
60 ((a)==Enums::OT_GLOBAL_READ||(a)==Enums::OT_SPILL_READ \
61 ||(a)==Enums::OT_READONLY_READ)
62
63 #define IS_OT_READ_LM(a) ((a)==Enums::OT_SHARED_READ)
64
65 #define IS_OT_READ_RM(a) ((a)==Enums::OT_READONLY_READ)
66
67 #define IS_OT_READ_PM(a) ((a)==Enums::OT_PRIVATE_READ)
68
69 #define IS_OT_WRITE(a) \
70 ((a)==Enums::OT_GLOBAL_WRITE||(a)==Enums::OT_SHARED_WRITE \
71 ||(a)==Enums::OT_PRIVATE_WRITE||(a)==Enums::OT_SPILL_WRITE \
72 ||(a)==Enums::OT_READONLY_WRITE||(a)==Enums::OT_FLAT_WRITE)
73
74 #define IS_OT_WRITE_GM(a) \
75 ((a)==Enums::OT_GLOBAL_WRITE||(a)==Enums::OT_SPILL_WRITE \
76 ||(a)==Enums::OT_READONLY_WRITE)
77
78 #define IS_OT_WRITE_LM(a) ((a)==Enums::OT_SHARED_WRITE)
79
80 #define IS_OT_WRITE_PM(a) ((a)==Enums::OT_PRIVATE_WRITE)
81
82 #define IS_OT_ATOMIC(a) ((a)==Enums::OT_GLOBAL_ATOMIC \
83 ||(a)==Enums::OT_SHARED_ATOMIC \
84 ||(a)==Enums::OT_PRIVATE_ATOMIC \
85 ||(a)==Enums::OT_SPILL_ATOMIC \
86 ||(a)==Enums::OT_READONLY_ATOMIC \
87 ||(a)==Enums::OT_BOTH_MEMFENCE \
88 ||(a)==Enums::OT_FLAT_ATOMIC)
89
90 #define IS_OT_ATOMIC_GM(a) ((a)==Enums::OT_GLOBAL_ATOMIC \
91 ||(a)==Enums::OT_SPILL_ATOMIC \
92 ||(a)==Enums::OT_READONLY_ATOMIC \
93 ||(a)==Enums::OT_GLOBAL_MEMFENCE \
94 ||(a)==Enums::OT_BOTH_MEMFENCE)
95
96 #define IS_OT_ATOMIC_LM(a) ((a)==Enums::OT_SHARED_ATOMIC \
97 ||(a)==Enums::OT_SHARED_MEMFENCE)
98
99 #define IS_OT_ATOMIC_PM(a) ((a)==Enums::OT_PRIVATE_ATOMIC)
100
101 #define IS_OT_HIST(a) ((a)==Enums::OT_GLOBAL_HIST \
102 ||(a)==Enums::OT_SHARED_HIST \
103 ||(a)==Enums::OT_PRIVATE_HIST \
104 ||(a)==Enums::OT_SPILL_HIST \
105 ||(a)==Enums::OT_READONLY_HIST \
106 ||(a)==Enums::OT_FLAT_HIST)
107
108 #define IS_OT_HIST_GM(a) ((a)==Enums::OT_GLOBAL_HIST \
109 ||(a)==Enums::OT_SPILL_HIST \
110 ||(a)==Enums::OT_READONLY_HIST)
111
112 #define IS_OT_HIST_LM(a) ((a)==Enums::OT_SHARED_HIST)
113
114 #define IS_OT_HIST_PM(a) ((a)==Enums::OT_PRIVATE_HIST)
115
116 #endif // __CODE_ENUMS_HH__