Searched refs:thread (Results 1 - 25 of 249) sorted by relevance

12345678910

/xnu-2422.115.4/osfmk/chud/
H A Dchud_thread.h33 #include <kern/thread.h>
H A Dchud_thread.c35 #include <kern/thread.h>
66 #pragma mark **** thread binding ****
70 * This method will bind a given thread to the requested CPU starting at the
71 * next time quantum. If the thread is the current thread, this method will
73 * current thread, you will be on the requested CPU when this method returns.
76 chudxnu_bind_thread(thread_t thread, int cpu, __unused int options) argument
84 if(thread != current_thread())
99 * If we're trying to bind the current thread, and
101 * context, block the current thread t
114 chudxnu_unbind_thread(thread_t thread, __unused int options) argument
122 chudxnu_thread_get_idle(thread_t thread) argument
134 chudxnu_thread_get_scheduler_state(thread_t thread) argument
259 thread_t thread, *thread_list = (thread_t *)addr; local
339 thread_t thread; local
517 chudxnu_task_for_thread(thread_t thread) argument
523 chudxnu_thread_info( thread_t thread, thread_flavor_t flavor, thread_info_t thread_info_out, mach_msg_type_number_t *thread_info_count) argument
536 chudxnu_thread_get_marked(thread_t thread) argument
544 chudxnu_thread_set_marked(thread_t thread, boolean_t new_value) argument
570 chudxnu_thread_ast(thread_t thread) argument
615 chudxnu_set_thread_bits( thread_t thread, uint32_t bits ) argument
625 chudxnu_thread_get_dirty(thread_t thread) argument
634 chudxnu_thread_set_dirty(thread_t thread, boolean_t makedirty) argument
[all...]
/xnu-2422.115.4/osfmk/mach/
H A Dthread_special_ports.h61 * Defines codes for special_purpose thread ports. These are NOT
70 #define THREAD_KERNEL_PORT 1 /* Represents the thread to the outside
77 #define thread_get_kernel_port(thread, port) \
78 (thread_get_special_port((thread), THREAD_KERNEL_PORT, (port)))
80 #define thread_set_kernel_port(thread, port) \
81 (thread_set_special_port((thread), THREAD_KERNEL_PORT, (port)))
/xnu-2422.115.4/osfmk/kern/
H A Dpriority.c74 #include <kern/thread.h>
82 * Recalculate the quantum and priority for a thread.
93 thread_t thread = p1; local
100 * We bill CPU time to both the individual thread and its task.
103 * thread, we must credit the ledger before taking the thread lock. The ledger
104 * pointers are only manipulated by the thread itself at the ast boundary.
106 ledger_credit(thread->t_ledger, task_ledgers.cpu_time, thread->current_quantum);
107 ledger_credit(thread
228 lightweight_update_priority(thread_t thread) argument
305 set_priority( register thread_t thread, register int priority) argument
325 compute_priority( register thread_t thread, boolean_t override_depress) argument
355 compute_my_priority( register thread_t thread) argument
373 can_update_priority( thread_t thread) argument
390 update_priority( register thread_t thread) argument
[all...]
H A Dthread_act.c63 #include <kern/thread.h>
88 * Internal routine to mark a thread as started.
89 * Always called with the thread locked.
95 * of the newly created thread. Commented out for now, in case we
100 thread_t thread)
102 clear_wait(thread, THREAD_AWAKENED);
103 thread->started = TRUE;
104 // DTRACE_PROC1(lwp__start, thread_t, thread);
108 * Internal routine to terminate a thread.
113 thread_t thread)
99 thread_start_internal( thread_t thread) argument
112 thread_terminate_internal( thread_t thread) argument
148 thread_terminate( thread_t thread) argument
185 thread_hold( register thread_t thread) argument
202 thread_release( register thread_t thread) argument
216 thread_suspend( register thread_t thread) argument
247 thread_resume( register thread_t thread) argument
285 thread_depress_abort( register thread_t thread) argument
313 act_abort( thread_t thread) argument
332 thread_abort( register thread_t thread) argument
355 thread_abort_safely( thread_t thread) argument
393 thread_info( thread_t thread, thread_flavor_t flavor, thread_info_t thread_info_out, mach_msg_type_number_t *thread_info_count) argument
418 thread_get_state( register thread_t thread, int flavor, thread_state_t state, mach_msg_type_number_t *state_count) argument
467 thread_set_state_internal( register thread_t thread, int flavor, thread_state_t state, mach_msg_type_number_t state_count, boolean_t from_user) argument
524 thread_set_state( register thread_t thread, int flavor, thread_state_t state, mach_msg_type_number_t state_count) argument
534 thread_set_state_from_user( register thread_t thread, int flavor, thread_state_t state, mach_msg_type_number_t state_count) argument
551 thread_state_initialize( register thread_t thread) argument
638 thread_setstatus( register thread_t thread, int flavor, thread_state_t tstate, mach_msg_type_number_t count) argument
654 thread_getstatus( register thread_t thread, int flavor, thread_state_t tstate, mach_msg_type_number_t *count) argument
672 install_special_handler( thread_t thread) argument
691 install_special_handler_locked( thread_t thread) argument
733 thread_t thread = current_thread(); local
780 thread_t thread = current_thread(); local
811 special_handler( __unused ReturnHandler *rh, thread_t thread) argument
862 act_set_state( thread_t thread, int flavor, thread_state_t state, mach_msg_type_number_t count) argument
876 act_set_state_from_user( thread_t thread, int flavor, thread_state_t state, mach_msg_type_number_t count) argument
890 act_get_state( thread_t thread, int flavor, thread_state_t state, mach_msg_type_number_t *count) argument
903 act_set_ast( thread_t thread, ast_t ast) argument
930 act_set_astbsd( thread_t thread) argument
937 act_set_apc( thread_t thread) argument
944 act_set_kperf( thread_t thread) argument
957 act_set_astmacf( thread_t thread) argument
[all...]
H A Dthread_policy.c34 #include <kern/thread.h>
39 thread_t thread);
42 extern void proc_get_thread_policy(thread_t thread, thread_policy_state_t info);
46 thread_t thread,
52 if (thread == THREAD_NULL)
55 if (thread->static_param)
58 return (thread_policy_set_internal(thread, flavor, policy_info, count));
63 thread_t thread,
71 thread_mtx_lock(thread);
72 if (!thread
45 thread_policy_set( thread_t thread, thread_policy_flavor_t flavor, thread_policy_t policy_info, mach_msg_type_number_t count) argument
62 thread_policy_set_internal( thread_t thread, thread_policy_flavor_t flavor, thread_policy_t policy_info, mach_msg_type_number_t count) argument
245 thread_recompute_priority( thread_t thread) argument
275 thread_task_priority( thread_t thread, integer_t priority, integer_t max_priority) argument
307 thread_policy_reset( thread_t thread) argument
345 thread_policy_get( thread_t thread, thread_policy_flavor_t flavor, thread_policy_t policy_info, mach_msg_type_number_t *count, boolean_t *get_default) argument
[all...]
H A Dast.c77 #include <kern/thread.h>
111 thread_t thread = current_thread(); local
135 if (!(thread->state & TH_IDLE)) {
140 wait_queue_assert_possible(thread) ) {
162 thread_ast_clear(thread, AST_BSD);
163 bsd_ast(thread);
171 thread_ast_clear(thread, AST_MACF);
172 mac_thread_userret(thread);
182 thread_ast_clear(thread, AST_GUARD);
183 guard_ast(thread);
236 thread_t thread = processor->active_thread; local
[all...]
H A Dsched_prim.c96 #include <kern/thread.h>
195 static inline void runq_consider_incr_bound_count(processor_t processor, thread_t thread) argument
197 if (thread->bound_processor == PROCESSOR_NULL)
200 assert(thread->bound_processor == processor);
209 static inline void runq_consider_decr_bound_count(processor_t processor, thread_t thread) argument
211 if (thread->bound_processor == PROCESSOR_NULL)
214 assert(thread->bound_processor == processor);
239 thread_t thread,
244 thread_t thread,
249 thread_t thread,
827 thread_t thread = p0; local
852 thread_unblock( thread_t thread, wait_result_t wresult) argument
997 thread_go( thread_t thread, wait_result_t wresult) argument
1026 thread_mark_wait_locked( thread_t thread, wait_interrupt_t interruptible) argument
1082 thread_t thread = current_thread(); local
1101 thread_t thread; local
1144 thread_t thread = current_thread(); local
1185 thread_t thread = current_thread(); local
1229 thread_t thread = current_thread(); local
1265 thread_t thread = current_thread(); local
1384 thread_isoncpu(thread_t thread) argument
1420 thread_stop( thread_t thread, boolean_t until_not_runnable) argument
1505 thread_unstop( thread_t thread) argument
1547 thread_wait( thread_t thread, boolean_t until_not_runnable) argument
1612 clear_wait_internal( thread_t thread, wait_result_t wresult) argument
1661 clear_wait( thread_t thread, wait_result_t result) argument
1750 thread_select( thread_t thread, processor_t processor) argument
2001 thread_select_idle( thread_t thread, processor_t processor) argument
2107 thread_t thread; local
2139 thread_t thread; local
2217 thread_invoke( thread_t self, thread_t thread, ast_t reason) argument
2478 thread_dispatch( thread_t thread, thread_t self) argument
2817 thread_continue( register thread_t thread) argument
2844 thread_quantum_init(thread_t thread) argument
2855 sched_traditional_initial_quantum_size(thread_t thread) argument
2914 sched_traditional_fairshare_enqueue(thread_t thread) argument
2932 thread_t thread; local
2952 sched_traditional_fairshare_queue_remove(thread_t thread) argument
2995 thread_t thread; local
3029 run_queue_enqueue( run_queue_t rq, thread_t thread, integer_t options) argument
3069 run_queue_remove( run_queue_t rq, thread_t thread) argument
3100 fairshare_setrun( processor_t processor, thread_t thread) argument
3123 realtime_queue_insert( thread_t thread) argument
3173 realtime_setrun( processor_t processor, thread_t thread) argument
3280 processor_enqueue( processor_t processor, thread_t thread, integer_t options) argument
3307 processor_setrun( processor_t processor, thread_t thread, integer_t options) argument
3578 choose_processor( processor_set_t pset, processor_t processor, thread_t thread) argument
3808 thread_setrun( thread_t thread, integer_t options) argument
3935 thread_t next, thread; local
4019 thread_t thread = processor->active_thread; local
4060 set_sched_pri( thread_t thread, int priority) argument
4123 processor_queue_remove( processor_t processor, thread_t thread) argument
4167 thread_run_queue_remove( thread_t thread) argument
4241 thread_t thread; local
4291 thread_t thread; local
4347 thread_get_urgency(thread_t thread, uint64_t *arg1, uint64_t *arg2) argument
4392 processor_idle( thread_t thread, processor_t processor) argument
4569 thread_t thread; local
4602 thread_t thread; local
4763 register thread_t thread; local
4794 thread_t thread; local
4848 thread_eager_preemption(thread_t thread) argument
4854 thread_set_eager_preempt(thread_t thread) argument
4888 thread_clear_eager_preempt(thread_t thread) argument
4963 thread_runnable( thread_t thread) argument
[all...]
H A Dthread.c59 * File: kern/thread.c
93 #include <machine/thread.h>
114 #include <kern/thread.h>
153 static struct thread thread_template, init_thread;
157 thread_t thread);
182 * (ie when any thread's CPU consumption exceeds 70% of the limit, start taking user
199 * Fill in a template thread for fast initialization.
320 sizeof(struct thread),
321 thread_max * sizeof(struct thread),
322 THREAD_CHUNK * sizeof(struct thread),
358 thread_t thread = current_thread(); local
466 thread_deallocate( thread_t thread) argument
522 thread_t self, thread; local
594 thread_terminate_enqueue( thread_t thread) argument
613 thread_t thread; local
650 thread_stack_enqueue( thread_t thread) argument
664 thread_t thread = NULL; local
882 thread_t thread; local
939 thread_t thread; local
1016 thread_t thread; local
1052 thread_t thread; local
1083 thread_t thread; local
1109 thread_info_internal( register thread_t thread, thread_flavor_t flavor, thread_info_t thread_info_out, mach_msg_type_number_t *thread_info_count) argument
1321 thread_read_times( thread_t thread, time_value_t *user_time, time_value_t *system_time) argument
1354 thread_assign( __unused thread_t thread, __unused processor_set_t new_pset) argument
1368 thread_assign_default( thread_t thread) argument
1380 thread_get_assignment( thread_t thread, processor_set_t *pset) argument
1399 thread_wire_internal( host_priv_t host_priv, thread_t thread, boolean_t wired, boolean_t *prev_state) argument
1434 thread_wire( host_priv_t host_priv, thread_t thread, boolean_t wired) argument
1447 thread_guard_violation(thread_t thread, unsigned type) argument
1474 guard_ast(thread_t thread) argument
1517 thread_t thread = current_thread(); local
1652 thread_t thread = current_thread(); local
1707 thread_t thread = current_thread(); local
1913 sched_call_null( __unused int type, __unused thread_t thread) argument
1921 thread_sched_call( thread_t thread, sched_call_t call) argument
1929 thread_static_param( thread_t thread, boolean_t state) argument
1939 thread_tid( thread_t thread) argument
1953 thread_dispatchqaddr( thread_t thread) argument
1977 thread_reference( thread_t thread) argument
1994 dtrace_get_thread_predcache(thread_t thread) argument
2002 dtrace_get_thread_vtime(thread_t thread) argument
2010 dtrace_get_thread_tracing(thread_t thread) argument
2018 dtrace_get_thread_reentering(thread_t thread) argument
2026 dtrace_get_kernel_stack(thread_t thread) argument
2034 dtrace_calc_thread_recent_vtime(thread_t thread) argument
2049 dtrace_set_thread_predcache(thread_t thread, uint32_t predcache) argument
2055 dtrace_set_thread_vtime(thread_t thread, int64_t vtime) argument
2061 dtrace_set_thread_tracing(thread_t thread, int64_t accum) argument
2067 dtrace_set_thread_reentering(thread_t thread, boolean_t vbool) argument
2077 dtrace_set_thread_recover(thread_t thread, vm_offset_t recover) argument
2093 thread_t thread = current_thread(); local
2105 dtrace_thread_didexec(thread_t thread) argument
[all...]
H A Dsched_fixedpriority.c55 #include <kern/thread.h>
92 sched_fixedpriority_compute_priority(thread_t thread,
98 thread_t thread);
104 thread_t thread,
114 thread_t thread);
131 sched_fixedpriority_initial_quantum_size(thread_t thread);
140 sched_fixedpriority_can_update_priority(thread_t thread);
143 sched_fixedpriority_update_priority(thread_t thread);
146 sched_fixedpriority_lightweight_update_priority(thread_t thread);
149 sched_fixedpriority_quantum_expire(thread_t thread);
258 runq_consider_incr_bound_count(processor_t processor, thread_t thread) argument
272 runq_consider_decr_bound_count(processor_t processor, thread_t thread) argument
382 thread_t thread; local
402 sched_fixedpriority_compute_priority(thread_t thread, boolean_t override_depress) argument
414 sched_fixedpriority_choose_processor( processor_set_t pset, processor_t processor, thread_t thread) argument
421 sched_fixedpriority_processor_enqueue( processor_t processor, thread_t thread, integer_t options) argument
441 thread_t thread; local
471 sched_fixedpriority_processor_queue_remove( processor_t processor, thread_t thread) argument
611 sched_fixedpriority_update_priority(thread_t thread) argument
693 sched_fixedpriority_quantum_expire( thread_t thread) argument
[all...]
H A Dkpc_thread.c31 #include <kern/thread.h>
107 /* and schedule an AST for this thread... */
120 /* snapshot current PMCs and update counters in the current thread */
122 kpc_update_thread_counters( thread_t thread )
139 /* 2. apply delta to old thread */
140 if( thread->kpc_buf )
142 thread->kpc_buf[i] += cpu->cpu_kpc_buf[1][i] - cpu->cpu_kpc_buf[0][i];
164 /* get counter values for a thread */
168 thread_t thread = current_thread(); local
176 if( !thread
196 kpc_thread_create(thread_t thread) argument
207 kpc_thread_destroy(thread_t thread) argument
[all...]
H A Dmk_sp.c45 #include <kern/thread.h>
57 #include <kern/thread.h>
65 * Set scheduling policy & priority for thread.
69 thread_t thread,
75 if ( thread == THREAD_NULL ||
79 if (thread->static_param)
87 thread_lock(thread);
89 if ( (thread->sched_mode != TH_MODE_REALTIME) &&
90 (thread->saved_mode != TH_MODE_REALTIME) ) {
91 if (!(thread
68 thread_policy_common( thread_t thread, integer_t policy, integer_t priority) argument
162 thread_set_policy( thread_t thread, processor_set_t pset, policy_t policy, policy_base_t base, mach_msg_type_number_t base_count, policy_limit_t limit, mach_msg_type_number_t limit_count) argument
272 thread_policy( thread_t thread, policy_t policy, policy_base_t base, mach_msg_type_number_t count, boolean_t set_limit) argument
[all...]
H A Dsyscall_subr.h71 thread_t thread);
74 void *thread,
H A Dsched_prim.h74 #include <kern/thread.h>
86 /* Force a preemption point for a thread and wait for it to stop running */
88 thread_t thread,
93 thread_t thread);
95 /* Wait for a thread to stop running */
97 thread_t thread,
100 /* Unblock thread on wake up */
102 thread_t thread,
105 /* Unblock and dispatch thread */
107 thread_t thread,
[all...]
H A Dsched_grrr.c55 #include <kern/thread.h>
74 thread_t thread);
83 thread_t thread);
131 sched_grrr_compute_priority(thread_t thread,
137 thread_t thread);
142 thread_t thread,
152 thread_t thread);
169 sched_grrr_initial_quantum_size(thread_t thread);
178 sched_grrr_can_update_priority(thread_t thread);
181 sched_grrr_update_priority(thread_t thread);
327 sched_grrr_compute_priority(thread_t thread, boolean_t override_depress __unused) argument
334 sched_grrr_choose_processor( processor_set_t pset, processor_t processor, thread_t thread) argument
342 sched_grrr_processor_enqueue( processor_t processor, thread_t thread, integer_t options __unused) argument
362 thread_t thread; local
392 sched_grrr_processor_queue_remove( processor_t processor, thread_t thread) argument
586 thread_t thread; local
612 thread_t thread; local
708 grrr_enqueue( grrr_run_queue_t rq, thread_t thread) argument
757 thread_t thread; local
798 grrr_remove( grrr_run_queue_t rq, thread_t thread) argument
905 sched_grrr_fairshare_enqueue(thread_t thread) argument
918 thread_t thread; local
933 sched_grrr_fairshare_queue_remove(thread_t thread) argument
[all...]
H A Dthread.h59 * File: thread.h
126 #include <machine/thread.h>
128 struct thread { struct
130 * NOTE: The runq field in the thread structure has an unusual
135 * When the thread is on a wait queue, these first three fields
147 decl_simple_lock_data(,wake_lock) /* for thread stop / wait (wake_lock()) */
148 integer_t options; /* options set by thread itself */
154 #define TH_OPT_PRVT_CPULIMIT 0x0040 /* Thread has a thread-private CPU limit applied to it */
155 #define TH_OPT_IDLE_THREAD 0x0080 /* Thread is a per-processor idle thread */
163 * may be examined by this thread
686 thread_set_tag_internal(thread_t thread, uint16_t tag) argument
690 thread_get_tag_internal(thread_t thread) argument
[all...]
H A Dsyscall_subr.c70 #include <kern/thread.h>
103 * This boolean can be used by a thread waiting on a
104 * lock or condition: If FALSE is returned, the thread is justified
107 * returned, the thread should make one more check on the
252 * Context switch. User may supply thread hint.
258 register thread_t thread, self = current_thread(); local
314 thread = convert_port_to_thread(port);
317 if (thread == self) {
318 (void)thread_deallocate_internal(thread);
319 thread
475 thread_t thread = p0; local
492 thread_depress_abort_internal( thread_t thread) argument
[all...]
H A Dipc_tt.h96 /* Initialize a thread's IPC state */
98 thread_t thread);
101 thread_t thread);
104 thread_t thread);
106 /* Disable IPC access to a thread */
108 thread_t thread);
110 /* Clean up and destroy a thread's IPC state */
112 thread_t thread);
114 /* Clear out a thread's IPC state */
116 thread_t thread);
[all...]
H A Daffinity.c46 * and its thread membership. This includes its destruction when the task
48 * - The thread mutex protects a thread's affinity set membership, but in
49 * addition, the thread_lock is taken to write thread->affinity_set since this
52 * The lock ordering is: task lock, thread mutex, namespace mutex, thread lock.
74 static void affinity_set_add(affinity_set_t aset, thread_t thread);
75 static affinity_set_t affinity_set_remove(affinity_set_t aset, thread_t thread);
95 * Return the affinity tag for a thread.
96 * Called with the thread mute
99 thread_affinity_get(thread_t thread) argument
118 thread_affinity_set(thread_t thread, uint32_t tag) argument
334 thread_affinity_terminate(thread_t thread) argument
355 thread_affinity_exec(thread_t thread) argument
437 affinity_set_add(affinity_set_t aset, thread_t thread) argument
457 affinity_set_remove(affinity_set_t aset, thread_t thread) argument
[all...]
H A Daffinity.h45 * Affinity sets are used to advise (hint) thread placement.
59 extern void thread_affinity_terminate(thread_t thread);
72 extern kern_return_t thread_affinity_set(thread_t thread, uint32_t tag);
73 extern uint32_t thread_affinity_get(thread_t thread);
74 extern void thread_affinity_exec(thread_t thread);
H A Dipc_tt.c68 * Task and thread related IPC functions.
92 #include <kern/thread.h>
290 * (Or the current thread must be in the task.)
369 * (Or the current thread must be in the task.)
431 * Initialize a thread's IPC state.
438 thread_t thread)
446 thread->ith_self = kport;
447 thread->ith_sself = ipc_port_make_send(kport);
448 thread->exc_actions = NULL;
450 ipc_kobject_set(kport, (ipc_kobject_t)thread, IKOT_THREA
437 ipc_thread_init( thread_t thread) argument
462 ipc_thread_init_exc_actions( thread_t thread) argument
472 ipc_thread_destroy_exc_actions( thread_t thread) argument
483 ipc_thread_disable( thread_t thread) argument
501 ipc_thread_terminate( thread_t thread) argument
550 ipc_thread_reset( thread_t thread) argument
664 retrieve_thread_self_fast( thread_t thread) argument
731 thread_t thread = current_thread(); local
784 thread_get_special_port( thread_t thread, int which, ipc_port_t *portp) argument
833 thread_set_special_port( thread_t thread, int which, ipc_port_t port) argument
1377 thread_t thread = THREAD_NULL; local
1408 thread_t thread = THREAD_NULL; local
1558 convert_thread_to_port( thread_t thread) argument
1612 thread_set_exception_ports( thread_t thread, exception_mask_t exception_mask, ipc_port_t new_port, exception_behavior_t new_behavior, thread_state_flavor_t new_flavor) argument
1777 thread_swap_exception_ports( thread_t thread, exception_mask_t exception_mask, ipc_port_t new_port, exception_behavior_t new_behavior, thread_state_flavor_t new_flavor, exception_mask_array_t masks, mach_msg_type_number_t *CountCnt, exception_port_array_t ports, exception_behavior_array_t behaviors, thread_state_flavor_array_t flavors) argument
1988 thread_get_exception_ports( thread_t thread, exception_mask_t exception_mask, exception_mask_array_t masks, mach_msg_type_number_t *CountCnt, exception_port_array_t ports, exception_behavior_array_t behaviors, thread_state_flavor_array_t flavors) argument
[all...]
/xnu-2422.115.4/bsd/kern/
H A Dast.h37 #include <kern/thread.h>
/xnu-2422.115.4/osfmk/kperf/
H A Dkperf.h37 /* Helpers to get and set AST bits on a thread */
38 extern uint32_t kperf_get_thread_bits( thread_t thread );
39 extern void kperf_set_thread_bits( thread_t thread, uint32_t bits );
40 extern void kperf_set_thread_ast( thread_t thread );
59 extern void kperf_thread_ast_handler( thread_t thread );
/xnu-2422.115.4/bsd/sys/
H A Dvfs_context.h7 #include <kern/thread.h>
/xnu-2422.115.4/libsyscall/mach/
H A Dms_thread_switch.c68 mach_port_t thread,
74 result = syscall_thread_switch(thread, option, option_time);
67 thread_switch( mach_port_t thread, int option, mach_msg_timeout_t option_time) argument

Completed in 122 milliseconds

12345678910