debugreg.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
/* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
/* All Rights Reserved */
#ifndef _SYS_DEBUGREG_H
#define _SYS_DEBUGREG_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Specify masks for accessing the i386 debug registers.
*/
/*
* The debug registers are found in an array (debugreg) in the u block.
* On the i386, there are 4 registers to specify linear addresses.
* dr4 and dr5 are reserved.
*/
#define DR_FIRSTADDR 0 /* u.u_debugreg[DR_FIRSTADDR] */
/*
* The debug status is found in dr6 after a debug trap.
*/
/*
* dr7 controls the rest of the debug registers.
* use shifts and masks because arrays of fields tend to get aligned.
* For example,
* dr7 & DR_LOCAL_ENABLE_MASK
* dr7 >> (DR_LOCAL_ENABLE_SHIFT + r# * DR_ENABLE_SIZE) & 0x1
* dr7 >> (DR_CONTROL_SHIFT + r# * DR_CONTROL_SIZE) & DR_RW_MASK
* Note that the GLOBAL bits below and always turned off by the kernel.
*/
#define DR_LOCAL_ENABLE_SHIFT 0 /* Additional shift: local enable */
#define DR_RW_WRITE 0x1
#define DR_RW_READ 0x3
#define DR_LEN_2 0x4
#define DR_LEN_4 0xC
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DEBUGREG_H */