[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Minios-devel] [PATCH v3 22/43] arm64: implement the __arch_switch_threads
- To: Huang Shijie <shijie.huang@xxxxxxx>
- From: Julien Grall <julien.grall@xxxxxxx>
- Date: Mon, 30 Apr 2018 10:34:27 +0100
- Cc: jgross@xxxxxxxx, wei.liu2@xxxxxxxxxx, wei.chen@xxxxxxx, steve.capper@xxxxxxx, vlad.babchuk@xxxxxxxxx, minios-devel@xxxxxxxxxxxxxxxxxxxx, kaly.xin@xxxxxxx, samuel.thibault@xxxxxxxxxxxx, baozich@xxxxxxxxx, nd@xxxxxxx
- Delivery-date: Mon, 30 Apr 2018 09:34:34 +0000
- List-id: Mini-os development list <minios-devel.lists.xenproject.org>
On 28/04/18 07:26, Huang Shijie wrote:
On Thu, Apr 26, 2018 at 01:29:24PM +0100, Julien Grall wrote:
Hi Shijie,
On 16/04/18 07:32, Huang Shijie wrote:
The __arch_switch_threads is used for switching the threads.
This patch implements it.
Signed-off-by: Huang Shijie <shijie.huang@xxxxxxx>
---
arch/arm/arm64/arm64.S | 38 ++++++++++++++++++++++++++++++++++++++
include/arm/arm64/os.h | 4 ++++
2 files changed, 42 insertions(+)
diff --git a/arch/arm/arm64/arm64.S b/arch/arm/arm64/arm64.S
index fa3406f..5f55f99 100644
--- a/arch/arm/arm64/arm64.S
+++ b/arch/arm/arm64/arm64.S
@@ -1,5 +1,6 @@
#include "asm.h"
#include <arch_limits.h>
+#include <arm64/os.h>
#include <arm64/pagetable.h>
#include <arm64/traps.h>
#include <xen/xen.h>
@@ -434,3 +435,40 @@ ENTRY(vector_table)
vector_entry el0_fiq_invalid /* FIQ 32-bit EL0 */
vector_entry el0_error_invalid /* Error 32-bit EL0 */
END(vector_table)
+
+/*
+ * => x0 = &prev->sp
+ * x1 = &next->sp
+ * <= switch to the next thread
Some documentation about the layout of the structure in memory would be
useful.
okay.
+ */
+ENTRY(__arch_switch_threads)
+ /* Store the callee-saved registers to prev's struct thread */
AFAICT, you don't store the callee-saved registers in struct thread but on
the stack. Am I right?
Yes.
I store them in the stack.
Please update the comment accordingly then.
Cheers,
--
Julien Grall
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|