db_machdep.h revision 82004
180708Sjake/*-
280708Sjake * Copyright (c) 2001 Jake Burkholder.
380708Sjake * All rights reserved.
480708Sjake *
580708Sjake * Redistribution and use in source and binary forms, with or without
680708Sjake * modification, are permitted provided that the following conditions
780708Sjake * are met:
880708Sjake * 1. Redistributions of source code must retain the above copyright
980708Sjake *    notice, this list of conditions and the following disclaimer.
1080708Sjake * 2. Redistributions in binary form must reproduce the above copyright
1180708Sjake *    notice, this list of conditions and the following disclaimer in the
1280708Sjake *    documentation and/or other materials provided with the distribution.
1380708Sjake *
1481334Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1580708Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1680708Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1781334Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1880708Sjake * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1980708Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2080708Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2180708Sjake * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2280708Sjake * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2380708Sjake * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2480708Sjake * SUCH DAMAGE.
2580708Sjake *
2680708Sjake * $FreeBSD: head/sys/sparc64/include/db_machdep.h 82004 2001-08-20 23:35:15Z jake $
2780708Sjake */
2880708Sjake
2980708Sjake#ifndef	_MACHINE_DB_MACHDEP_H_
3080708Sjake#define	_MACHINE_DB_MACHDEP_H_
3180708Sjake
3280709Sjake#include <machine/frame.h>
3380709Sjake#include <machine/trap.h>
3480709Sjake
3580709Sjake#define	BYTE_MSF	(1)
3680709Sjake
3780709Sjaketypedef vm_offset_t	db_addr_t;
3882004Sjaketypedef long		db_expr_t;
3980709Sjake
4080709Sjakestruct db_regs {
4180709Sjake	u_long	dr_global[8];
4280709Sjake};
4380709Sjake
4480709Sjaketypedef struct trapframe db_regs_t;
4580709Sjakeextern db_regs_t ddb_regs;
4680709Sjake#define	DDB_REGS	(&ddb_regs)
4780709Sjake
4880709Sjake#define	PC_REGS(regs)	((db_addr_t)(regs)->tf_tpc)
4980709Sjake
5080709Sjake#define	BKPT_INST	(0)
5180709Sjake#define	BKPT_SIZE	(4)
5280709Sjake#define	BKPT_SET(inst)	(BKPT_INST)
5380709Sjake
5480709Sjake#define	FIXUP_PC_AFTER_BREAK do {					\
5580709Sjake	ddb_regs.tf_tpc = ddb_regs.tf_tnpc;				\
5680709Sjake	ddb_regs.tf_tnpc += BKPT_SIZE;					\
5780709Sjake} while (0);
5880709Sjake
5980709Sjake#define	db_clear_single_step(regs)
6080709Sjake#define	db_set_single_step(regs)
6180709Sjake
6280709Sjake#define	IS_BREAKPOINT_TRAP(type, code)	(type == T_BREAKPOINT)
6380709Sjake#define	IS_WATCHPOINT_TRAP(type, code)	(0)
6480709Sjake
6580709Sjake#define	inst_trap_return(ins)	(0)
6680709Sjake#define	inst_return(ins)	(0)
6780709Sjake#define	inst_call(ins)		(0)
6880709Sjake#define	inst_load(ins)		(0)
6980709Sjake#define	inst_store(ins)		(0)
7080709Sjake
7180709Sjake#define	DB_SMALL_VALUE_MAX	(0x7fffffff)
7280709Sjake#define	DB_SMALL_VALUE_MIN	(-0x40001)
7380709Sjake
7480709Sjake#define	DB_ELFSIZE		64
7580709Sjake
7680708Sjake#endif /* !_MACHINE_DB_MACHDEP_H_ */
77