osfpal.cc revision 2
14120SN/A/*
25417SN/A * Copyright (c) 2003 The Regents of The University of Michigan
34120SN/A * All rights reserved.
44120SN/A *
57087SN/A * Redistribution and use in source and binary forms, with or without
67087SN/A * modification, are permitted provided that the following conditions are
77087SN/A * met: redistributions of source code must retain the above copyright
87087SN/A * notice, this list of conditions and the following disclaimer;
97087SN/A * redistributions in binary form must reproduce the above copyright
107087SN/A * notice, this list of conditions and the following disclaimer in the
117087SN/A * documentation and/or other materials provided with the distribution;
127087SN/A * neither the name of the copyright holders nor the names of its
134120SN/A * contributors may be used to endorse or promote products derived from
147087SN/A * this software without specific prior written permission.
157087SN/A *
167087SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
177087SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
187087SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
197087SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
207087SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
217087SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
224120SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
237087SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
244120SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254120SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
264120SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274120SN/A */
284120SN/A
294120SN/A#include "osfpal.hh"
304120SN/A
314120SN/Anamespace {
324120SN/A    const char *strings[PAL::NumCodes] = {
334120SN/A        // Priviledged PAL instructions
344120SN/A        "halt",		// 0x00
354120SN/A        "cflush",	// 0x01
364120SN/A        "draina",	// 0x02
374120SN/A        0,		// 0x03
384120SN/A        0,		// 0x04
394120SN/A        0,		// 0x05
408105Sgblack@eecs.umich.edu        0,		// 0x06
418105Sgblack@eecs.umich.edu        0,		// 0x07
424120SN/A        0,		// 0x08
434152SN/A        "cserve",	// 0x09
444152SN/A        "swppal",	// 0x0a
454152SN/A        0,		// 0x0b
464152SN/A        0,		// 0x0c
474152SN/A        "wripir",	// 0x0d
484152SN/A        0,		// 0x0e
497629SN/A        0,		// 0x0f
505182SN/A        "rdmces",	// 0x10
514152SN/A        "wrmces",	// 0x11
524152SN/A        0,		// 0x12
534120SN/A        0,		// 0x13
544120SN/A        0,		// 0x14
554120SN/A        0,		// 0x15
569180Sandreas.hansson@arm.com        0,		// 0x16
574152SN/A        0,		// 0x17
584152SN/A        0,		// 0x18
595417SN/A        0,		// 0x19
605360SN/A        0,		// 0x1a
615417SN/A        0,		// 0x1b
625417SN/A        0,		// 0x1c
635417SN/A        0,		// 0x1d
645417SN/A        0,		// 0x1e
659180Sandreas.hansson@arm.com        0,		// 0x1f
664152SN/A        0,		// 0x20
674152SN/A        0,		// 0x21
689180Sandreas.hansson@arm.com        0,		// 0x22
694152SN/A        0,		// 0x23
704152SN/A        0,		// 0x24
715417SN/A        0,		// 0x25
725357SN/A        0,		// 0x26
735647SN/A        0,		// 0x27
745648SN/A        0,		// 0x28
755417SN/A        0,		// 0x29
765417SN/A        0,		// 0x2a
775417SN/A        "wrfen",	// 0x2b
785417SN/A        0,		// 0x2c
799180Sandreas.hansson@arm.com        "wrvptptr",	// 0x2d
804152SN/A        0,		// 0x2e
818902Sandreas.hansson@arm.com        0,		// 0x2f
824120SN/A        "swpctx",	// 0x30
838105Sgblack@eecs.umich.edu        "wrval",	// 0x31
84        "rdval",	// 0x32
85        "tbi",		// 0x33
86        "wrent",	// 0x34
87        "swpipl",	// 0x35
88        "rdps",		// 0x36
89        "wrkgp",	// 0x37
90        "wrusp",	// 0x38
91        "wrperfmon",	// 0x39
92        "rdusp",	// 0x3a
93        0,		// 0x3b
94        "whami",	// 0x3c
95        "retsys",	// 0x3d
96        "wtint",	// 0x3e
97        "rti",		// 0x3f
98        0,		// 0x40
99        0,		// 0x41
100        0,		// 0x42
101        0,		// 0x43
102        0,		// 0x44
103        0,		// 0x45
104        0,		// 0x46
105        0,		// 0x47
106        0,		// 0x48
107        0,		// 0x49
108        0,		// 0x4a
109        0,		// 0x4b
110        0,		// 0x4c
111        0,		// 0x4d
112        0,		// 0x4e
113        0,		// 0x4f
114        0,		// 0x50
115        0,		// 0x51
116        0,		// 0x52
117        0,		// 0x53
118        0,		// 0x54
119        0,		// 0x55
120        0,		// 0x56
121        0,		// 0x57
122        0,		// 0x58
123        0,		// 0x59
124        0,		// 0x5a
125        0,		// 0x5b
126        0,		// 0x5c
127        0,		// 0x5d
128        0,		// 0x5e
129        0,		// 0x5f
130        0,		// 0x60
131        0,		// 0x61
132        0,		// 0x62
133        0,		// 0x63
134        0,		// 0x64
135        0,		// 0x65
136        0,		// 0x66
137        0,		// 0x67
138        0,		// 0x68
139        0,		// 0x69
140        0,		// 0x6a
141        0,		// 0x6b
142        0,		// 0x6c
143        0,		// 0x6d
144        0,		// 0x6e
145        0,		// 0x6f
146        0,		// 0x70
147        0,		// 0x71
148        0,		// 0x72
149        0,		// 0x73
150        0,		// 0x74
151        0,		// 0x75
152        0,		// 0x76
153        0,		// 0x77
154        0,		// 0x78
155        0,		// 0x79
156        0,		// 0x7a
157        0,		// 0x7b
158        0,		// 0x7c
159        0,		// 0x7d
160        0,		// 0x7e
161        0,		// 0x7f
162
163        // Unpriviledged PAL instructions
164        "bpt",		// 0x80
165        "bugchk",	// 0x81
166        0,		// 0x82
167        "callsys",	// 0x83
168        0,		// 0x84
169        0,		// 0x85
170        "imb",		// 0x86
171        0,		// 0x87
172        0,		// 0x88
173        0,		// 0x89
174        0,		// 0x8a
175        0,		// 0x8b
176        0,		// 0x8c
177        0,		// 0x8d
178        0,		// 0x8e
179        0,		// 0x8f
180        0,		// 0x90
181        0,		// 0x91
182        "urti",		// 0x92
183        0,		// 0x93
184        0,		// 0x94
185        0,		// 0x95
186        0,		// 0x96
187        0,		// 0x97
188        0,		// 0x98
189        0,		// 0x99
190        0,		// 0x9a
191        0,		// 0x9b
192        0,		// 0x9c
193        0,		// 0x9d
194        "rdunique",	// 0x9e
195        "wrunique",	// 0x9f
196        0,		// 0xa0
197        0,		// 0xa1
198        0,		// 0xa2
199        0,		// 0xa3
200        0,		// 0xa4
201        0,		// 0xa5
202        0,		// 0xa6
203        0,		// 0xa7
204        0,		// 0xa8
205        0,		// 0xa9
206        "gentrap",	// 0xaa
207        0,		// 0xab
208        0,		// 0xac
209        0,		// 0xad
210        "clrfen",	// 0xae
211        0,		// 0xaf
212        0,		// 0xb0
213        0,		// 0xb1
214        0,		// 0xb2
215        0,		// 0xb3
216        0,		// 0xb4
217        0,		// 0xb5
218        0,		// 0xb6
219        0,		// 0xb7
220        0,		// 0xb8
221        0,		// 0xb9
222        0,		// 0xba
223        0,		// 0xbb
224        0,		// 0xbc
225        0,		// 0xbd
226        "nphalt",	// 0xbe
227#if 0
228        0,		// 0xbf
229        0,		// 0xc0
230        0,		// 0xc1
231        0,		// 0xc2
232        0,		// 0xc3
233        0,		// 0xc4
234        0,		// 0xc5
235        0,		// 0xc6
236        0,		// 0xc7
237        0,		// 0xc8
238        0,		// 0xc9
239        0,		// 0xca
240        0,		// 0xcb
241        0,		// 0xcc
242        0,		// 0xcd
243        0,		// 0xce
244        0,		// 0xcf
245        0,		// 0xd0
246        0,		// 0xd1
247        0,		// 0xd2
248        0,		// 0xd3
249        0,		// 0xd4
250        0,		// 0xd5
251        0,		// 0xd6
252        0,		// 0xd7
253        0,		// 0xd8
254        0,		// 0xd9
255        0,		// 0xda
256        0,		// 0xdb
257        0,		// 0xdc
258        0,		// 0xdd
259        0,		// 0xde
260        0,		// 0xdf
261        0,		// 0xe0
262        0,		// 0xe1
263        0,		// 0xe2
264        0,		// 0xe3
265        0,		// 0xe4
266        0,		// 0xe5
267        0,		// 0xe6
268        0,		// 0xe7
269        0,		// 0xe8
270        0,		// 0xe9
271        0,		// 0xea
272        0,		// 0xeb
273        0,		// 0xec
274        0,		// 0xed
275        0,		// 0xee
276        0,		// 0xef
277        0,		// 0xf0
278        0,		// 0xf1
279        0,		// 0xf2
280        0,		// 0xf3
281        0,		// 0xf4
282        0,		// 0xf5
283        0,		// 0xf6
284        0,		// 0xf7
285        0,		// 0xf8
286        0,		// 0xf9
287        0,		// 0xfa
288        0,		// 0xfb
289        0,		// 0xfc
290        0,		// 0xfd
291        0,		// 0xfe
292        0		// 0xff
293#endif
294    };
295}
296
297const char *
298PAL::name(int index)
299{
300    if (index > NumCodes || index < 0)
301        return 0;
302
303    return strings[index];
304}
305