From 66516918ce90e3e56dba5328ff1b1b0779ee64de Mon Sep 17 00:00:00 2001 From: p-szafonimateusz Date: Sat, 29 Jun 2024 21:01:10 +0200 Subject: [PATCH] x86_64/irq.h: use 32bit operations in up_cpu_index() Use 32bit operations for id field in intel64_cpu_s which is int type. This fixes an error that appears when enabling some debug options: `Error: operand size mismatch for `movq'`` Signed-off-by: p-szafonimateusz --- arch/x86_64/include/irq.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86_64/include/irq.h b/arch/x86_64/include/irq.h index dfbbe15c359..8d03fd836d3 100644 --- a/arch/x86_64/include/irq.h +++ b/arch/x86_64/include/irq.h @@ -98,11 +98,11 @@ extern "C" #ifdef CONFIG_SMP static inline_function int up_cpu_index(void) { - unsigned long cpu; + int cpu; asm volatile( - "\tmovq %%gs:(%c1), %0\n" - : "=rm" (cpu) + "\tmovl %%gs:(%c1), %0\n" + : "=r" (cpu) : "i" (offsetof(struct intel64_cpu_s, id)) :);