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

[Minios-devel] [UNIKRAFT PATCH 12/17] arch/x86_64: Add function for stack pointer retrieval


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Tue, 27 Mar 2018 15:29:45 +0300
  • Cc: simon.kuenzer@xxxxxxxxx
  • Delivery-date: Tue, 27 Mar 2018 12:30:13 +0000
  • Ironport-phdr: 9a23:/ooXKRM/CHFmNaT5HBol6mtUPXoX/o7sNwtQ0KIMzox0Ivz9rarrMEGX3/hxlliBBdydt6ofzbKO+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxlGiTanfb9+MAi9oBnMuMURnYZsMLs6xAHTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKHw65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0yRD+s7bpkSAXwhSkHKTA37W/ZhM93gq1ZrhKsvABzz5LObY2JLvdyYr/RcNUHTmRBRMZRUClBD5uiYosIFOoBIedYr4/grFUIsBu+HRSsD/7oxzBUgX/2xrE60+UnEQ3c2AwgAsoOsGnPodrpL6ceS/i1zLTTwjnZdfNW3i7w5Y7VeR4iufGBRa98fMXMxUU1FA7Ijk+cpZL7Mz6XzOgAvXCX4/dvWO6ykWIqqAF8riKxysoihITFnJ8Zx1/a+Sh/3Y07P8e3SFRhbt6hCJZQsiaaOJZoTc46WGFovTo6yqUBuZ6mYCgG0JQnyADba/yAa4WI/BfjW/yQITd8nn5qZKm/iwyq8Ui90eLwTNO00FFSoipElNnDqGwN2gTO5sWIV/dx5ESs1DaV2wzN9O1JI1o4mKTDJ54k2LEwl54TsUrZHi/xnUX7lLOZdkI/+ui06uTnZK/qppuBN49slwHzKbghmtelDeQgLwgBRHKX+f671LH75032XK1KjuEqkqneqJ3aIMUbpqi4Aw9SyYYv8guwACm40NsGmXkKN1ZFeBOcj4j1IFHCOv/5Aum5g1i2lzdr3f/GNKX7AprRNnjDjKvhfbFl5k5HyQozyNdf55ROBrECPfL8REnxtd3GAR8jKAG0xfjoB8l51owEQm2DGLGWML6B+WOPs+cuJeiLf8oZtSjwL9Ah5uXyljkplFlberOmjrUNb3XtNfN9P0SfKV7xmspJRWwNpRY/SqrulUWfeTVIIW6vVeQm4WdoW8qdEY7fS9X10/S61yChE8gOaw==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 include/uk/arch/x86_64/lcpu.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/uk/arch/x86_64/lcpu.h b/include/uk/arch/x86_64/lcpu.h
index 1750c6f..8c70540 100644
--- a/include/uk/arch/x86_64/lcpu.h
+++ b/include/uk/arch/x86_64/lcpu.h
@@ -47,3 +47,11 @@
 #ifndef nop
 #define nop()   __asm__ __volatile__ ("nop" : : : "memory")
 #endif
+
+static inline unsigned long ukarch_read_sp(void)
+{
+       unsigned long sp;
+
+       __asm__ __volatile__("mov %%rsp, %0" : "=r"(sp));
+       return sp;
+}
-- 
2.1.4


_______________________________________________
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®.