[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


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Mon, 8 Jul 2019 11:33:36 +0300
  • Cc: felipe.huici@xxxxxxxxx, simon.kuenzer@xxxxxxxxx
  • Delivery-date: Mon, 08 Jul 2019 08:54:56 +0000
  • Ironport-phdr: 9a23:e3+MkxXHFL0GuSjxmaGBYzVD+4rV8LGtZVwlr6E/grcLSJyIuqrYbBOCt8tkgFKBZ4jH8fUM07OQ7/m6HzBYqs7d+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe7x/IAiooQnLucQanYRuJro+xxDUvnZGZuNayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4ql3RBP0jioMKjg0+3zVhMNtlqJWuBKvqQJizYDaY4+bM/hxfq3GcN8GWWZMRNpdWjZdDo+gaYYEEuoPPfxfr4n4v1YDsxy+BRKwBOPuzD9Dm3n43bAi0+Q8DArL2xAvH9UVsHTIrdX1Mr0eUeSozKnQ0DXOdO9Z2Szn5IjQbxAuuuuAXah3ccfIz0QkCgDLjk2IpID4MD6Zy/4Bvmub4uZ6S+6jlWwqpxt/rzS328shhZTFipgWx13E7yl13og4KNOiREJmbtOoDp1dvDyAOYRsWMMtWWRotT4/yr0BpJG0YjAHyI8ixx7Dc/yHdJWI4g77WOaRPzh4gHVldaqhhxa360egy+n8WtOo31ZRtCZFisTMuWsX2xzJ7ciLUvp9/kG/1jaTzw3f9+5JLV0umafYK5Mt2KA8moQRvEjZECL6gED2g7WXdkUg9Oio8ePnYrD+q5CAMI90kR3+MqUomsClBeQ4LxAOX3WA9Ougz73v51X5QKhRgfEsiKnZt4jWJd4Hqa6hHw9VzoEj5g66Dzen1tQYnH4HLElcdB2akYfpJU/BIPTjAPe7glSsiytrx+vcMrzuHJrNKGLPkLD7fbZy80Rc0hY8zchD55JIDbEMOPzzVVH1tNzZFh82LRa4w+b6CNV8yoweWHmCAqmHP6zOtV+H/PkgL/OSa48IoDz9MeQq5+byjX8lnl8QZbKp3ZoSaHC/GPRqOUaZYWfyjdcHEGYFoBA+QffsiFKcTTFTY2y9ULkm6j4lFYL1RbvEE4Wshr2Gx2K3E4NbYkhCC0uQCjH4eoPCXO0DOwyIJco0uTsfSbmnA6s8zQzm4AT90KZmKKzQ5zUFnZn4ksBo7avJkkdhpnRPE82B3jTVHClPlWQSSmpu0Q==
  • Ironport-sdr: pjQ4b/jbQL2TbjGnkc1lAyM9CBEoghzHp8dY8g5F7Rdz1zQAK5gF/0EKD8AFZswc73TgIC7dK4 FSspx8X5N5Qw==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.