| /kernel/include/arch/ |
| A D | debugger.h | 17 struct thread; 21 zx_status_t arch_get_general_regs(struct thread* thread, zx_thread_state_general_regs* out); 24 zx_status_t arch_get_fp_regs(struct thread* thread, zx_thread_state_fp_regs* out); 25 zx_status_t arch_set_fp_regs(struct thread* thread, const zx_thread_state_fp_regs* in); 30 zx_status_t arch_get_debug_regs(struct thread* thread, zx_thread_state_debug_regs* out); 33 zx_status_t arch_get_single_step(struct thread* thread, bool* single_step); 34 zx_status_t arch_set_single_step(struct thread* thread, bool single_step); 37 zx_status_t arch_get_x86_register_fs(struct thread* thread, uint64_t* out); 38 zx_status_t arch_set_x86_register_fs(struct thread* thread, const uint64_t* in); 41 zx_status_t arch_get_x86_register_gs(struct thread* thread, uint64_t* out); [all …]
|
| A D | thread.h | 16 struct thread; 18 void arch_thread_initialize(struct thread *, vaddr_t entry_point); 19 void arch_context_switch(struct thread *oldthread, struct thread *newthread); 20 void arch_thread_construct_first(struct thread *); 21 void* arch_thread_get_blocked_fp(struct thread *);
|
| /kernel/arch/arm64/ |
| A D | debugger.cpp | 28 zx_status_t arch_get_general_regs(struct thread* thread, zx_thread_state_general_regs_t* out) { in arch_get_general_regs() argument 70 zx_status_t arch_get_single_step(struct thread* thread, bool* single_step) { in arch_get_single_step() argument 86 zx_status_t arch_set_single_step(struct thread* thread, bool single_step) { in arch_set_single_step() argument 104 zx_status_t arch_get_fp_regs(struct thread* thread, zx_thread_state_fp_regs* out) { in arch_get_fp_regs() argument 110 zx_status_t arch_set_fp_regs(struct thread* thread, const zx_thread_state_fp_regs* in) { in arch_set_fp_regs() argument 116 zx_status_t arch_get_vector_regs(struct thread* thread, zx_thread_state_vector_regs* out) { in arch_get_vector_regs() argument 144 zx_status_t arch_get_debug_regs(struct thread* thread, zx_thread_state_debug_regs* out) { in arch_get_debug_regs() argument 188 zx_status_t arch_get_x86_register_fs(struct thread* thread, uint64_t* out) { in arch_get_x86_register_fs() argument 194 zx_status_t arch_set_x86_register_fs(struct thread* thread, const uint64_t* in) { in arch_set_x86_register_fs() argument 200 zx_status_t arch_get_x86_register_gs(struct thread* thread, uint64_t* out) { in arch_get_x86_register_gs() argument [all …]
|
| A D | fpu.cpp | 27 static void arm64_fpu_load_state(struct thread* t) { in arm64_fpu_load_state() 55 __NO_SAFESTACK static void arm64_fpu_save_state(struct thread* t) { in arm64_fpu_save_state() 91 __NO_SAFESTACK void arm64_fpu_context_switch(struct thread* oldthread, in arm64_fpu_context_switch() 92 struct thread* newthread) { in arm64_fpu_context_switch()
|
| /kernel/tests/ |
| A D | preempt_disable_tests.cpp | 25 thread_t* thread = get_current_thread(); in timer_callback_func() local 36 thread->preempt_pending = false; in timer_callback_func() 41 ASSERT(thread->preempt_pending); in timer_callback_func() 45 thread->preempt_pending = false; in timer_callback_func() 47 ASSERT(thread->preempt_pending); in timer_callback_func() 78 thread_t* thread = get_current_thread(); in test_inc_dec_disable_counts() local 120 thread_t* thread = get_current_thread(); in test_decrement_clears_preempt_pending() local 148 thread_t* thread = get_current_thread(); in test_blocking_clears_preempt_pending() local 181 thread_t* thread = get_current_thread(); in test_interrupt_preserves_preempt_pending() local 209 thread_t* thread = get_current_thread(); in test_interrupt_clears_preempt_pending() local [all …]
|
| /kernel/arch/x86/ |
| A D | debugger.cpp | 110 zx_status_t x86_get_set_vector_regs(struct thread* thread, zx_thread_state_vector_regs* regs, in x86_get_set_vector_regs() argument 261 zx_status_t arch_get_single_step(struct thread* thread, bool* single_step) { in arch_get_single_step() argument 286 zx_status_t arch_set_single_step(struct thread* thread, bool single_step) { in arch_set_single_step() argument 315 zx_status_t arch_get_fp_regs(struct thread* thread, zx_thread_state_fp_regs* out) { in arch_get_fp_regs() argument 338 zx_status_t arch_set_fp_regs(struct thread* thread, const zx_thread_state_fp_regs* in) { in arch_set_fp_regs() argument 358 zx_status_t arch_get_vector_regs(struct thread* thread, zx_thread_state_vector_regs* out) { in arch_get_vector_regs() argument 378 zx_status_t arch_get_debug_regs(struct thread* thread, zx_thread_state_debug_regs* out) { in arch_get_debug_regs() argument 434 zx_status_t arch_get_x86_register_fs(struct thread* thread, uint64_t* out) { in arch_get_x86_register_fs() argument 441 zx_status_t arch_set_x86_register_fs(struct thread* thread, const uint64_t* in) { in arch_set_x86_register_fs() argument 448 zx_status_t arch_get_x86_register_gs(struct thread* thread, uint64_t* out) { in arch_get_x86_register_gs() argument [all …]
|
| A D | smp.cpp | 83 thread_t* thread = static_cast<thread_t*>(calloc(1, sizeof(thread_t))); in x86_bringup_aps() local 84 if (!thread) { in x86_bringup_aps() 89 status = vm_allocate_kstack(&thread->stack); in x86_bringup_aps() 90 bootstrap_data->per_cpu[i].kstack_base = thread->stack.base; in x86_bringup_aps() 91 bootstrap_data->per_cpu[i].thread = thread; in x86_bringup_aps() 162 free_stack_and_thread(bootstrap_data->per_cpu[i].thread); in x86_bringup_aps() 163 bootstrap_data->per_cpu[i].thread = nullptr; in x86_bringup_aps() 179 free_stack_and_thread(bootstrap_data->per_cpu[i].thread); in x86_bringup_aps() 180 bootstrap_data->per_cpu[i].thread = nullptr; in x86_bringup_aps()
|
| A D | arch.cpp | 116 volatile int* aps_still_booting, thread_t* thread, uint cpu_num) { in finish_secondary_entry() argument 141 thread_secondary_cpu_init_early(thread); in finish_secondary_entry() 144 thread->flags |= THREAD_FLAG_FREE_STRUCT; in finish_secondary_entry() 163 thread_t* thread) { in x86_secondary_entry() argument 194 ROUNDDOWN(thread->stack.unsafe_base + thread->stack.size, 16)); in x86_secondary_entry() 201 finish_secondary_entry(aps_still_booting, thread, cpu_num); in x86_secondary_entry()
|
| A D | faults.cpp | 106 thread_t* thread = get_current_thread(); in call_dispatch_user_exception() local 107 x86_set_suspended_general_regs(&thread->arch, X86_GENERAL_REGS_IFRAME, frame); in call_dispatch_user_exception() 109 x86_reset_suspended_general_regs(&thread->arch); in call_dispatch_user_exception() 132 thread_t* thread = get_current_thread(); in x86_debug_handler() local 139 x86_read_debug_status(&thread->arch.debug_state); in x86_debug_handler() 330 thread_t* thread = get_current_thread(); in x86_iframe_process_pending_signals() local 331 if (unlikely(thread_is_signaled(thread))) { in x86_iframe_process_pending_signals() 334 x86_reset_suspended_general_regs(&thread->arch); in x86_iframe_process_pending_signals() 493 thread_t* thread = get_current_thread(); in x86_syscall_process_pending_signals() local 494 x86_set_suspended_general_regs(&thread->arch, X86_GENERAL_REGS_SYSCALL, gregs); in x86_syscall_process_pending_signals() [all …]
|
| /kernel/arch/x86/include/arch/ |
| A D | arch_thread.h | 59 static inline void x86_set_suspended_general_regs(struct arch_thread *thread, uint32_t source, void… in x86_set_suspended_general_regs() argument 61 DEBUG_ASSERT(thread->suspended_general_regs.gregs == NULL); in x86_set_suspended_general_regs() 64 thread->general_regs_source = source; in x86_set_suspended_general_regs() 65 thread->suspended_general_regs.gregs = gregs; in x86_set_suspended_general_regs() 68 static inline void x86_reset_suspended_general_regs(struct arch_thread *thread) in x86_reset_suspended_general_regs() argument 70 thread->general_regs_source = X86_GENERAL_REGS_NONE; in x86_reset_suspended_general_regs() 71 thread->suspended_general_regs.gregs = NULL; in x86_reset_suspended_general_regs()
|
| A D | current_thread.h | 15 static inline struct thread *get_current_thread(void) in get_current_thread() 21 return (struct thread *)x86_read_gs_offset64(PERCPU_CURRENT_THREAD_OFFSET); in get_current_thread() 24 static inline void set_current_thread(struct thread *t) in set_current_thread()
|
| /kernel/object/ |
| A D | exception.cpp | 55 explicit ExceptionPortIterator(ThreadDispatcher* thread) in ExceptionPortIterator() argument 56 : thread_(thread), in ExceptionPortIterator() 120 ThreadDispatcher* thread, in try_exception_handler() argument 155 ExceptionPortIterator iter(thread); in exception_handler_worker() 193 status, thread->process()->get_koid(), thread->get_koid()); in exception_handler_worker() 222 ThreadDispatcher* thread = ThreadDispatcher::GetCurrent(); in dispatch_user_exception() local 223 if (unlikely(!thread)) { in dispatch_user_exception() 238 thread->Exit(); in dispatch_user_exception() 247 auto process = thread->process(); in dispatch_user_exception() 256 thread->get_name(tname); in dispatch_user_exception() [all …]
|
| A D | excp_port.cpp | 160 DEBUG_ASSERT(thread != nullptr); in OnPortZeroHandles() 162 thread->ResetExceptionPort(); in OnPortZeroHandles() 249 zx_koid_t pid = thread->process()->get_koid(); in SendPacket() 250 zx_koid_t tid = thread->get_koid(); in SendPacket() 271 zx_koid_t pid = thread->process()->get_koid(); in OnThreadStartForDebugger() 272 zx_koid_t tid = thread->get_koid(); in OnThreadStartForDebugger() 296 zx_koid_t pid = thread->process()->get_koid(); in OnProcessStartForDebugger() 297 zx_koid_t tid = thread->get_koid(); in OnProcessStartForDebugger() 319 void ExceptionPort::OnThreadExitForDebugger(ThreadDispatcher* thread) { in OnThreadExitForDebugger() argument 324 zx_koid_t pid = thread->process()->get_koid(); in OnThreadExitForDebugger() [all …]
|
| A D | suspend_token_dispatcher.cpp | 23 if (auto thread = DownCastDispatcher<ThreadDispatcher>(&task)) { in SuspendTask() local 24 if (thread.get() == ThreadDispatcher::GetCurrent()) in SuspendTask() 26 return thread->Suspend(); in SuspendTask() 41 if (auto thread = DownCastDispatcher<ThreadDispatcher>(&task)) { in ResumeTask() local 42 thread->Resume(); in ResumeTask()
|
| A D | profile_dispatcher.cpp | 50 zx_status_t ProfileDispatcher::ApplyProfile(fbl::RefPtr<ThreadDispatcher> thread) { in ApplyProfile() argument 52 return thread->SetPriority(info_.scheduler.priority); in ApplyProfile()
|
| /kernel/arch/arm64/include/arch/ |
| A D | current_thread.h | 12 static inline struct thread* get_current_thread(void) { in get_current_thread() 23 tp -= offsetof(struct thread, arch.thread_pointer_location); in get_current_thread() 24 return (struct thread*)tp; in get_current_thread() 27 static inline void set_current_thread(struct thread* t) { in set_current_thread()
|
| A D | arm64.h | 98 struct thread; 112 void arm64_fpu_context_switch(struct thread* oldthread, struct thread* newthread);
|
| /kernel/lib/hypervisor/ |
| A D | cpu.cpp | 48 thread_t* thread = get_current_thread(); in pin_thread() local 49 thread_set_cpu_affinity(thread, cpu_num_to_mask(cpu_of(vpid))); in pin_thread() 50 return thread; in pin_thread() 53 bool check_pinned_cpu_invariant(uint16_t vpid, const thread_t* thread) { in check_pinned_cpu_invariant() argument 55 return thread == get_current_thread() && in check_pinned_cpu_invariant() 56 thread->cpu_affinity & cpu_num_to_mask(cpu) && in check_pinned_cpu_invariant()
|
| /kernel/syscalls/ |
| A D | exceptions.cpp | 45 auto thread = DownCastDispatcher<ThreadDispatcher>(&dispatcher); in object_unbind_exception_port() local 46 if (thread) { in object_unbind_exception_port() 49 return thread->ResetExceptionPort() ? ZX_OK : ZX_ERR_BAD_STATE; // No port was bound. in object_unbind_exception_port() 108 auto thread = DownCastDispatcher<ThreadDispatcher>(&dispatcher); in task_bind_exception_port() local 109 if (thread) { in task_bind_exception_port() 116 status = thread->SetExceptionPort(eport); in task_bind_exception_port() 120 eport->SetTarget(thread); in task_bind_exception_port() 150 fbl::RefPtr<ThreadDispatcher> thread; in sys_task_resume_from_exception() local 151 zx_status_t status = up->GetDispatcher(handle, &thread); in sys_task_resume_from_exception() 165 return thread->MarkExceptionNotHandled(eport.get()); in sys_task_resume_from_exception() [all …]
|
| A D | profile.cpp | 68 fbl::RefPtr<ThreadDispatcher> thread; in sys_object_set_profile() local 69 auto status = up->GetDispatcherWithRights(handle, ZX_RIGHT_MANAGE_THREAD, &thread); in sys_object_set_profile() 79 return profile->ApplyProfile(ktl::move(thread)); in sys_object_set_profile()
|
| A D | task.cpp | 201 fbl::RefPtr<ThreadDispatcher> thread; in sys_thread_start() local 203 &thread); in sys_thread_start() 207 status = up->GetDispatcherWithRights(handle, ZX_RIGHT_WRITE, &thread); in sys_thread_start() 212 ktrace(TAG_THREAD_START, (uint32_t)thread->get_koid(), 0, 0, 0); in sys_thread_start() 229 fbl::RefPtr<ThreadDispatcher> thread; in sys_thread_read_state() local 258 fbl::RefPtr<ThreadDispatcher> thread; in sys_thread_write_state() local 424 fbl::RefPtr<ThreadDispatcher> thread; in sys_process_start() local 425 status = up->GetDispatcherWithRights(thread_handle, ZX_RIGHT_WRITE, &thread); in sys_process_start() 434 if (thread->process() != process.get()) in sys_process_start() 444 status = thread->Start(pc, sp, static_cast<uintptr_t>(arg_nhv), in sys_process_start() [all …]
|
| /kernel/include/kernel/ |
| A D | wait.h | 70 struct thread* wait_queue_peek(wait_queue_t*) TA_REQ(thread_lock); 80 struct thread* wait_queue_dequeue_one(wait_queue_t* wait, 87 zx_status_t wait_queue_unblock_thread(struct thread* t, 91 void wait_queue_priority_changed(struct thread* t, 115 struct thread* Peek() TA_REQ(thread_lock) { in Peek() 125 static zx_status_t UnblockThread(struct thread* t, zx_status_t wait_queue_error) in UnblockThread()
|
| /kernel/object/include/object/ |
| A D | excp_port.h | 44 zx_status_t SendPacket(ThreadDispatcher* thread, uint32_t type); 46 void OnThreadStartForDebugger(ThreadDispatcher* thread); 47 void OnThreadExitForDebugger(ThreadDispatcher* thread); 48 void OnProcessStartForDebugger(ThreadDispatcher* thread);
|
| /kernel/arch/x86/include/arch/x86/ |
| A D | mp.h | 39 struct thread; 46 struct thread *current_thread; 126 void x86_secondary_entry(volatile int *aps_still_booting, thread_t *thread);
|
| /kernel/arch/arm64/include/arch/arm64/ |
| A D | registers.h | 125 void arm64_debug_state_context_switch(thread* old_thread, thread* new_thread);
|