]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
6601e61a | 4 | * @APPLE_LICENSE_HEADER_START@ |
1c79356b | 5 | * |
6601e61a A |
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. | |
8f6c56a5 | 11 | * |
6601e61a A |
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 | |
8f6c56a5 A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
6601e61a A |
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. | |
8f6c56a5 | 19 | * |
6601e61a | 20 | * @APPLE_LICENSE_HEADER_END@ |
1c79356b A |
21 | */ |
22 | /* | |
23 | * @OSF_COPYRIGHT@ | |
24 | */ | |
1c79356b A |
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 | #ifndef _DDB_DB_TASK_THREAD_H_ | |
54 | #define _DDB_DB_TASK_THREAD_H_ | |
55 | ||
56 | #include <kern/task.h> | |
57 | #include <kern/thread.h> | |
58 | #include <kern/processor.h> | |
59 | #include <ddb/db_variables.h> /* For db_var_aux_param_t */ | |
60 | ||
61 | /* | |
62 | * On behalf of kernel-loaded tasks, distinguish between current task | |
63 | * (=> symbol table) and current address space (=> where [e.g.] | |
64 | * breakpoints are set). From ddb's perspective, kernel-loaded tasks | |
65 | * can retain their own symbol tables, but share the kernel's address | |
66 | * space. | |
67 | */ | |
68 | #define db_current_task() \ | |
91447636 | 69 | ((current_thread())? current_thread()->task: TASK_NULL) |
1c79356b | 70 | #define db_current_space() \ |
91447636 A |
71 | ((current_thread())?\ |
72 | current_thread()->task: TASK_NULL) | |
1c79356b | 73 | #define db_target_space(thr_act, user_space) \ |
55e303ae | 74 | ((!(user_space) || ((thr_act)))?\ |
1c79356b A |
75 | TASK_NULL: \ |
76 | (thr_act)? \ | |
77 | (thr_act)->task: db_current_space()) | |
78 | #define db_is_current_space(task) \ | |
79 | ((task) == TASK_NULL || (task) == db_current_space()) | |
80 | ||
81 | extern task_t db_default_task; /* default target task */ | |
91447636 | 82 | extern thread_t db_default_act; /* default target thr_act */ |
1c79356b A |
83 | |
84 | ||
85 | /* Prototypes for functions exported by this module. | |
86 | */ | |
87 | ||
91447636 | 88 | int db_lookup_act(thread_t target_act); |
1c79356b A |
89 | |
90 | int db_lookup_task(task_t target_task); | |
91 | ||
92 | int db_lookup_task_act( | |
93 | task_t task, | |
91447636 | 94 | thread_t target_act); |
1c79356b | 95 | |
91447636 | 96 | boolean_t db_check_act_address_valid(thread_t thr_act); |
1c79356b A |
97 | |
98 | boolean_t db_get_next_act( | |
91447636 | 99 | thread_t *actp, |
1c79356b A |
100 | int position); |
101 | ||
102 | void db_init_default_act(void); | |
103 | ||
104 | int db_set_default_act( | |
105 | struct db_variable *vp, | |
106 | db_expr_t *valuep, | |
107 | int flag, | |
108 | db_var_aux_param_t ap); | |
109 | ||
110 | int db_get_task_act( | |
111 | struct db_variable *vp, | |
112 | db_expr_t *valuep, | |
113 | int flag, | |
114 | db_var_aux_param_t ap); | |
115 | ||
116 | #endif /* !_DDB_DB_TASK_THREAD_H_ */ |