watchpoint.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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_WATCHPOINT_H
#define _SYS_WATCHPOINT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <vm/seg_enum.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Definitions for the VM implementation of watchpoints.
*/
/*
* Each process with watchpoints has a linked list of watched areas.
* The list is kept sorted by user-level virtual address.
*/
typedef struct watched_area {
/*
* The list of watched areas maps into a list of pages with modified
* protections. The list is kept sorted by user-level virtual address.
*/
typedef struct watched_page {
short wp_read; /* number of WA_READ areas in this page */
short wp_write; /* number of WA_WRITE areas in this page */
short wp_exec; /* number of WA_EXEC areas in this page */
/* wp_flags */
#ifdef _KERNEL
/*
* These functions handle the necessary logic to perform the copy operation
* while ignoring watchpoints.
*/
extern int copyin_nowatch(const void *, void *, size_t);
extern int copyout_nowatch(const void *, void *, size_t);
extern int fuword32_nowatch(const void *, uint32_t *);
extern int suword32_nowatch(void *, uint32_t);
#ifdef _LP64
extern int suword64_nowatch(void *, uint64_t);
extern int fuword64_nowatch(const void *, uint64_t *);
#endif
/*
* Disable watchpoints for a given region of memory. When bracketed by these
* calls, functions can use copyops and ignore watchpoints.
*/
/*
*/
extern void watch_enable(kthread_id_t);
extern void watch_disable(kthread_id_t);
struct as;
struct proc;
struct k_siginfo;
extern void setallwatch(void);
enum seg_rw);
extern int undo_watch_step(struct k_siginfo *);
extern int wp_compare(const void *, const void *);
extern int wa_compare(const void *, const void *);
extern struct copyops watch_copyops;
avl_index_t *);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_WATCHPOINT_H */