[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 5/8] plat/*: Set current thread on IRQ stack
Current thread address is saved on the top of the current thread stack. This patch extends this behavior for the interrupt stack in order to access the current thread address from interrupt context as well. Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> --- include/uk/plat/memory.h | 6 ++++++ plat/kvm/memory.c | 5 +++++ plat/linuxu/memory.c | 5 +++++ plat/xen/memory.c | 7 +++++++ 4 files changed, 23 insertions(+) diff --git a/include/uk/plat/memory.h b/include/uk/plat/memory.h index 60e52e6d..b739caa8 100644 --- a/include/uk/plat/memory.h +++ b/include/uk/plat/memory.h @@ -92,6 +92,12 @@ int ukplat_memallocator_set(struct uk_alloc *a); */ struct uk_alloc *ukplat_memallocator_get(void); +/** + * Sets the current thread address on top of kernel stack + * @param thread_addr Current thread address + */ +void ukplat_stack_set_current_thread(void *thread_addr); + #ifdef __cplusplus } #endif diff --git a/plat/kvm/memory.c b/plat/kvm/memory.c index e45b88c5..df624e88 100644 --- a/plat/kvm/memory.c +++ b/plat/kvm/memory.c @@ -157,3 +157,8 @@ int _ukplat_mem_mappings_init(void) { return 0; } + +void ukplat_stack_set_current_thread(void *thread_addr) +{ + *((unsigned long *) _libkvmplat_stack_top) = (unsigned long) thread_addr; +} diff --git a/plat/linuxu/memory.c b/plat/linuxu/memory.c index 35d0d95c..8bfb645d 100644 --- a/plat/linuxu/memory.c +++ b/plat/linuxu/memory.c @@ -74,3 +74,8 @@ int _ukplat_mem_mappings_init(void) { return 0; } + +void ukplat_stack_set_current_thread(void *thread_addr __unused) +{ + /* For now, signals use the current process stack */ +} diff --git a/plat/xen/memory.c b/plat/xen/memory.c index cb1c3552..8f170dd3 100644 --- a/plat/xen/memory.c +++ b/plat/xen/memory.c @@ -148,3 +148,10 @@ int _ukplat_mem_mappings_init(void) #endif return 0; } + +void ukplat_stack_set_current_thread(void *thread_addr) +{ + /* TODO revisit for HVM */ + extern char irqstack[]; + *((unsigned long *) irqstack) = (unsigned long) thread_addr; +} -- 2.11.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |