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
14extern "C" {
15#endif
16
17void arm64_push_iframe(struct iframe_stack *stack, struct iframe *frame);
18void arm64_pop_iframe(struct iframe_stack *stack);
19
20static inline Thread * arch_thread_get_current_thread(void)
21{
22	return (Thread *)READ_SPECIALREG(tpidr_el1);
23}
24
25
26static 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