[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v2 2/5] 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 | 6 ++++++ plat/linuxu/memory.c | 5 +++++ plat/xen/memory.c | 7 +++++++ 4 files changed, 24 insertions(+) diff --git a/include/uk/plat/memory.h b/include/uk/plat/memory.h index 1bb15685..4c4e4dc4 100644 --- a/include/uk/plat/memory.h +++ b/include/uk/plat/memory.h @@ -158,6 +158,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 7f2fb46a..e96bad2c 100644 --- a/plat/kvm/memory.c +++ b/plat/kvm/memory.c @@ -178,3 +178,9 @@ int _ukplat_mem_mappings_init(void) { return 0; } + +void ukplat_stack_set_current_thread(void *thread_addr) +{ + *((unsigned long *) _libkvmplat_cfg.bstack.end) = + (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 |