2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
31 * Revision 1.1.1.1 1998/09/22 21:05:48 wsanchez
32 * Import of Mac OS X kernel (~semeria)
34 * Revision 1.1.1.1 1998/03/07 02:26:09 wsanchez
35 * Import of OSF Mach kernel (~mburg)
37 * Revision 1.1.9.1 1994/09/23 01:22:09 ezf
38 * change marker to not FREE
39 * [1994/09/22 21:11:13 ezf]
41 * Revision 1.1.7.4 1994/03/17 22:35:38 dwm
42 * The infamous name change: thread_activation + thread_shuttle = thread.
43 * [1994/03/17 21:25:53 dwm]
45 * Revision 1.1.7.3 1994/02/03 21:44:27 bolinger
46 * Change a surviving current_thread() to current_act().
47 * [1994/02/03 20:48:03 bolinger]
49 * Revision 1.1.7.2 1994/01/12 17:50:56 dwm
50 * Coloc: initial restructuring to follow Utah model.
51 * [1994/01/12 17:13:27 dwm]
53 * Revision 1.1.7.1 1994/01/05 19:28:18 bolinger
54 * Separate notions of "address space" and "task" (i.e., symbol table),
55 * via new macros db_current_space() and db_is_current_space(); also update
56 * db_target_space() to treat kernel-loaded tasks correctly.
57 * [1994/01/04 17:41:47 bolinger]
59 * Revision 1.1.2.4 1993/07/27 18:28:17 elliston
60 * Add ANSI prototypes. CR #9523.
61 * [1993/07/27 18:13:10 elliston]
63 * Revision 1.1.2.3 1993/06/07 22:06:58 jeffc
64 * CR9176 - ANSI C violations: trailing tokens on CPP
65 * directives, extra semicolons after decl_ ..., asm keywords
66 * [1993/06/07 18:57:35 jeffc]
68 * Revision 1.1.2.2 1993/06/02 23:12:46 jeffc
69 * Added to OSF/1 R1.3 from NMK15.0.
70 * [1993/06/02 20:57:32 jeffc]
72 * Revision 1.1 1992/09/30 02:24:23 robert
79 * Revision 2.2 91/10/09 16:03:18 af
80 * Revision 2.1.3.1 91/10/05 13:08:07 jeffreyh
81 * Created for task/thread handling.
84 * Revision 2.1.3.1 91/10/05 13:08:07 jeffreyh
85 * Created for task/thread handling.
91 * Mach Operating System
92 * Copyright (c) 1991,1990 Carnegie Mellon University
93 * All Rights Reserved.
95 * Permission to use, copy, modify and distribute this software and its
96 * documentation is hereby granted, provided that both the copyright
97 * notice and this permission notice appear in all copies of the
98 * software, derivative works or modified versions, and any portions
99 * thereof, and that both notices appear in supporting documentation.
101 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
102 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
103 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
105 * Carnegie Mellon requests users of this software to return to
107 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
108 * School of Computer Science
109 * Carnegie Mellon University
110 * Pittsburgh PA 15213-3890
112 * any improvements or extensions that they make and grant Carnegie Mellon
113 * the rights to redistribute these changes.
118 #ifndef _DDB_DB_TASK_THREAD_H_
119 #define _DDB_DB_TASK_THREAD_H_
121 #include <kern/task.h>
122 #include <kern/thread.h>
123 #include <kern/processor.h>
124 #include <ddb/db_variables.h> /* For db_var_aux_param_t */
127 * On behalf of kernel-loaded tasks, distinguish between current task
128 * (=> symbol table) and current address space (=> where [e.g.]
129 * breakpoints are set). From ddb's perspective, kernel-loaded tasks
130 * can retain their own symbol tables, but share the kernel's address
133 #define db_current_task() \
134 ((current_act())? current_act()->task: TASK_NULL)
135 #define db_current_space() \
136 ((current_act() && !current_act()->kernel_loaded)?\
137 current_act()->task: TASK_NULL)
138 #define db_target_space(thr_act, user_space) \
139 ((!(user_space) || ((thr_act) && (thr_act)->kernel_loaded))?\
142 (thr_act)->task: db_current_space())
143 #define db_is_current_space(task) \
144 ((task) == TASK_NULL || (task) == db_current_space())
146 extern task_t db_default_task
; /* default target task */
147 extern thread_act_t db_default_act
; /* default target thr_act */
150 /* Prototypes for functions exported by this module.
153 int db_lookup_act(thread_act_t target_act
);
155 int db_lookup_task(task_t target_task
);
157 int db_lookup_task_act(
159 thread_act_t target_act
);
161 boolean_t
db_check_act_address_valid(thread_act_t thr_act
);
163 boolean_t
db_get_next_act(
167 void db_init_default_act(void);
169 int db_set_default_act(
170 struct db_variable
*vp
,
173 db_var_aux_param_t ap
);
176 struct db_variable
*vp
,
179 db_var_aux_param_t ap
);
181 #endif /* !_DDB_DB_TASK_THREAD_H_ */