[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 07/23] lib/uksched: Move stack_push() to arch
We are refactoring this function because we will need it for the implementation of paravirtualized context. Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> --- include/uk/arch/lcpu.h | 7 +++++++ lib/uksched/thread.c | 12 +++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/uk/arch/lcpu.h b/include/uk/arch/lcpu.h index 83ea6ecc..7f33203b 100644 --- a/include/uk/arch/lcpu.h +++ b/include/uk/arch/lcpu.h @@ -68,6 +68,13 @@ extern "C" { #define wmb() barrier() #endif +/* Pushes the specified value onto the stack of the specified thread */ +static inline void ukarch_stack_push(unsigned long *sp, unsigned long value) +{ + *sp -= sizeof(unsigned long); + *((unsigned long *) *sp) = value; +} + #ifdef __cplusplus } #endif diff --git a/lib/uksched/thread.c b/lib/uksched/thread.c index abaabd5f..6262f8c6 100644 --- a/lib/uksched/thread.c +++ b/lib/uksched/thread.c @@ -41,12 +41,6 @@ #include <uk/assert.h> #include <uk/arch/tls.h> -/* Pushes the specified value onto the stack of the specified thread */ -static void stack_push(unsigned long *sp, unsigned long value) -{ - *sp -= sizeof(unsigned long); - *((unsigned long *) *sp) = value; -} static void init_sp(unsigned long *sp, char *stack, void (*function)(void *), void *data) @@ -56,10 +50,10 @@ static void init_sp(unsigned long *sp, char *stack, /* Must ensure that (%rsp + 8) is 16-byte aligned * at the start of thread_starter. */ - stack_push(sp, 0); + ukarch_stack_push(sp, 0); - stack_push(sp, (unsigned long) function); - stack_push(sp, (unsigned long) data); + ukarch_stack_push(sp, (unsigned long) function); + ukarch_stack_push(sp, (unsigned long) data); } #ifdef CONFIG_LIBNEWLIBC -- 2.20.1 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |