Skip to contentSkip to conversation

only call the c function set_bios_mode if the value CONFIG_X86_64 is set.

PATCH In review Hans Weber 2 participants 2 messages Feb 19, 2022 x86

lore
Share & tools
lore

Hans Weber

author
#0 lore raw

PATCH 1/1 only call the c function set_bios_mode if the value CONFIG_X86_64 is set.

---
 arch/x86/boot/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/boot/main.c +2 -2
index e3add857c2c9..e4df8ff1e228 100644
@@ -102,14 +102,12 @@ static void query_ist(void)
  */
 static void set_bios_mode(void)
 {
-#ifdef CONFIG_X86_64
 	struct biosregs ireg;
 
 	initregs(&ireg);
 	ireg.ax = 0xec00;
 	ireg.bx = 2;
 	intcall(0x15, &ireg, NULL);
-#endif
 }
 
 static void init_heap(void)
@@ -152,7 +150,9 @@ void main(void)
 	}
 
 	/* Tell the BIOS what CPU mode we intend to run in. */
+#ifdef CONFIG_X86_64
 	set_bios_mode();
+#endif
 
 	/* Detect memory layout */
 	detect_memory();
Signature · 1 line
2.30.2
#1 lore raw

From: Hans Weber

Quoted 27 lines

Sent: 19 February 2022 20:40

---
 arch/x86/boot/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/boot/main.c +0 -2
index e3add857c2c9..e4df8ff1e228 100644
@@ -102,14 +102,12 @@ static void query_ist(void)
  */
 static void set_bios_mode(void)
 {
-#ifdef CONFIG_X86_64
 	struct biosregs ireg;
 
 	initregs(&ireg);
 	ireg.ax = 0xec00;
 	ireg.bx = 2;
 	intcall(0x15, &ireg, NULL);
-#endif
 }
 
 static void init_heap(void)

arch/x86/boot/main.c void main(void) · line 155

Quoted 6 lines
arch/x86/boot/main.c +2 -0
@@ -152,7 +150,9 @@ void main(void)
 	}
 
 	/* Tell the BIOS what CPU mode we intend to run in. */
+#ifdef CONFIG_X86_64
 	set_bios_mode();
+#endif

That should make absolutely no difference.
The empty static function will be inlined and thus discarded.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)