2009-04-15 Vladimir Serbinenko <phcoder@gmail.com>

Move loader out of the kernel

	* kern/loader.c: moved to ...
	* commands/boot.c: ... moved here
	* commands/minicmd.c (grub_mini_cmd_boot): moved to ...
	* commands/boot.c (grub_cmd_boot): moved here. All users updated
	* include/grub/kernel.h (grub_machine_fini): export
	* include/grub/loader.h (grub_loader_is_loaded): update declaration
	(grub_loader_set): likewise
	(grub_loader_unset): likewise
	(grub_loader_boot): likewise
	* conf/common.rmk: new module boot.mod
	(pkglib_MODULES): add boot.mod
	* conf/i386-coreboot.rmk (kernel_elf_SOURCES): remove kern/loader.c
	(grub_emu_SOURCES): likewise
	* conf/i386-efi.rmk (kernel_elf_SOURCES): likewise
	(grub_emu_SOURCES): likewise
	* conf/i386-ieee1275.rmk (kernel_elf_SOURCES): likewise
	(grub_emu_SOURCES): likewise
	* conf/i386-pc.rmk (kernel_elf_SOURCES): likewise
	(grub_emu_SOURCES): likewise
	* conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): likewise
	(grub_emu_SOURCES): likewise
	* conf/sparcs64-ieee1275.rmk (kernel_elf_SOURCES): likewise
	(grub_emu_SOURCES): likewise   
	* conf/x86_64-efi.rmk (kernel_elf_SOURCES): likewise
	(grub_emu_SOURCES): likewise
This commit is contained in:
phcoder 2009-04-15 12:45:50 +00:00
parent 5999d61917
commit 0d5d565326
13 changed files with 125 additions and 50 deletions

View file

@ -1,3 +1,33 @@
2009-04-15 Vladimir Serbinenko <phcoder@gmail.com>
Move loader out of the kernel
* kern/loader.c: moved to ...
* commands/boot.c: ... moved here
* commands/minicmd.c (grub_mini_cmd_boot): moved to ...
* commands/boot.c (grub_cmd_boot): moved here. All users updated
* include/grub/kernel.h (grub_machine_fini): export
* include/grub/loader.h (grub_loader_is_loaded): update declaration
(grub_loader_set): likewise
(grub_loader_unset): likewise
(grub_loader_boot): likewise
* conf/common.rmk: new module boot.mod
(pkglib_MODULES): add boot.mod
* conf/i386-coreboot.rmk (kernel_elf_SOURCES): remove kern/loader.c
(grub_emu_SOURCES): likewise
* conf/i386-efi.rmk (kernel_elf_SOURCES): likewise
(grub_emu_SOURCES): likewise
* conf/i386-ieee1275.rmk (kernel_elf_SOURCES): likewise
(grub_emu_SOURCES): likewise
* conf/i386-pc.rmk (kernel_elf_SOURCES): likewise
(grub_emu_SOURCES): likewise
* conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): likewise
(grub_emu_SOURCES): likewise
* conf/sparcs64-ieee1275.rmk (kernel_elf_SOURCES): likewise
(grub_emu_SOURCES): likewise
* conf/x86_64-efi.rmk (kernel_elf_SOURCES): likewise
(grub_emu_SOURCES): likewise
2009-04-15 Vladimir Serbinenko <phcoder@gmail.com> 2009-04-15 Vladimir Serbinenko <phcoder@gmail.com>
use grub_lltoa instead of grub_itoa and grub_ltoa for all purposes use grub_lltoa instead of grub_itoa and grub_ltoa for all purposes

View file

@ -1,7 +1,7 @@
/* boot.c - command to boot an operating system */ /* boot.c - command to boot an operating system */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005,2007 Free Software Foundation, Inc. * Copyright (C) 2002,2003,2004,2005,2007,2009 Free Software Foundation, Inc.
* *
* GRUB is free software: you can redistribute it and/or modify * GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -21,29 +21,82 @@
#include <grub/dl.h> #include <grub/dl.h>
#include <grub/misc.h> #include <grub/misc.h>
#include <grub/loader.h> #include <grub/loader.h>
#include <grub/kernel.h>
static grub_err_t static grub_err_t (*grub_loader_boot_func) (void);
grub_cmd_boot (struct grub_arg_list *state __attribute__ ((unused)), static grub_err_t (*grub_loader_unload_func) (void);
int argc, char **args __attribute__ ((unused))) static int grub_loader_noreturn;
static int grub_loader_loaded;
int
grub_loader_is_loaded (void)
{ {
if (argc) return grub_loader_loaded;
return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many arguments"); }
void
grub_loader_set (grub_err_t (*boot) (void),
grub_err_t (*unload) (void),
int noreturn)
{
if (grub_loader_loaded && grub_loader_unload_func)
grub_loader_unload_func ();
grub_loader_boot (); grub_loader_boot_func = boot;
grub_loader_unload_func = unload;
grub_loader_noreturn = noreturn;
return 0; grub_loader_loaded = 1;
}
void
grub_loader_unset(void)
{
if (grub_loader_loaded && grub_loader_unload_func)
grub_loader_unload_func ();
grub_loader_boot_func = 0;
grub_loader_unload_func = 0;
grub_loader_loaded = 0;
}
grub_err_t
grub_loader_boot (void)
{
if (! grub_loader_loaded)
return grub_error (GRUB_ERR_NO_KERNEL, "no loaded kernel");
if (grub_loader_noreturn)
grub_machine_fini ();
return (grub_loader_boot_func) ();
}
/* boot */
static grub_err_t
grub_cmd_boot (struct grub_command *cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),
char *argv[] __attribute__ ((unused)))
{
return grub_loader_boot ();
} }
static grub_command_t cmd_boot;
GRUB_MOD_INIT(boot) GRUB_MOD_INIT(boot)
{ {
(void) mod; /* To stop warning. */ (void) mod; /* To stop warning. */
grub_register_command ("boot", grub_cmd_boot, GRUB_COMMAND_FLAG_BOTH, cmd_boot =
"boot", "Boot an operating system.", 0); grub_register_command ("boot", grub_cmd_boot,
0, "boot an operating system");
} }
GRUB_MOD_FINI(boot) GRUB_MOD_FINI(boot)
{ {
grub_unregister_command ("boot"); grub_unregister_command (cmd_boot);
} }

View file

@ -1,7 +1,7 @@
/* minicmd.c - commands for the rescue mode */ /* minicmd.c - commands for the rescue mode */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005,2006,2007 Free Software Foundation, Inc. * Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc.
* *
* GRUB is free software: you can redistribute it and/or modify * GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -28,15 +28,6 @@
#include <grub/loader.h> #include <grub/loader.h>
#include <grub/command.h> #include <grub/command.h>
/* boot */
static grub_err_t
grub_mini_cmd_boot (struct grub_command *cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),
char *argv[] __attribute__ ((unused)))
{
return grub_loader_boot ();
}
/* cat FILE */ /* cat FILE */
static grub_err_t static grub_err_t
grub_mini_cmd_cat (struct grub_command *cmd __attribute__ ((unused)), grub_mini_cmd_cat (struct grub_command *cmd __attribute__ ((unused)),
@ -345,16 +336,13 @@ grub_mini_cmd_exit (struct grub_command *cmd __attribute__ ((unused)),
return 0; return 0;
} }
static grub_command_t cmd_boot, cmd_cat, cmd_help, cmd_root; static grub_command_t cmd_cat, cmd_help, cmd_root;
static grub_command_t cmd_dump, cmd_rmmod, cmd_lsmod, cmd_exit; static grub_command_t cmd_dump, cmd_rmmod, cmd_lsmod, cmd_exit;
GRUB_MOD_INIT(minicmd) GRUB_MOD_INIT(minicmd)
{ {
(void) mod; /* To stop warning. */ (void) mod; /* To stop warning. */
cmd_boot =
grub_register_command ("boot", grub_mini_cmd_boot,
0, "boot an operating system");
cmd_cat = cmd_cat =
grub_register_command ("cat", grub_mini_cmd_cat, grub_register_command ("cat", grub_mini_cmd_cat,
"cat FILE", "show the contents of a file"); "cat FILE", "show the contents of a file");
@ -380,7 +368,6 @@ GRUB_MOD_INIT(minicmd)
GRUB_MOD_FINI(minicmd) GRUB_MOD_FINI(minicmd)
{ {
grub_unregister_command (cmd_boot);
grub_unregister_command (cmd_cat); grub_unregister_command (cmd_cat);
grub_unregister_command (cmd_help); grub_unregister_command (cmd_help);
grub_unregister_command (cmd_root); grub_unregister_command (cmd_root);

View file

@ -343,7 +343,12 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \
loopback.mod fs_uuid.mod configfile.mod echo.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \
terminfo.mod test.mod blocklist.mod hexdump.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \
read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \
pcpart.mod memrw.mod pcpart.mod memrw.mod boot.mod
# For boot.mod.
boot_mod_SOURCES = commands/boot.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For minicmd.mod. # For minicmd.mod.
minicmd_mod_SOURCES = commands/minicmd.c minicmd_mod_SOURCES = commands/minicmd.c

View file

@ -16,7 +16,7 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \
kern/i386/multiboot_mmap.c \ kern/i386/multiboot_mmap.c \
kern/main.c kern/device.c \ kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/rescue.c kern/term.c \
kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/i386/dl.c kern/parser.c kern/partition.c \ kern/i386/dl.c kern/parser.c kern/partition.c \
kern/i386/tsc.c kern/i386/pit.c \ kern/i386/tsc.c kern/i386/pit.c \
@ -73,7 +73,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
kern/err.c kern/list.c kern/handler.c \ kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c \ kern/command.c kern/corecmd.c commands/extcmd.c \
normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \
kern/loader.c kern/main.c kern/misc.c kern/parser.c \ commands/boot.c kern/main.c kern/misc.c kern/parser.c \
grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \
lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ lib/arg.c normal/cmdline.c normal/command.c normal/function.c\
normal/handler.c \ normal/handler.c \

View file

@ -50,7 +50,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
kern/err.c kern/list.c kern/handler.c \ kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c \ kern/command.c kern/corecmd.c commands/extcmd.c \
normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \
kern/loader.c kern/main.c kern/misc.c kern/parser.c \ commands/boot.c kern/main.c kern/misc.c kern/parser.c \
grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \
lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \
normal/function.c \ normal/function.c \
@ -87,7 +87,7 @@ pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \
kernel_mod_EXPORTS = no kernel_mod_EXPORTS = no
kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/rescue.c kern/term.c \
kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
term/efi/console.c disk/efi/efidisk.c \ term/efi/console.c disk/efi/efidisk.c \

View file

@ -17,7 +17,7 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \
kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ kern/ieee1275/cmain.c kern/ieee1275/openfw.c \
kern/main.c kern/device.c \ kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/rescue.c kern/term.c \
kern/i386/dl.c kern/parser.c kern/partition.c \ kern/i386/dl.c kern/parser.c kern/partition.c \
kern/env.c \ kern/env.c \
kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
@ -73,7 +73,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
kern/err.c kern/list.c kern/handler.c \ kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c \ kern/command.c kern/corecmd.c commands/extcmd.c \
normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \
kern/loader.c kern/main.c kern/misc.c kern/parser.c \ commands/boot.c kern/main.c kern/misc.c kern/parser.c \
grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \
lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \
normal/function.c normal/handler.c \ normal/function.c normal/handler.c \

View file

@ -46,7 +46,7 @@ cdboot_img_FORMAT = binary
# For kernel.img. # For kernel.img.
kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/rescue.c kern/term.c \
kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \
kern/parser.c kern/partition.c \ kern/parser.c kern/partition.c \
@ -132,7 +132,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
kern/err.c kern/list.c kern/handler.c \ kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c \ kern/command.c kern/corecmd.c commands/extcmd.c \
normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \
kern/loader.c kern/main.c kern/misc.c kern/parser.c \ commands/boot.c kern/main.c kern/misc.c kern/parser.c \
grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \
lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \
normal/function.c normal/handler.c \ normal/function.c normal/handler.c \

View file

@ -53,7 +53,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
\ \
io/gzio.c \ io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \
kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \
kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ kern/term.c kern/list.c kern/handler.c fs/fshelp.c \
kern/command.c kern/corecmd.c commands/extcmd.c \ kern/command.c kern/corecmd.c commands/extcmd.c \
@ -81,7 +81,7 @@ grub_emu_LDFLAGS = $(LIBCURSES)
kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \
kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/rescue.c kern/term.c \
kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/ieee1275/init.c \ kern/ieee1275/init.c \
kern/ieee1275/mmap.c \ kern/ieee1275/mmap.c \

View file

@ -53,7 +53,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \
# grub_script.tab.c \ # grub_script.tab.c \
# io/gzio.c \ # io/gzio.c \
# kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ # kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \
# kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ # kern/file.c kern/fs.c commands/boot.c kern/main.c kern/misc.c \
# kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ # kern/parser.c kern/partition.c kern/rescue.c kern/term.c \
# kern/list.c kern/handler.c \ # kern/list.c kern/handler.c \
# normal/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ # normal/arg.c normal/cmdline.c normal/command.c normal/datetime.c \
@ -73,7 +73,7 @@ grub_emu_LDFLAGS = $(LIBCURSES)
kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \
kern/main.c kern/device.c kern/disk.c kern/dl.c kern/file.c \ kern/main.c kern/device.c kern/disk.c kern/dl.c kern/file.c \
kern/fs.c kern/err.c kern/misc.c kern/mm.c kern/loader.c \ kern/fs.c kern/err.c kern/misc.c kern/mm.c \
kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \
kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
kern/partition.c kern/env.c kern/sparc64/dl.c symlist.c \ kern/partition.c kern/env.c kern/sparc64/dl.c symlist.c \

View file

@ -52,7 +52,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
kern/err.c kern/list.c kern/handler.c \ kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c \ kern/command.c kern/corecmd.c commands/extcmd.c \
normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \
kern/loader.c kern/main.c kern/misc.c kern/parser.c \ commands/boot.c kern/main.c kern/misc.c kern/parser.c \
grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \
lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ lib/arg.c normal/cmdline.c normal/command.c normal/function.c\
normal/completion.c normal/datetime.c normal/context.c \ normal/completion.c normal/datetime.c normal/context.c \
@ -90,7 +90,7 @@ kernel_mod_EXPORTS = no
kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \
kern/main.c kern/device.c \ kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/misc.c kern/mm.c kern/rescue.c kern/term.c \
kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \

View file

@ -1,6 +1,6 @@
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2005,2006,2007,2008 Free Software Foundation, Inc. * Copyright (C) 2002,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
* *
* GRUB is free software: you can redistribute it and/or modify * GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -64,7 +64,7 @@ void grub_main (void);
void grub_machine_init (void); void grub_machine_init (void);
/* The machine-specific finalization. */ /* The machine-specific finalization. */
void grub_machine_fini (void); void EXPORT_FUNC(grub_machine_fini) (void);
/* The machine-specific prefix initialization. */ /* The machine-specific prefix initialization. */
void grub_machine_set_prefix (void); void grub_machine_set_prefix (void);

View file

@ -1,7 +1,7 @@
/* loader.h - OS loaders */ /* loader.h - OS loaders */
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2004,2006,2007 Free Software Foundation, Inc. * Copyright (C) 2002,2003,2004,2006,2007,2009 Free Software Foundation, Inc.
* *
* GRUB is free software: you can redistribute it and/or modify * GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -26,19 +26,19 @@
#include <grub/types.h> #include <grub/types.h>
/* Check if a loader is loaded. */ /* Check if a loader is loaded. */
int EXPORT_FUNC(grub_loader_is_loaded) (void); int grub_loader_is_loaded (void);
/* Set loader functions. NORETURN must be set to true, if BOOT won't return /* Set loader functions. NORETURN must be set to true, if BOOT won't return
to the original state. */ to the original state. */
void EXPORT_FUNC(grub_loader_set) (grub_err_t (*boot) (void), void grub_loader_set (grub_err_t (*boot) (void),
grub_err_t (*unload) (void), grub_err_t (*unload) (void),
int noreturn); int noreturn);
/* Unset current loader, if any. */ /* Unset current loader, if any. */
void EXPORT_FUNC(grub_loader_unset) (void); void grub_loader_unset (void);
/* Call the boot hook in current loader. This may or may not return, /* Call the boot hook in current loader. This may or may not return,
depending on the setting by grub_loader_set. */ depending on the setting by grub_loader_set. */
grub_err_t EXPORT_FUNC(grub_loader_boot) (void); grub_err_t grub_loader_boot (void);
#endif /* ! GRUB_LOADER_HEADER */ #endif /* ! GRUB_LOADER_HEADER */