xref: /haiku/headers/private/kernel/arch/arm64/arch_thread.h (revision 4a55cc230cf7566cadcbb23b1928eefff8aea9a2)
1 /*
2  * Copyright 2022, Haiku Inc. All rights reserved.
3  * Copyright 2018, Jaroslaw Pelczar <jarek@jpelczar.com>
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef _KERNEL_ARCH_ARM64_ARCH_THREAD_H_
7 #define _KERNEL_ARCH_ARM64_ARCH_THREAD_H_
8 
9 
10 #include <arch/cpu.h>
11 
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 void arm64_push_iframe(struct iframe_stack *stack, struct iframe *frame);
18 void arm64_pop_iframe(struct iframe_stack *stack);
19 
20 static inline Thread * arch_thread_get_current_thread(void)
21 {
22 	return (Thread *)READ_SPECIALREG(tpidr_el1);
23 }
24 
25 
26 static inline void arch_thread_set_current_thread(Thread *t)
27 {
28 	WRITE_SPECIALREG(tpidr_el1, t);
29 }
30 
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 
37 #endif /* _KERNEL_ARCH_ARM64_ARCH_THREAD_H_ */
38