]> git.saurik.com Git - apple/xnu.git/blame_incremental - osfmk/ddb/db_access.h
xnu-792.10.96.tar.gz
[apple/xnu.git] / osfmk / ddb / db_access.h
... / ...
CommitLineData
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * @OSF_COPYRIGHT@
24 */
25/*
26 * Mach Operating System
27 * Copyright (c) 1991,1990 Carnegie Mellon University
28 * All Rights Reserved.
29 *
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
35 *
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
39 *
40 * Carnegie Mellon requests users of this software to return to
41 *
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
46 *
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
49 */
50/*
51 */
52/*
53 * Author: David B. Golub, Carnegie Mellon University
54 * Date: 7/90
55 */
56/*
57 * Data access functions for debugger.
58 */
59
60#ifndef _DDB_DB_ACCESS_H_
61#define _DDB_DB_ACCESS_H_
62
63#include <mach/boolean.h>
64#include <machine/db_machdep.h>
65#include <ddb/db_task_thread.h>
66
67/* implementation dependent access capability */
68#define DB_ACCESS_KERNEL 0 /* only kernel space */
69#define DB_ACCESS_CURRENT 1 /* kernel or current task space */
70#define DB_ACCESS_ANY 2 /* any space */
71
72#ifndef DB_ACCESS_LEVEL
73#define DB_ACCESS_LEVEL DB_ACCESS_KERNEL
74#endif /* DB_ACCESS_LEVEL */
75
76#ifndef DB_VALID_KERN_ADDR
77#define DB_VALID_KERN_ADDR(addr) ((addr) >= VM_MIN_KERNEL_ADDRESS \
78 && (addr) < VM_MAX_KERNEL_ADDRESS)
79#define DB_VALID_ADDRESS(addr,user) ((user != 0) ^ DB_VALID_KERN_ADDR(addr))
80#define DB_PHYS_EQ(task1,addr1,task2,addr2) 0
81#define DB_CHECK_ACCESS(addr,size,task) db_is_current_space(task)
82#endif /* DB_VALID_KERN_ADDR */
83
84extern int db_access_level;
85
86
87
88/* Prototypes for functions exported by ddb/db_access.c.
89 */
90db_expr_t db_get_task_value(
91 db_addr_t addr,
92 register int size,
93 boolean_t is_signed,
94 task_t task);
95
96void db_put_task_value(
97 db_addr_t addr,
98 register int size,
99 register db_expr_t value,
100 task_t task);
101
102db_expr_t db_get_value(
103 db_addr_t addr,
104 int size,
105 boolean_t is_signed);
106
107void db_put_value(
108 db_addr_t addr,
109 int size,
110 db_expr_t value);
111
112#endif /* !_DDB_DB_ACCESS_H_ */