From cb2a3ed83ea1b965f93e85773156d56d3223094e Mon Sep 17 00:00:00 2001 From: cqb Date: Sun, 1 Feb 2026 23:11:25 +0100 Subject: [PATCH] arch/x86: fixed errors in gdt_flush and idt_flush This commit fixes logic errors in both GDT and IDT flushing mechanisms for the x86 platform. Signed-off-by: cqb . --- arch/x86/src/i486/i486_utils.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/src/i486/i486_utils.S b/arch/x86/src/i486/i486_utils.S index 097c35421d5..224870a4ff7 100644 --- a/arch/x86/src/i486/i486_utils.S +++ b/arch/x86/src/i486/i486_utils.S @@ -57,7 +57,7 @@ .type gdt_flush, @function gdt_flush: - movl %eax, 4(%esp) /* Get the pointer to the GDT, passed as a parameter */ + movl 4(%esp), %eax /* Get the pointer to the GDT, passed as a parameter */ lgdt (%eax) /* Load the new GDT pointer */ mov $KSEG, %ax /* KSEG is the offset in the GDT to our data segment */ @@ -77,7 +77,7 @@ gdt_flush: .type idt_flush, @function idt_flush: - movl %eax, 4(%esp) /* Get the pointer to the IDT, passed as a parameter */ + movl 4(%esp), %eax /* Get the pointer to the IDT, passed as a parameter */ lidt (%eax) /* Load the IDT pointer */ ret .size idt_flush, . - idt_flush