1*4f680cc6SAli Bahrami /*
2*4f680cc6SAli Bahrami  * CDDL HEADER START
3*4f680cc6SAli Bahrami  *
4*4f680cc6SAli Bahrami  * The contents of this file are subject to the terms of the
5*4f680cc6SAli Bahrami  * Common Development and Distribution License (the "License").
6*4f680cc6SAli Bahrami  * You may not use this file except in compliance with the License.
7*4f680cc6SAli Bahrami  *
8*4f680cc6SAli Bahrami  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*4f680cc6SAli Bahrami  * or http://www.opensolaris.org/os/licensing.
10*4f680cc6SAli Bahrami  * See the License for the specific language governing permissions
11*4f680cc6SAli Bahrami  * and limitations under the License.
12*4f680cc6SAli Bahrami  *
13*4f680cc6SAli Bahrami  * When distributing Covered Code, include this CDDL HEADER in each
14*4f680cc6SAli Bahrami  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*4f680cc6SAli Bahrami  * If applicable, add the following below this CDDL HEADER, with the
16*4f680cc6SAli Bahrami  * fields enclosed by brackets "[]" replaced with your own identifying
17*4f680cc6SAli Bahrami  * information: Portions Copyright [yyyy] [name of copyright owner]
18*4f680cc6SAli Bahrami  *
19*4f680cc6SAli Bahrami  * CDDL HEADER END
20*4f680cc6SAli Bahrami  */
21*4f680cc6SAli Bahrami 
22*4f680cc6SAli Bahrami /*
23*4f680cc6SAli Bahrami  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24*4f680cc6SAli Bahrami  * Use is subject to license terms.
25*4f680cc6SAli Bahrami  */
26*4f680cc6SAli Bahrami 
27*4f680cc6SAli Bahrami #include <stdio.h>
28*4f680cc6SAli Bahrami #include "_conv.h"
29*4f680cc6SAli Bahrami #include "symbols_sparc_msg.h"
30*4f680cc6SAli Bahrami #include <sys/elf_SPARC.h>
31*4f680cc6SAli Bahrami 
32*4f680cc6SAli Bahrami /*
33*4f680cc6SAli Bahrami  * SPARC specific register symbols
34*4f680cc6SAli Bahrami  */
35*4f680cc6SAli Bahrami 
36*4f680cc6SAli Bahrami static const Msg registers[] = { 0,
37*4f680cc6SAli Bahrami 	MSG_STO_REGISTERG1,	MSG_STO_REGISTERG2, 	MSG_STO_REGISTERG3,
38*4f680cc6SAli Bahrami 	MSG_STO_REGISTERG4,	MSG_STO_REGISTERG5, 	MSG_STO_REGISTERG6,
39*4f680cc6SAli Bahrami 	MSG_STO_REGISTERG7
40*4f680cc6SAli Bahrami };
41*4f680cc6SAli Bahrami 
42*4f680cc6SAli Bahrami const char *
conv_sym_SPARC_value(Addr val,Conv_fmt_flags_t fmt_flags,Conv_inv_buf_t * inv_buf)43*4f680cc6SAli Bahrami conv_sym_SPARC_value(Addr val, Conv_fmt_flags_t fmt_flags,
44*4f680cc6SAli Bahrami     Conv_inv_buf_t *inv_buf)
45*4f680cc6SAli Bahrami {
46*4f680cc6SAli Bahrami 	if ((val < STO_SPARC_REGISTER_G1) || (val > STO_SPARC_REGISTER_G7)) {
47*4f680cc6SAli Bahrami 		return (conv_invalid_val(inv_buf, val, fmt_flags));
48*4f680cc6SAli Bahrami 	} else {
49*4f680cc6SAli Bahrami 		return (MSG_ORIG(registers[val]));
50*4f680cc6SAli Bahrami 	}
51*4f680cc6SAli Bahrami }
52