752ceb1
From 1b18d6b0d34872ced6b3dbfc3e7957c80efbcb7a Mon Sep 17 00:00:00 2001
752ceb1
From: Vladimir Serbinenko <phcoder@gmail.com>
752ceb1
Date: Tue, 5 Sep 2017 23:13:55 +0200
752ceb1
Subject: [PATCH] Add a file missing in multiboot2 commit.
752ceb1
752ceb1
---
752ceb1
 include/grub/multiboot2.h | 104 ++++++++++++++++++++++++++++++++++++++++++++++
752ceb1
 1 file changed, 104 insertions(+)
752ceb1
 create mode 100644 include/grub/multiboot2.h
752ceb1
752ceb1
diff --git a/include/grub/multiboot2.h b/include/grub/multiboot2.h
752ceb1
new file mode 100644
752ceb1
index 00000000000..502d34ef180
752ceb1
--- /dev/null
752ceb1
+++ b/include/grub/multiboot2.h
752ceb1
@@ -0,0 +1,104 @@
752ceb1
+/* multiboot.h - multiboot header file with grub definitions. */
752ceb1
+/*
752ceb1
+ *  GRUB  --  GRand Unified Bootloader
752ceb1
+ *  Copyright (C) 2003,2007,2008,2010  Free Software Foundation, Inc.
752ceb1
+ *
752ceb1
+ *  GRUB is free software: you can redistribute it and/or modify
752ceb1
+ *  it under the terms of the GNU General Public License as published by
752ceb1
+ *  the Free Software Foundation, either version 3 of the License, or
752ceb1
+ *  (at your option) any later version.
752ceb1
+ *
752ceb1
+ *  GRUB is distributed in the hope that it will be useful,
752ceb1
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
752ceb1
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
752ceb1
+ *  GNU General Public License for more details.
752ceb1
+ *
752ceb1
+ *  You should have received a copy of the GNU General Public License
752ceb1
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
752ceb1
+ */
752ceb1
+
752ceb1
+#ifndef GRUB_MULTIBOOT2_HEADER
752ceb1
+#define GRUB_MULTIBOOT2_HEADER 1
752ceb1
+
752ceb1
+#include <grub/file.h>
752ceb1
+
752ceb1
+#include <multiboot2.h>
752ceb1
+
752ceb1
+#include <grub/types.h>
752ceb1
+#include <grub/err.h>
752ceb1
+
752ceb1
+extern struct grub_relocator *grub_multiboot2_relocator;
752ceb1
+
752ceb1
+void grub_multiboot2 (int argc, char *argv[]);
752ceb1
+void grub_module2 (int argc, char *argv[]);
752ceb1
+
752ceb1
+void grub_multiboot2_set_accepts_video (int val);
752ceb1
+grub_err_t grub_multiboot2_make_mbi (grub_uint32_t *target);
752ceb1
+void grub_multiboot2_free_mbi (void);
752ceb1
+grub_err_t grub_multiboot2_init_mbi (int argc, char *argv[]);
752ceb1
+grub_err_t grub_multiboot2_add_module (grub_addr_t start, grub_size_t size,
752ceb1
+				      int argc, char *argv[]);
752ceb1
+void grub_multiboot2_set_bootdev (void);
752ceb1
+void
752ceb1
+grub_multiboot2_add_elfsyms (grub_size_t num, grub_size_t entsize,
752ceb1
+			    unsigned shndx, void *data);
752ceb1
+
752ceb1
+grub_uint32_t grub_multiboot2_get_mmap_count (void);
752ceb1
+grub_err_t grub_multiboot2_set_video_mode (void);
752ceb1
+
752ceb1
+/* FIXME: support coreboot as well.  */
752ceb1
+#if defined (GRUB_MACHINE_PCBIOS)
752ceb1
+#define GRUB_MACHINE_HAS_VBE 1
752ceb1
+#else
752ceb1
+#define GRUB_MACHINE_HAS_VBE 0
752ceb1
+#endif
752ceb1
+
752ceb1
+#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_QEMU)
752ceb1
+#define GRUB_MACHINE_HAS_VGA_TEXT 1
752ceb1
+#else
752ceb1
+#define GRUB_MACHINE_HAS_VGA_TEXT 0
752ceb1
+#endif
752ceb1
+
752ceb1
+#if defined (GRUB_MACHINE_EFI) || defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT)
752ceb1
+#define GRUB_MACHINE_HAS_ACPI 1
752ceb1
+#else
752ceb1
+#define GRUB_MACHINE_HAS_ACPI 0
752ceb1
+#endif
752ceb1
+
752ceb1
+#define GRUB_MULTIBOOT2_CONSOLE_EGA_TEXT 1
752ceb1
+#define GRUB_MULTIBOOT2_CONSOLE_FRAMEBUFFER 2 
752ceb1
+
752ceb1
+grub_err_t
752ceb1
+grub_multiboot2_set_console (int console_type, int accepted_consoles,
752ceb1
+			    int width, int height, int depth,
752ceb1
+			    int console_required);
752ceb1
+grub_err_t
752ceb1
+grub_multiboot2_load (grub_file_t file, const char *filename);
752ceb1
+
752ceb1
+struct mbi_load_data
752ceb1
+{
752ceb1
+  grub_file_t file;
752ceb1
+  const char *filename;
752ceb1
+  void *buffer;
752ceb1
+  unsigned int mbi_ver;
752ceb1
+  int relocatable;
752ceb1
+  grub_uint32_t min_addr;
752ceb1
+  grub_uint32_t max_addr;
752ceb1
+  grub_size_t align;
752ceb1
+  grub_uint32_t preference;
752ceb1
+  grub_uint32_t link_base_addr;
752ceb1
+  grub_uint32_t load_base_addr;
752ceb1
+  int avoid_efi_boot_services;
752ceb1
+};
752ceb1
+typedef struct mbi_load_data mbi_load_data_t;
752ceb1
+
752ceb1
+/* Load ELF32 or ELF64.  */
752ceb1
+grub_err_t
752ceb1
+grub_multiboot2_load_elf (mbi_load_data_t *mld);
752ceb1
+
752ceb1
+extern grub_size_t grub_multiboot2_pure_size;
752ceb1
+extern grub_size_t grub_multiboot2_alloc_mbi;
752ceb1
+extern grub_uint32_t grub_multiboot2_payload_eip;
752ceb1
+
752ceb1
+
752ceb1
+#endif /* ! GRUB_MULTIBOOT_HEADER */