]> git.saurik.com Git - apple/xnu.git/blame - osfmk/ddb/db_task_thread.h
xnu-517.12.7.tar.gz
[apple/xnu.git] / osfmk / ddb / db_task_thread.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
e5568f75
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.
1c79356b 11 *
e5568f75
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
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
e5568f75
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.
1c79356b
A
19 *
20 * @APPLE_LICENSE_HEADER_END@
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() \
69 ((current_act())? current_act()->task: TASK_NULL)
70#define db_current_space() \
55e303ae 71 ((current_act())?\
1c79356b
A
72 current_act()->task: TASK_NULL)
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
81extern task_t db_default_task; /* default target task */
82extern thread_act_t db_default_act; /* default target thr_act */
83
84
85/* Prototypes for functions exported by this module.
86 */
87
88int db_lookup_act(thread_act_t target_act);
89
90int db_lookup_task(task_t target_task);
91
92int db_lookup_task_act(
93 task_t task,
94 thread_act_t target_act);
95
96boolean_t db_check_act_address_valid(thread_act_t thr_act);
97
98boolean_t db_get_next_act(
99 thread_act_t *actp,
100 int position);
101
102void db_init_default_act(void);
103
104int 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
110int 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_ */