[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCHv6 35/37] arch/arm64: Add function for stack pointer retrieval


  • To: <minios-devel@xxxxxxxxxxxxxxxxxxxx>, <simon.kuenzer@xxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Fri, 14 Sep 2018 07:57:08 +0000
  • Authentication-results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=bestguesspass action=none header.from=arm.com;
  • Cc: Kaly.Xin@xxxxxxx, nd@xxxxxxx, wei.chen@xxxxxxx
  • Delivery-date: Fri, 14 Sep 2018 07:59:04 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

The ukdebug will print bottom address of stack in
debug messages. So we just implement this function
for Arm64 to retrieve stack pointer.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
 include/uk/arch/arm/arm64/lcpu.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/uk/arch/arm/arm64/lcpu.h b/include/uk/arch/arm/arm64/lcpu.h
index 3e1fd9b..2719313 100644
--- a/include/uk/arch/arm/arm64/lcpu.h
+++ b/include/uk/arch/arm/arm64/lcpu.h
@@ -100,4 +100,13 @@ struct __regs {
 #define wmb()   dsb(st) /* Full system memory barrier store */
 #endif
 
+static inline unsigned long ukarch_read_sp(void)
+{
+       unsigned long sp;
+
+       __asm__ __volatile("mov %0, sp": "=&r"(sp));
+
+       return sp;
+}
+
 #endif /* __ASSEMBLY__ */
-- 
2.17.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®.