2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
28 * Revision 1.1.1.1 1998/09/22 21:05:48 wsanchez
29 * Import of Mac OS X kernel (~semeria)
31 * Revision 1.1.1.1 1998/03/07 02:26:09 wsanchez
32 * Import of OSF Mach kernel (~mburg)
34 * Revision 1.1.9.1 1994/09/23 01:22:09 ezf
35 * change marker to not FREE
36 * [1994/09/22 21:11:13 ezf]
38 * Revision 1.1.7.4 1994/03/17 22:35:38 dwm
39 * The infamous name change: thread_activation + thread_shuttle = thread.
40 * [1994/03/17 21:25:53 dwm]
42 * Revision 1.1.7.3 1994/02/03 21:44:27 bolinger
43 * Change a surviving current_thread() to current_act().
44 * [1994/02/03 20:48:03 bolinger]
46 * Revision 1.1.7.2 1994/01/12 17:50:56 dwm
47 * Coloc: initial restructuring to follow Utah model.
48 * [1994/01/12 17:13:27 dwm]
50 * Revision 1.1.7.1 1994/01/05 19:28:18 bolinger
51 * Separate notions of "address space" and "task" (i.e., symbol table),
52 * via new macros db_current_space() and db_is_current_space(); also update
53 * db_target_space() to treat kernel-loaded tasks correctly.
54 * [1994/01/04 17:41:47 bolinger]
56 * Revision 1.1.2.4 1993/07/27 18:28:17 elliston
57 * Add ANSI prototypes. CR #9523.
58 * [1993/07/27 18:13:10 elliston]
60 * Revision 1.1.2.3 1993/06/07 22:06:58 jeffc
61 * CR9176 - ANSI C violations: trailing tokens on CPP
62 * directives, extra semicolons after decl_ ..., asm keywords
63 * [1993/06/07 18:57:35 jeffc]
65 * Revision 1.1.2.2 1993/06/02 23:12:46 jeffc
66 * Added to OSF/1 R1.3 from NMK15.0.
67 * [1993/06/02 20:57:32 jeffc]
69 * Revision 1.1 1992/09/30 02:24:23 robert
76 * Revision 2.2 91/10/09 16:03:18 af
77 * Revision 2.1.3.1 91/10/05 13:08:07 jeffreyh
78 * Created for task/thread handling.
81 * Revision 2.1.3.1 91/10/05 13:08:07 jeffreyh
82 * Created for task/thread handling.
88 * Mach Operating System
89 * Copyright (c) 1991,1990 Carnegie Mellon University
90 * All Rights Reserved.
92 * Permission to use, copy, modify and distribute this software and its
93 * documentation is hereby granted, provided that both the copyright
94 * notice and this permission notice appear in all copies of the
95 * software, derivative works or modified versions, and any portions
96 * thereof, and that both notices appear in supporting documentation.
98 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
99 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
100 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
102 * Carnegie Mellon requests users of this software to return to
104 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
105 * School of Computer Science
106 * Carnegie Mellon University
107 * Pittsburgh PA 15213-3890
109 * any improvements or extensions that they make and grant Carnegie Mellon
110 * the rights to redistribute these changes.
115 #ifndef _DDB_DB_TASK_THREAD_H_
116 #define _DDB_DB_TASK_THREAD_H_
118 #include <kern/task.h>
119 #include <kern/thread.h>
120 #include <kern/processor.h>
121 #include <ddb/db_variables.h> /* For db_var_aux_param_t */
124 * On behalf of kernel-loaded tasks, distinguish between current task
125 * (=> symbol table) and current address space (=> where [e.g.]
126 * breakpoints are set). From ddb's perspective, kernel-loaded tasks
127 * can retain their own symbol tables, but share the kernel's address
130 #define db_current_task() \
131 ((current_act())? current_act()->task: TASK_NULL)
132 #define db_current_space() \
133 ((current_act() && !current_act()->kernel_loaded)?\
134 current_act()->task: TASK_NULL)
135 #define db_target_space(thr_act, user_space) \
136 ((!(user_space) || ((thr_act) && (thr_act)->kernel_loaded))?\
139 (thr_act)->task: db_current_space())
140 #define db_is_current_space(task) \
141 ((task) == TASK_NULL || (task) == db_current_space())
143 extern task_t db_default_task
; /* default target task */
144 extern thread_act_t db_default_act
; /* default target thr_act */
147 /* Prototypes for functions exported by this module.
150 int db_lookup_act(thread_act_t target_act
);
152 int db_lookup_task(task_t target_task
);
154 int db_lookup_task_act(
156 thread_act_t target_act
);
158 boolean_t
db_check_act_address_valid(thread_act_t thr_act
);
160 boolean_t
db_get_next_act(
164 void db_init_default_act(void);
166 int db_set_default_act(
167 struct db_variable
*vp
,
170 db_var_aux_param_t ap
);
173 struct db_variable
*vp
,
176 db_var_aux_param_t ap
);
178 #endif /* !_DDB_DB_TASK_THREAD_H_ */