Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / legion / src / procs / sparcv9 / include / tsparcv9.h
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: tsparcv9.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _TSPARCV9_H_
#define _TSPARCV9_H_
#pragma ident "@(#)tsparcv9.h 1.22 07/05/30 SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* Target SPARC v9 definitions */
/* interface functions and data structs */
typedef enum {
/* MANDATORY SPARC V9 ASIs */
/* RW Implicit Address Space, nucleus context, TL>0 */
V9_ASI_NUCLEUS = 0x4,
/* RW Implicit Address Space, nucleus context, TL>0 (LE) */
V9_ASI_NUCLEUS_LITTLE = 0xc,
/* RW Primary Address Space, user privilege */
V9_ASI_AS_IF_USER_PRIMARY = 0x10,
/* RW Secondary Address Space, user privilege */
V9_ASI_AS_IF_USER_SECONDARY = 0x11,
/* RW Primary Address Space, user privilege (LE) */
V9_ASI_AS_IF_USER_PRIMARY_LITTLE = 0x18,
/* RW Secondary Address Space, user privilege (LE) */
V9_ASI_AS_IF_USER_SECONDARY_LITTLE = 0x19,
/* RW Implicit Primary Address space */
V9_ASI_PRIMARY = 0x80,
/* RW Implicit Secondary Address space */
V9_ASI_SECONDARY = 0x81,
/* R Primary Address space, no fault */
V9_ASI_PRIMARY_NO_FAULT = 0x82,
/* R Secondary Address space, no fault */
V9_ASI_SECONDARY_NO_FAULT = 0x83,
/* RW Implicit Primary Address space (LE) */
V9_ASI_PRIMARY_LITTLE = 0x88,
/* RW Implicit Secondary Address space (LE) */
V9_ASI_SECONDARY_LITTLE = 0x89,
/* R Primary Address space, no fault (LE) */
V9_ASI_PRIMARY_NO_FAULT_LITTLE = 0x8A,
/* R Secondary Address space, no fault (LE) */
V9_ASI_SECONDARY_NO_FAULT_LITTLE = 0x8B
} v9_asi_t;
#define V9_ASI_IMPLICIT ((uint_t)-1)
typedef struct SPARCV9_CPU sparcv9_cpu_t;
extern sparcv9_cpu_t *sparcv9_cpu_alloc(
domain_t *domainp,
config_proc_t *config_procp,
uint_t nwins,
uint_t nglobals,
uint_t maxtl,
uint64_t ver,
bool_t has_fpu,
void *magicptr);
bool_t sparcv9_regread(sparcv9_cpu_t *v9p, uint_t regnum, uint64_t *valp);
bool_t sparcv9_regwrite(sparcv9_cpu_t *v9p, uint_t regnum, uint64_t val);
void sparcv9_set_break(sparcv9_cpu_t *v9p, tvaddr_t addr);
void sparcv9_set_break_next(sparcv9_cpu_t *v9p);
void sparcv9_clear_break_next(sparcv9_cpu_t *v9p);
bool_t sparcv9_hit_break(sparcv9_cpu_t *v9p, tvaddr_t addr);
void sparcv9_clear_break(sparcv9_cpu_t *v9p, tvaddr_t addr);
void sparcv9_print_break(sparcv9_cpu_t *v9p);
void sparcv9_dump_break(sparcv9_cpu_t *v9p, FILE *fp);
void sparcv9_restore_break(FILE *fp);
void sparcv9_active_window(simcpu_t *sp, uint_t new_window);
void sparcv9_active_globals(simcpu_t *sp, uint_t new_global);
void sparcv9_perf_dump(void *v9p);
void sparcv9_decode_me(simcpu_t *sp, xicache_instn_t *xcip);
extern reg_map_t sparcv9_reg_map[];
extern void sparcv9_idis(char *bufp, uint_t size, uint32_t instn,
tvaddr_t address);
extern void sparcv9_trace_output(simcpu_t *sp, uint32_t instn);
extern void sparcv9_dump_stack(simcpu_t *sp);
extern void v9_set_fsr_fp_op(simcpu_t *, uint64_t);
extern uint64_t v9_get_fsr(simcpu_t *);
extern void v9_set_fsr(simcpu_t *, uint64_t);
#ifdef __cplusplus
}
#endif
#endif /* _TSPARCV9_H_ */