xref: /freebsd/contrib/processor-trace/libipt/internal/include/pti-disp_default.h (revision dd41de95a84d979615a2ef11df6850622bf6184e)
1 /*
2  * Copyright (c) 2017-2019, Intel Corporation
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  *  * Redistributions of source code must retain the above copyright notice,
8  *    this list of conditions and the following disclaimer.
9  *  * Redistributions in binary form must reproduce the above copyright notice,
10  *    this list of conditions and the following disclaimer in the documentation
11  *    and/or other materials provided with the distribution.
12  *  * Neither the name of Intel Corporation nor the names of its contributors
13  *    may be used to endorse or promote products derived from this software
14  *    without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef PTI_DISP_DEFAULT_H
30 #define PTI_DISP_DEFAULT_H
31 
32 #include <stdint.h>
33 
34 
35 static const uint8_t disp_default[4][4][8] = {
36 	/* Effective Addressing Mode: ptem_unknown. */ {
37 		/* MOD: 0 */ {
38 			/* RM: 0 */	0,
39 			/* RM: 1 */	0,
40 			/* RM: 2 */	0,
41 			/* RM: 3 */	0,
42 			/* RM: 4 */	0,
43 			/* RM: 5 */	0,
44 			/* RM: 6 */	0,
45 			/* RM: 7 */	0
46 		},
47 		/* MOD: 1 */ {
48 			/* RM: 0 */	0,
49 			/* RM: 1 */	0,
50 			/* RM: 2 */	0,
51 			/* RM: 3 */	0,
52 			/* RM: 4 */	0,
53 			/* RM: 5 */	0,
54 			/* RM: 6 */	0,
55 			/* RM: 7 */	0
56 		},
57 		/* MOD: 2 */ {
58 			/* RM: 0 */	0,
59 			/* RM: 1 */	0,
60 			/* RM: 2 */	0,
61 			/* RM: 3 */	0,
62 			/* RM: 4 */	0,
63 			/* RM: 5 */	0,
64 			/* RM: 6 */	0,
65 			/* RM: 7 */	0
66 		},
67 		/* MOD: 3 */ {
68 			/* RM: 0 */	0,
69 			/* RM: 1 */	0,
70 			/* RM: 2 */	0,
71 			/* RM: 3 */	0,
72 			/* RM: 4 */	0,
73 			/* RM: 5 */	0,
74 			/* RM: 6 */	0,
75 			/* RM: 7 */	0
76 		}
77 	},
78 
79 	/* Effective Addressing Mode: ptem_16bit. */ {
80 		/* MOD: 0 */ {
81 			/* RM: 0 */	0,
82 			/* RM: 1 */	0,
83 			/* RM: 2 */	0,
84 			/* RM: 3 */	0,
85 			/* RM: 4 */	0,
86 			/* RM: 5 */	0,
87 			/* RM: 6 */	2,
88 			/* RM: 7 */	0
89 		},
90 		/* MOD: 1 */ {
91 			/* RM: 0 */	1,
92 			/* RM: 1 */	1,
93 			/* RM: 2 */	1,
94 			/* RM: 3 */	1,
95 			/* RM: 4 */	1,
96 			/* RM: 5 */	1,
97 			/* RM: 6 */	1,
98 			/* RM: 7 */	1
99 		},
100 		/* MOD: 2 */ {
101 			/* RM: 0 */	2,
102 			/* RM: 1 */	2,
103 			/* RM: 2 */	2,
104 			/* RM: 3 */	2,
105 			/* RM: 4 */	2,
106 			/* RM: 5 */	2,
107 			/* RM: 6 */	2,
108 			/* RM: 7 */	2
109 		},
110 		/* MOD: 3 */ {
111 			/* RM: 0 */	0,
112 			/* RM: 1 */	0,
113 			/* RM: 2 */	0,
114 			/* RM: 3 */	0,
115 			/* RM: 4 */	0,
116 			/* RM: 5 */	0,
117 			/* RM: 6 */	0,
118 			/* RM: 7 */	0
119 		}
120 	},
121 
122 	/* Effective Addressing Mode: ptem_32bit. */ {
123 		/* MOD: 0 */ {
124 			/* RM: 0 */	0,
125 			/* RM: 1 */	0,
126 			/* RM: 2 */	0,
127 			/* RM: 3 */	0,
128 			/* RM: 4 */	0,
129 			/* RM: 5 */	4,
130 			/* RM: 6 */	0,
131 			/* RM: 7 */	0
132 		},
133 		/* MOD: 1 */ {
134 			/* RM: 0 */	1,
135 			/* RM: 1 */	1,
136 			/* RM: 2 */	1,
137 			/* RM: 3 */	1,
138 			/* RM: 4 */	1,
139 			/* RM: 5 */	1,
140 			/* RM: 6 */	1,
141 			/* RM: 7 */	1
142 		},
143 		/* MOD: 2 */ {
144 			/* RM: 0 */	4,
145 			/* RM: 1 */	4,
146 			/* RM: 2 */	4,
147 			/* RM: 3 */	4,
148 			/* RM: 4 */	4,
149 			/* RM: 5 */	4,
150 			/* RM: 6 */	4,
151 			/* RM: 7 */	4
152 		},
153 		/* MOD: 3 */ {
154 			/* RM: 0 */	0,
155 			/* RM: 1 */	0,
156 			/* RM: 2 */	0,
157 			/* RM: 3 */	0,
158 			/* RM: 4 */	0,
159 			/* RM: 5 */	0,
160 			/* RM: 6 */	0,
161 			/* RM: 7 */	0
162 		}
163 	},
164 
165 	/* Effective Addressing Mode: ptem_64bit. */ {
166 		/* MOD: 0 */ {
167 			/* RM: 0 */	0,
168 			/* RM: 1 */	0,
169 			/* RM: 2 */	0,
170 			/* RM: 3 */	0,
171 			/* RM: 4 */	0,
172 			/* RM: 5 */	4,
173 			/* RM: 6 */	0,
174 			/* RM: 7 */	0
175 		},
176 		/* MOD: 1 */ {
177 			/* RM: 0 */	1,
178 			/* RM: 1 */	1,
179 			/* RM: 2 */	1,
180 			/* RM: 3 */	1,
181 			/* RM: 4 */	1,
182 			/* RM: 5 */	1,
183 			/* RM: 6 */	1,
184 			/* RM: 7 */	1
185 		},
186 		/* MOD: 2 */ {
187 			/* RM: 0 */	4,
188 			/* RM: 1 */	4,
189 			/* RM: 2 */	4,
190 			/* RM: 3 */	4,
191 			/* RM: 4 */	4,
192 			/* RM: 5 */	4,
193 			/* RM: 6 */	4,
194 			/* RM: 7 */	4
195 		},
196 		/* MOD: 3 */ {
197 			/* RM: 0 */	0,
198 			/* RM: 1 */	0,
199 			/* RM: 2 */	0,
200 			/* RM: 3 */	0,
201 			/* RM: 4 */	0,
202 			/* RM: 5 */	0,
203 			/* RM: 6 */	0,
204 			/* RM: 7 */	0
205 		}
206 	}
207 };
208 
209 #endif /* PTI_DISP_DEFAULT_H */
210