X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/43866e378188c25dd1e2208016ab3cbeb086ae6c..5eebf7385fedb1517b66b53c28e5aa6bb0a2be50:/osfmk/kern/task.h diff --git a/osfmk/kern/task.h b/osfmk/kern/task.h index 8ac3686c4..3e4c87b3c 100644 --- a/osfmk/kern/task.h +++ b/osfmk/kern/task.h @@ -3,22 +3,19 @@ * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. * - * 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 - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * This 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. + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -113,7 +110,6 @@ typedef struct task { decl_mutex_data(,lock) /* Task's lock */ int ref_count; /* Number of references to me */ boolean_t active; /* Task has not been terminated */ - boolean_t kernel_loaded; /* Created with kernel_task_create() */ /* Miscellaneous */ vm_map_t map; /* Address space description */ @@ -133,11 +129,11 @@ typedef struct task { queue_chain_t swapped_tasks; /* list of non-resident tasks */ #endif /* TASK_SWAPPER */ - /* Activations in this task */ - queue_head_t thr_acts; /* list of thread_activations */ - int thr_act_count; - int res_act_count; - int active_act_count; /* have not terminate_self yet */ + /* Threads in this task */ + queue_head_t threads; + int thread_count; + int res_thread_count; + int active_thread_count; processor_set_t processor_set; /* processor set for new threads */ #if MACH_HOST @@ -153,8 +149,9 @@ typedef struct task { integer_t priority; /* base priority for threads */ integer_t max_priority; /* maximum priority for threads */ - /* Task security token */ + /* Task security and audit tokens */ security_token_t sec_token; + audit_token_t audit_token; /* Statistics */ time_value_t total_user_time; /* user time for dead threads */ @@ -190,6 +187,7 @@ typedef struct task { /* Ledgers */ struct ipc_port *wired_ledger_port; struct ipc_port *paged_ledger_port; + unsigned long priv_flags; /* privelege resource flags */ #if NORMA_TASK long child_node; /* if != -1, node for new children */ @@ -212,6 +210,9 @@ typedef struct task { #endif vm_offset_t system_shared_region; vm_offset_t dynamic_working_set; + uint32_t taskFeatures[2]; /* Special feature for this task */ +#define tf64BitAddr 0x80000000 /* Task has 64-bit addressing */ +#define tf64BitData 0x40000000 /* Task has 64-bit data registers */ } Task; #define task_lock(task) mutex_lock(&(task)->lock) @@ -225,18 +226,25 @@ typedef struct task { #define task_reference_locked(task) ((task)->ref_count++) +/* + * priv_flags definitions + */ +#define VM_BACKING_STORE_PRIV 0x1 + /* * Internal only routines */ +extern void task_backing_store_privileged( + task_t task); + /* Initialize task module */ extern void task_init(void); /* task create */ -extern kern_return_t task_create_local( +extern kern_return_t task_create_internal( task_t parent_task, boolean_t inherit_memory, - boolean_t kernel_loaded, task_t *child_task); /* OUT */ extern void consider_task_collect(void);