[kernel][thread] change the way get_current_thread is inlined
Previously, was relying on a regular definition with the arch_ops.h code overriding it with a static inline. This has been annoying for some years since it forces the declarations to be in order. Change it to simple declare an inline wrapper around an arch_ routine that does whatever it needs to do.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <arch/defines.h>
|
||||
#include <arch/ops.h>
|
||||
#include <arch/thread.h>
|
||||
#include <arch/arch_ops.h>
|
||||
#include <kernel/spinlock.h>
|
||||
#include <kernel/wait.h>
|
||||
#include <lk/compiler.h>
|
||||
@@ -174,8 +175,13 @@ struct timer;
|
||||
enum handler_return thread_timer_tick(struct timer *, lk_time_t now, void *arg);
|
||||
|
||||
/* the current thread */
|
||||
thread_t *get_current_thread(void);
|
||||
void set_current_thread(thread_t *);
|
||||
static inline thread_t *get_current_thread(void) {
|
||||
return arch_get_current_thread();
|
||||
}
|
||||
|
||||
static inline void set_current_thread(thread_t *t) {
|
||||
arch_set_current_thread(t);
|
||||
}
|
||||
|
||||
/* scheduler lock */
|
||||
extern spin_lock_t thread_lock;
|
||||
|
||||
Reference in New Issue
Block a user