Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / legion / src / procs / sunsparc / debug / debug_log.c
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: debug_log.c
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "@(#)debug_log.c 1.3 06/10/25 SMI"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <assert.h>
#include <string.h>
#include <strings.h>
#include "ss_common.h"
#include "niagara.h"
#if 1
#define DBGP(s) do { s } while (0)
#endif
void dbg_debug_log(simcpu_t *sp, uint32_t rawi);
void dbg_debug_log_parse(void);
void dbg_debug_log_dump(void);
extern void debug_log(simcpu_t *sp, uint32_t rawi);
extern void debug_log_print(void);
/*
* Will be called while parsing the conf file
* to allow this hook to parse specific options from
* the conf file.
*
* Format of debug_log directive is:
* debug_hook debug_log
* XXX FIXME: we could add a token here to specify the
* size of the debug_log
* XXX FIXME: we could add a token here to specify the
* the %pc or instn count to start the debug_log
*
*/
void
dbg_debug_log_parse(void)
{
DBGP(printf("\nInside dbg_debug_log_parse();"););
}
/*
* This function will get called before each instruction
* gets executed.
*/
void
dbg_debug_log(simcpu_t *sp, uint32_t rawi)
{
/*
* call back to legions existing debug_log routine
*/
debug_log(sp, rawi);
}
/*
* This function will get called when ~l is input on the console
*/
void
dbg_debug_log_dump(void)
{
DBGP(printf("\ndebug_log_dump() - calling debug_log_print()\n"););
/*
* call back to legions existing debug_log_print routine
*/
debug_log_print();
}