lx_emul: initialise preempt_count for ARM 32bit

genodelabs/genode#4499
This commit is contained in:
Johannes Schlatow 2022-04-01 15:55:07 +02:00 committed by Christian Helmuth
parent 6731067116
commit ba04aab75f
2 changed files with 17 additions and 3 deletions

View File

@ -102,6 +102,19 @@ INC_DIR += $(LX_GEN_DIR)/arch/$(LX_ARCH)/include/generated/uapi
INC_DIR += $(LX_SRC_DIR)/include/uapi
INC_DIR += $(LX_GEN_DIR)/include/generated/uapi
ifeq ($(filter-out $(SPECS),arm_v7),)
CC_DEF += -D__LINUX_ARM_ARCH__=7
endif
ifeq ($(filter-out $(SPECS),arm_v6),)
CC_DEF += -D__LINUX_ARM_ARCH__=6
endif
ifeq ($(filter-out $(SPECS),arm),)
# needed definitions of some arm assembler macros
CC_DEF += -include asm/unified.h
endif
CC_DEF += -include $(LX_SRC_DIR)/include/linux/kconfig.h
CC_DEF += -include $(LX_SRC_DIR)/include/linux/compiler_types.h
CC_DEF += -D__KERNEL__ -DCONFIG_CC_HAS_K_CONSTRAINT=1

View File

@ -77,11 +77,12 @@ pid_t kernel_thread(int (* fn)(void *),void * arg,unsigned long flags)
.signal = signal,
};
#ifdef CONFIG_ARM_64
task->thread_info.preempt_count = 0;
#endif
task->stack = kmalloc(sizeof(struct thread_info), THREADINFO_GFP);
#ifndef CONFIG_X86
task_thread_info(task)->preempt_count = 0;
#endif
lx_emul_task_create(task, "kthread", task->pid, fn, arg);
return task->pid;