4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami/*
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * CDDL HEADER START
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami *
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * The contents of this file are subject to the terms of the
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Common Development and Distribution License (the "License").
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * You may not use this file except in compliance with the License.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami *
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * or http://www.opensolaris.org/os/licensing.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * See the License for the specific language governing permissions
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * and limitations under the License.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami *
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * When distributing Covered Code, include this CDDL HEADER in each
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * If applicable, add the following below this CDDL HEADER, with the
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * fields enclosed by brackets "[]" replaced with your own identifying
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * information: Portions Copyright [yyyy] [name of copyright owner]
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami *
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * CDDL HEADER END
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami/*
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Use is subject to license terms.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami#include <stdio.h>
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami#include "_conv.h"
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami#include "symbols_sparc_msg.h"
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami#include <sys/elf_SPARC.h>
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami/*
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * SPARC specific register symbols
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramistatic const Msg registers[] = { 0,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_STO_REGISTERG1, MSG_STO_REGISTERG2, MSG_STO_REGISTERG3,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_STO_REGISTERG4, MSG_STO_REGISTERG5, MSG_STO_REGISTERG6,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami MSG_STO_REGISTERG7
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami};
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiconst char *
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiconv_sym_SPARC_value(Addr val, Conv_fmt_flags_t fmt_flags,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami Conv_inv_buf_t *inv_buf)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami{
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami if ((val < STO_SPARC_REGISTER_G1) || (val > STO_SPARC_REGISTER_G7)) {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (conv_invalid_val(inv_buf, val, fmt_flags));
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami } else {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami return (MSG_ORIG(registers[val]));
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami }
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami}