[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: Wed, 4 Apr 2018 16:54:03 +0300
  • Cc: simon.kuenzer@xxxxxxxxx
  • Delivery-date: Wed, 04 Apr 2018 13:54:24 +0000
  • Ironport-phdr: 9a23:m+B+YBH8oPDnOBZU/yOBT51GYnF86YWxBRYc798ds5kLTJ7zp8qwAkXT6L1XgUPTWs2DsrQY07GQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmDSwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VDK/5KlpVRDokj8KOT4n/m/KhMJ+j6VVrxCvpxFk34LYfJuYOOZkc6/BYd8XQ3dKUMZLVyxGB4Oxd5UCD+0aPeZEron9oUYFox2jBQm0GePk1zhFiWPx3a0hz+QhEAfG0BYkH9ITqHTUsc74O7sJUeyv1KnI0C7MY+lM2Tf68YXFdA0qr/KUXb9obMbcxlQjGxnGg1iQs4DpIS2Z2+YXv2WV9+ZsSO2ih3M9pwxyojWj3Nkgh4fHi44P11zJ+jt1zYAoLtOiUkF7e8SrEJ5IuiGfMIt5X90tTnlzuCY/1r0GoZm7fDUWyJg/xx7QdfiHc4+Q7xL9UeaeOzZ4hHZ/dL2jnBa+61CgyvDnWcWuylZKqTJJktjKtn8Tyxze8tWLR/Rg8ku72juC1xrf5v9aLU02j6bWJYYtwrsqmZoStUTDEDX2mELzjKKOakok/fOo6/jmYrXgvJOcM5J0ihnjMqk1hsO/Gv40MhATX2eA4+i8zrrj8VXjQLpWlv02jrXZsJfCKMQep665BQ5V0oE46xqmEjipzsoYkmcDLF9efBKHjpPpO03VIPziAvawnVKsnC1sx/DcMb3rGo/NIWTbkLf9YbZ97FZRyBEyzdBa4JJUDKsNIPHuWkDvstzZDwE2MxavzubhFtpyyoceVniUDaODLqzSrAzA2uV6JuiKZYgO/TrwNfUhz/rvlmMi308Qe++ux5RERmq/G6FNJF6FYHykpsoZDC9etQ0lUO3szlmfSSN7bG30R782oCs8XtH1RbzfT5yg1eTSlBywGYdbMzhL
  • 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®.