common: Move interrupt functions into a new header
[oweals/u-boot.git] / arch / x86 / lib / bios.c
index 66d7629a6dd2641ed2e2cc7bd64021f0fd322ab2..30c0997fd01aed705e817cc909f55abba89236e2 100644 (file)
@@ -1,13 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * From Coreboot file device/oprom/realmode/x86.c
  *
  * Copyright (C) 2007 Advanced Micro Devices, Inc.
  * Copyright (C) 2009-2010 coresystems GmbH
- *
- * SPDX-License-Identifier:    GPL-2.0
  */
 #include <common.h>
 #include <bios_emul.h>
+#include <irq_func.h>
 #include <vbe.h>
 #include <linux/linkage.h>
 #include <asm/cache.h>
@@ -185,6 +185,7 @@ static void setup_realmode_idt(void)
        write_idt_stub((void *)0xffe6e, 0x1a);
 }
 
+#ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE
 static u8 vbe_get_mode_info(struct vbe_mode_info *mi)
 {
        u16 buffer_seg;
@@ -241,6 +242,7 @@ static void vbe_set_graphics(int vesa_mode, struct vbe_mode_info *mode_info)
        mode_info->video_mode &= 0x3ff;
        vbe_set_mode(mode_info);
 }
+#endif /* CONFIG_FRAMEBUFFER_SET_VESA_MODE */
 
 void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
                     struct vbe_mode_info *mode_info)
@@ -273,8 +275,10 @@ void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
                      0x0);
        debug("done\n");
 
+#ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE
        if (vesa_mode != -1)
                vbe_set_graphics(vesa_mode, mode_info);
+#endif
 }
 
 asmlinkage int interrupt_handler(u32 intnumber, u32 gsfs, u32 dses,