[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:
Travis Geiselbrecht
2020-05-15 19:01:38 -07:00
parent 3e66ea6361
commit c57b661c93
8 changed files with 26 additions and 20 deletions

View File

@@ -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;