FreeBSD/Linux Kernel Cross Reference
sys/ddb/db_access.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992,1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: db_access.h,v $
29 * Revision 2.7 93/11/17 16:19:15 dbg
30 * Added low-level access routines: db_read_bytes, db_write_bytes.
31 * [93/10/13 dbg]
32 *
33 * Revision 2.6 93/01/14 17:24:19 danner
34 * Enabled prototypes.
35 * [92/11/30 af]
36 *
37 * Revision 2.5 91/10/09 15:57:01 af
38 * Added declarations of db_{get,put}_task_value.
39 * Added definitions of implementation dependent access capability.
40 * Added default defines of space access check functions.
41 * [91/08/29 tak]
42 *
43 * Revision 2.4 91/05/14 15:31:48 mrt
44 * Correcting copyright
45 *
46 * Revision 2.3 91/02/05 17:05:49 mrt
47 * Changed to new Mach copyright
48 * [91/01/31 16:16:37 mrt]
49 *
50 * Revision 2.2 90/08/27 21:48:27 dbg
51 * Created.
52 * [90/08/07 dbg]
53 *
54 */
55 /*
56 * Author: David B. Golub, Carnegie Mellon University
57 * Date: 7/90
58 */
59 /*
60 * Data access functions for debugger.
61 */
62 #ifndef _DDB_DB_ACCESS_H_
63 #define _DDB_DB_ACCESS_H_
64
65 #include <mach/boolean.h>
66 #include <machine/db_machdep.h>
67 #include <ddb/db_task_thread.h>
68
69 /* implementation dependent access capability */
70 #define DB_ACCESS_KERNEL 0 /* only kernel space */
71 #define DB_ACCESS_CURRENT 1 /* kernel or current task space */
72 #define DB_ACCESS_ANY 2 /* any space */
73
74 #ifndef DB_ACCESS_LEVEL
75 #define DB_ACCESS_LEVEL DB_ACCESS_KERNEL
76 #endif /* DB_ACCESS_LEVEL */
77
78 #ifndef DB_VALID_KERN_ADDR
79 #define DB_VALID_KERN_ADDR(addr) ((addr) >= VM_MIN_KERNEL_ADDRESS \
80 && (addr) < VM_MAX_KERNEL_ADDRESS)
81 #define DB_VALID_ADDRESS(addr,user) ((user != 0) ^ DB_VALID_KERN_ADDR(addr))
82 #define DB_PHYS_EQ(task1,addr1,task2,addr2) 0
83 #define DB_CHECK_ACCESS(addr,size,task) db_is_current_task(task)
84 #endif /* DB_VALID_KERN_ADDR */
85
86 extern int db_access_level;
87
88 /*
89 * Read/write a word (or less) in the current task.
90 */
91 extern db_expr_t db_get_value( db_addr_t addr,
92 int size,
93 boolean_t is_signed );
94
95 extern void db_put_value( db_addr_t addr,
96 int size,
97 db_expr_t value );
98
99 /*
100 * Read/write a word (or less) in the specified task.
101 */
102 extern db_expr_t db_get_task_value( db_addr_t addr,
103 int size,
104 boolean_t is_signed,
105 task_t task );
106
107 extern void db_put_task_value( db_addr_t addr,
108 int size,
109 db_expr_t value,
110 task_t task );
111
112 /*
113 * Read/write arbitrary arrays of bytes.
114 */
115 extern void db_read_bytes( db_addr_t addr,
116 int size,
117 char * data,
118 task_t task);
119
120 extern void db_write_bytes(db_addr_t addr,
121 int size,
122 char * data,
123 task_t task);
124
125 #endif /* _DDB_DB_ACCESS_H_ */
Cache object: 0e79747138d8ac3844f212a3d39db5fc
|