]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ddb/db_task_thread.c
xnu-792.12.6.tar.gz
[apple/xnu.git] / osfmk / ddb / db_task_thread.c
index 6ff2066a18f8f7cb88ffc5c0c86c75a26c60e902..59b17159f60c9d12f70d1ef487385c68a8fbbf69 100644 (file)
@@ -1,26 +1,31 @@
 /*
  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
+ * This file contains Original Code and/or Modifications of Original Code 
+ * as defined in and that are subject to the Apple Public Source License 
+ * Version 2.0 (the 'License'). You may not use this file except in 
+ * compliance with the License.  The rights granted to you under the 
+ * License may not be used to create, or enable the creation or 
+ * redistribution of, unlawful or unlicensed copies of an Apple operating 
+ * system, or to circumvent, violate, or enable the circumvention or 
+ * violation of, any terms of an Apple operating system software license 
+ * agreement.
+ *
+ * Please obtain a copy of the License at 
+ * http://www.opensource.apple.com/apsl/ and read it before using this 
  * file.
- * 
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
+ *
+ * The Original Code and all software distributed under the License are 
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
+ * Please see the License for the specific language governing rights and 
  * limitations under the License.
- * 
- * @APPLE_LICENSE_HEADER_END@
+ *
+ * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
  */
 /*
  * @OSF_COPYRIGHT@
@@ -73,7 +78,7 @@
 #define DB_MAX_PSETS   0x10000         /* max # of processor sets */
 
 task_t         db_default_task;        /* default target task */
-thread_act_t   db_default_act;         /* default target thr_act */
+thread_t       db_default_act;         /* default target thr_act */
 
 
 
@@ -81,7 +86,7 @@ thread_act_t  db_default_act;         /* default target thr_act */
  */
 task_t db_lookup_task_id(register int task_id);
 
-static thread_act_t db_lookup_act_id(
+static thread_t db_lookup_act_id(
        task_t   task,
        register int thread_id);
 
@@ -118,15 +123,15 @@ db_lookup_task(task_t target_task)
 int
 db_lookup_task_act(
        task_t          task,
-       thread_act_t    target_act)
+       thread_t        target_act)
 {
-       register thread_act_t thr_act;
+       register thread_t thr_act;
        register int act_id;
 
        act_id = 0;
        if (queue_first(&task->threads) == 0)
            return(-1);
-       queue_iterate(&task->threads, thr_act, thread_act_t, task_threads) {
+       queue_iterate(&task->threads, thr_act, thread_t, task_threads) {
            if (target_act == thr_act)
                return(act_id);
            if (act_id++ >= DB_MAX_THREADID)
@@ -140,7 +145,7 @@ db_lookup_task_act(
  * as the thread id.
  */
 int
-db_lookup_act(thread_act_t target_act)
+db_lookup_act(thread_t target_act)
 {
        register int act_id;
        register task_t task;
@@ -169,7 +174,7 @@ db_lookup_act(thread_act_t target_act)
  */
 int force_act_lookup = 0;
 boolean_t
-db_check_act_address_valid(thread_act_t thr_act)
+db_check_act_address_valid(thread_t thr_act)
 {
        if (!force_act_lookup && db_lookup_act(thr_act) < 0) {
            db_printf("Bad thr_act address 0x%x\n", thr_act);
@@ -205,23 +210,23 @@ db_lookup_task_id(register task_id)
 /*
  * convert (task_id, act_id) pair to thr_act address
  */
-static thread_act_t
+static thread_t
 db_lookup_act_id(
        task_t   task,
        register int act_id)
 {
-       register thread_act_t thr_act;
+       register thread_t thr_act;
 
        
        if (act_id > DB_MAX_THREADID)
-           return(THR_ACT_NULL);
+           return(THREAD_NULL);
        if (queue_first(&task->threads) == 0)
-           return(THR_ACT_NULL);
-       queue_iterate(&task->threads, thr_act, thread_act_t, task_threads) {
+           return(THREAD_NULL);
+       queue_iterate(&task->threads, thr_act, thread_t, task_threads) {
            if (act_id-- <= 0)
                return(thr_act);
        }
-       return(THR_ACT_NULL);
+       return(THREAD_NULL);
 }
 
 /*
@@ -230,15 +235,15 @@ db_lookup_act_id(
  */
 boolean_t
 db_get_next_act(
-       thread_act_t    *actp,
+       thread_t        *actp,
        int             position)
 {
        db_expr_t       value;
-       thread_act_t    thr_act;
+       thread_t        thr_act;
 
-       *actp = THR_ACT_NULL;
+       *actp = THREAD_NULL;
        if (db_expression(&value)) {
-           thr_act = (thread_act_t) value;
+           thr_act = (thread_t) value;
            if (!db_check_act_address_valid(thr_act)) {
                db_flush_lex();
                return(FALSE);
@@ -259,7 +264,7 @@ void
 db_init_default_act(void)
 {
        if (db_lookup_act(db_default_act) < 0) {
-           db_default_act = THR_ACT_NULL;
+           db_default_act = THREAD_NULL;
            db_default_task = TASK_NULL;
        } else
            db_default_task = db_default_act->task;
@@ -276,7 +281,7 @@ db_set_default_act(
        int                     flag,
        db_var_aux_param_t      ap)                     /* unused */
 {
-       thread_act_t    thr_act;
+       thread_t        thr_act;
        int             task_id;
        int             act_id;
 
@@ -296,8 +301,8 @@ db_set_default_act(
            *valuep = (db_expr_t) db_default_act;
            return(0);
        }
-       thr_act = (thread_act_t) *valuep;
-       if (thr_act != THR_ACT_NULL && !db_check_act_address_valid(thr_act))
+       thr_act = (thread_t) *valuep;
+       if (thr_act != THREAD_NULL && !db_check_act_address_valid(thr_act))
            db_error(0);
            /* NOTREACHED */
        db_default_act = thr_act;
@@ -317,7 +322,7 @@ db_get_task_act(
        db_var_aux_param_t      ap)
 {
        task_t                  task;
-       thread_act_t            thr_act;
+       thread_t                thr_act;
        int                     task_id;
 
        if (flag == DB_VAR_SHOW) {
@@ -341,7 +346,7 @@ db_get_task_act(
            *valuep = (db_expr_t) task;
            return(0);
        }
-       if ((thr_act = db_lookup_act_id(task, ap->suffix[1])) == THR_ACT_NULL){
+       if ((thr_act = db_lookup_act_id(task, ap->suffix[1])) == THREAD_NULL){
            db_printf("no such thr_act($task%d.%d)\n", 
                                        ap->suffix[0], ap->suffix[1]);
            db_error(0);