Remove grub_{modname}_init and grub_{modname}_fini. They should never

be used directly if it's really a module and GRUB_MOD_INIT shouldn't
	be used on non-modules.

	* grub-core/commands/boot.c (GRUB_MOD_INIT) [LOONGSON || QEMU_MIPS]:
	Rename to grub_boot_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_boot_fini.
	* grub-core/commands/keylayouts.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_keylayouts_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_keylayouts_fini.
	* grub-core/font/font_cmd.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_font_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_font_fini.
	* grub-core/kern/mips/loongson/init.c: Replace explicit protos with
	includes.
	(grub_machine_init): Remove empty inits.
	* grub-core/kern/mips/qemu_mips/init.c: Replace explicit protos with
	includes.
	(grub_machine_init): Remove empty inits.
	* grub-core/term/arc/console.c: Remove explicit proto.
	* grub-core/term/at_keyboard.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_at_keyboard_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_at_keyboard_fini.
	* grub-core/term/gfxterm.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_gfxterm_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_gfxterm_fini.
	* grub-core/term/i386/pc/vga_text.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_vgatext_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_vgatext_fini.
	* grub-core/term/ieee1275/console.c: Remove explicit proto.
	* grub-core/term/serial.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_serial_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_serial_fini.
	* grub-core/term/terminfo.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_terminfo_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_terminfo_fini.
	* grub-core/video/bitmap.c (GRUB_MOD_INIT): Removed.
	(GRUB_MOD_FINI): Likewise.
	* grub-core/video/radeon_fuloong2e.c (GRUB_MOD_INIT)
	[LOONGSON]: Rename to grub_video_radeon_fuloong2e_init.
	(GRUB_MOD_FINI) [LOONGSON]: Rename to
	grub_video_radeon_fuloong2e_fini.
	* grub-core/video/sis315pro.c (GRUB_MOD_INIT)
	[LOONGSON]: Rename to grub_video_sis315pro_init.
	(GRUB_MOD_FINI) [LOONGSON]: Rename to
	grub_video_sis315pro_fini.
	* grub-core/video/sm712.c (GRUB_MOD_INIT)
	[LOONGSON]: Rename to grub_video_sm712_init.
	(GRUB_MOD_FINI) [LOONGSON]: Rename to
	grub_video_sm712_fini.
	* include/grub/at_keyboard.h (grub_at_keyboard_init): New proto.
	(grub_at_keyboard_fini): Likewise.
	* include/grub/dl.h (GRUB_MOD_INIT) [!GRUB_UTIL && !EMU]:
	Don't declare grub_{modname}_init.
	(GRUB_MOD_INIT) [!GRUB_UTIL && !EMU]: Don't declare grub_{modname}_fini.
	* include/grub/keyboard_layouts.h (grub_keylayouts_init) [!EMU]:
	New proto.
	(grub_keylayouts_fini) [!EMU]: Likewise.
	* include/grub/serial.h (grub_serial_init) [!EMU]:
	New proto.
	(grub_serial_fini) [!EMU]: Likewise.
	* include/grub/terminfo.h (grub_terminfo_init) [!EMU]:
	New proto.
	(grub_terminfo_fini) [!EMU]: Likewise.
	* include/grub/video.h (grub_font_init) [!EMU]:
	New proto.
	(grub_font_fini) [!EMU]: Likewise.
	(grub_gfxterm_init) [!EMU]: Likewise.
	(grub_gfxterm_fini) [!EMU]: Likewise.
	(grub_video_sm712_init) [!EMU]: Likewise.
	(grub_video_sm712_fini) [!EMU]: Likewise.
	(grub_video_sis315pro_init) [!EMU]: Likewise.
	(grub_video_sis315pro_fini) [!EMU]: Likewise.
	(grub_video_radeon_fuloong2e_init) [!EMU]: Likewise.
	(grub_video_radeon_fuloong2e_fini) [!EMU]: Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-27 00:28:45 +01:00
parent d5534665ff
commit 036985b8ce
25 changed files with 244 additions and 52 deletions

View file

@ -1,3 +1,86 @@
2012-02-26 Vladimir Serbinenko <phcoder@gmail.com>
Remove grub_{modname}_init and grub_{modname}_fini. They should never
be used directly if it's really a module and GRUB_MOD_INIT shouldn't
be used on non-modules.
* grub-core/commands/boot.c (GRUB_MOD_INIT) [LOONGSON || QEMU_MIPS]:
Rename to grub_boot_init.
(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_boot_fini.
* grub-core/commands/keylayouts.c (GRUB_MOD_INIT)
[LOONGSON || QEMU_MIPS]: Rename to grub_keylayouts_init.
(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_keylayouts_fini.
* grub-core/font/font_cmd.c (GRUB_MOD_INIT)
[LOONGSON || QEMU_MIPS]: Rename to grub_font_init.
(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_font_fini.
* grub-core/kern/mips/loongson/init.c: Replace explicit protos with
includes.
(grub_machine_init): Remove empty inits.
* grub-core/kern/mips/qemu_mips/init.c: Replace explicit protos with
includes.
(grub_machine_init): Remove empty inits.
* grub-core/term/arc/console.c: Remove explicit proto.
* grub-core/term/at_keyboard.c (GRUB_MOD_INIT)
[LOONGSON || QEMU_MIPS]: Rename to grub_at_keyboard_init.
(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
grub_at_keyboard_fini.
* grub-core/term/gfxterm.c (GRUB_MOD_INIT)
[LOONGSON || QEMU_MIPS]: Rename to grub_gfxterm_init.
(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
grub_gfxterm_fini.
* grub-core/term/i386/pc/vga_text.c (GRUB_MOD_INIT)
[LOONGSON || QEMU_MIPS]: Rename to grub_vgatext_init.
(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
grub_vgatext_fini.
* grub-core/term/ieee1275/console.c: Remove explicit proto.
* grub-core/term/serial.c (GRUB_MOD_INIT)
[LOONGSON || QEMU_MIPS]: Rename to grub_serial_init.
(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
grub_serial_fini.
* grub-core/term/terminfo.c (GRUB_MOD_INIT)
[LOONGSON || QEMU_MIPS]: Rename to grub_terminfo_init.
(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
grub_terminfo_fini.
* grub-core/video/bitmap.c (GRUB_MOD_INIT): Removed.
(GRUB_MOD_FINI): Likewise.
* grub-core/video/radeon_fuloong2e.c (GRUB_MOD_INIT)
[LOONGSON]: Rename to grub_video_radeon_fuloong2e_init.
(GRUB_MOD_FINI) [LOONGSON]: Rename to
grub_video_radeon_fuloong2e_fini.
* grub-core/video/sis315pro.c (GRUB_MOD_INIT)
[LOONGSON]: Rename to grub_video_sis315pro_init.
(GRUB_MOD_FINI) [LOONGSON]: Rename to
grub_video_sis315pro_fini.
* grub-core/video/sm712.c (GRUB_MOD_INIT)
[LOONGSON]: Rename to grub_video_sm712_init.
(GRUB_MOD_FINI) [LOONGSON]: Rename to
grub_video_sm712_fini.
* include/grub/at_keyboard.h (grub_at_keyboard_init): New proto.
(grub_at_keyboard_fini): Likewise.
* include/grub/dl.h (GRUB_MOD_INIT) [!GRUB_UTIL && !EMU]:
Don't declare grub_{modname}_init.
(GRUB_MOD_INIT) [!GRUB_UTIL && !EMU]: Don't declare grub_{modname}_fini.
* include/grub/keyboard_layouts.h (grub_keylayouts_init) [!EMU]:
New proto.
(grub_keylayouts_fini) [!EMU]: Likewise.
* include/grub/serial.h (grub_serial_init) [!EMU]:
New proto.
(grub_serial_fini) [!EMU]: Likewise.
* include/grub/terminfo.h (grub_terminfo_init) [!EMU]:
New proto.
(grub_terminfo_fini) [!EMU]: Likewise.
* include/grub/video.h (grub_font_init) [!EMU]:
New proto.
(grub_font_fini) [!EMU]: Likewise.
(grub_gfxterm_init) [!EMU]: Likewise.
(grub_gfxterm_fini) [!EMU]: Likewise.
(grub_video_sm712_init) [!EMU]: Likewise.
(grub_video_sm712_fini) [!EMU]: Likewise.
(grub_video_sis315pro_init) [!EMU]: Likewise.
(grub_video_sis315pro_fini) [!EMU]: Likewise.
(grub_video_radeon_fuloong2e_init) [!EMU]: Likewise.
(grub_video_radeon_fuloong2e_fini) [!EMU]: Likewise.
2012-02-26 Vladimir Serbinenko <phcoder@gmail.com>
Make nand a prefix for nand devices.

View file

@ -183,14 +183,22 @@ grub_cmd_boot (struct grub_command *cmd __attribute__ ((unused)),
static grub_command_t cmd_boot;
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_boot_init (void)
#else
GRUB_MOD_INIT(boot)
#endif
{
cmd_boot =
grub_register_command ("boot", grub_cmd_boot,
0, N_("Boot an operating system."));
}
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_boot_fini (void)
#else
GRUB_MOD_FINI(boot)
#endif
{
grub_unregister_command (cmd_boot);
}

View file

@ -290,13 +290,21 @@ grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)),
static grub_command_t cmd;
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_keylayouts_init (void)
#else
GRUB_MOD_INIT(keylayouts)
#endif
{
cmd = grub_register_command ("keymap", grub_cmd_keymap,
0, N_("Load a keyboard layout."));
}
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_keylayouts_fini (void)
#else
GRUB_MOD_FINI(keylayouts)
#endif
{
grub_unregister_command (cmd);
}

View file

@ -61,7 +61,11 @@ lsfonts_command (grub_command_t cmd __attribute__ ((unused)),
static grub_command_t cmd_loadfont, cmd_lsfonts;
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_font_init (void)
#else
GRUB_MOD_INIT(font)
#endif
{
grub_font_loader_init ();
@ -74,7 +78,11 @@ GRUB_MOD_INIT(font)
0, N_("List the loaded fonts."));
}
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_font_fini (void)
#else
GRUB_MOD_FINI(font)
#endif
{
/* TODO: Determine way to free allocated resources.
Warning: possible pointer references could be in use. */

View file

@ -32,19 +32,12 @@
#include <grub/term.h>
#include <grub/cpu/memory.h>
#include <grub/i18n.h>
extern void grub_video_sm712_init (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_init (void);
extern void grub_bitmap_init (void);
extern void grub_font_init (void);
extern void grub_gfxterm_init (void);
extern void grub_at_keyboard_init (void);
extern void grub_serial_init (void);
extern void grub_terminfo_init (void);
extern void grub_keylayouts_init (void);
extern void grub_boot_init (void);
#include <grub/video.h>
#include <grub/terminfo.h>
#include <grub/keyboard_layouts.h>
#include <grub/serial.h>
#include <grub/loader.h>
#include <grub/at_keyboard.h>
grub_err_t
grub_machine_mmap_iterate (grub_memory_hook_t hook)
@ -204,11 +197,9 @@ grub_machine_init (void)
/* Initialize output terminal (can't be done earlier, as gfxterm
relies on a working heap. */
grub_video_init ();
grub_video_sm712_init ();
grub_video_sis315pro_init ();
grub_video_radeon_fuloong2e_init ();
grub_bitmap_init ();
grub_font_init ();
grub_gfxterm_init ();

View file

@ -8,19 +8,15 @@
#include <grub/time.h>
#include <grub/machine/memory.h>
#include <grub/machine/kernel.h>
#include <grub/machine/console.h>
#include <grub/cpu/memory.h>
#include <grub/memory.h>
extern void grub_serial_init (void);
extern void grub_terminfo_init (void);
extern void grub_at_keyboard_init (void);
extern void grub_video_init (void);
extern void grub_bitmap_init (void);
extern void grub_font_init (void);
extern void grub_gfxterm_init (void);
extern void grub_keylayouts_init (void);
extern void grub_boot_init (void);
extern void grub_vga_text_init (void);
#include <grub/video.h>
#include <grub/terminfo.h>
#include <grub/keyboard_layouts.h>
#include <grub/serial.h>
#include <grub/loader.h>
#include <grub/at_keyboard.h>
static inline int
probe_mem (grub_addr_t addr)
@ -61,8 +57,6 @@ grub_machine_init (void)
grub_install_get_time_ms (grub_rtc_get_time_ms);
grub_video_init ();
grub_bitmap_init ();
grub_font_init ();
grub_keylayouts_init ();

View file

@ -113,8 +113,6 @@ grub_console_init_early (void)
grub_term_register_output ("console", &grub_console_term_output);
}
void grub_terminfo_init (void);
void
grub_console_init_lately (void)
{

View file

@ -625,14 +625,22 @@ static struct grub_term_input grub_at_keyboard_term =
.getkey = grub_at_keyboard_getkey
};
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_at_keyboard_init (void)
#else
GRUB_MOD_INIT(at_keyboard)
#endif
{
grub_term_register_input ("at_keyboard", &grub_at_keyboard_term);
grub_loader_register_preboot_hook (grub_at_fini_hw, grub_at_restore_hw,
GRUB_LOADER_PREBOOT_HOOK_PRIO_CONSOLE);
}
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_at_keyboard_fini (void)
#else
GRUB_MOD_FINI(at_keyboard)
#endif
{
grub_keyboard_controller_fini (NULL);
grub_term_unregister_input (&grub_at_keyboard_term);

View file

@ -1244,7 +1244,11 @@ static struct grub_term_output grub_video_term =
static grub_extcmd_t background_image_cmd_handle;
static grub_command_t background_color_cmd_handle;
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_gfxterm_init (void)
#else
GRUB_MOD_INIT(gfxterm)
#endif
{
grub_term_register_output ("gfxterm", &grub_video_term);
background_image_cmd_handle =
@ -1260,7 +1264,11 @@ GRUB_MOD_INIT(gfxterm)
N_("Set background color for active terminal."));
}
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_gfxterm_fini (void)
#else
GRUB_MOD_FINI(gfxterm)
#endif
{
grub_unregister_command (background_color_cmd_handle);
grub_unregister_extcmd (background_image_cmd_handle);

View file

@ -22,6 +22,10 @@
#include <grub/types.h>
#include <grub/vga.h>
#if defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
#include <grub/machine/console.h>
#endif
GRUB_MOD_LICENSE ("GPLv3+");
#define COLS 80
@ -168,12 +172,20 @@ static struct grub_term_output grub_vga_text_term =
.highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
};
#if defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_vga_text_init (void)
#else
GRUB_MOD_INIT(vga_text)
#endif
{
grub_term_register_output ("vga_text", &grub_vga_text_term);
}
#if defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_vga_text_fini (void)
#else
GRUB_MOD_FINI(vga_text)
#endif
{
grub_term_unregister_output (&grub_vga_text_term);
}

View file

@ -214,9 +214,6 @@ static struct grub_term_output grub_console_term_output =
.highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
};
void grub_terminfo_fini (void);
void grub_terminfo_init (void);
void
grub_console_init_early (void)
{

View file

@ -374,7 +374,11 @@ grub_serial_unregister_driver (struct grub_serial_driver *driver)
static grub_extcmd_t cmd;
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_serial_init (void)
#else
GRUB_MOD_INIT(serial)
#endif
{
cmd = grub_register_extcmd ("serial", grub_cmd_serial, 0,
N_("[OPTIONS...]"),
@ -398,7 +402,11 @@ GRUB_MOD_INIT(serial)
#endif
}
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
void grub_serial_fini (void)
#else
GRUB_MOD_FINI(serial)
#endif
{
while (grub_serial_ports)
grub_serial_unregister (grub_serial_ports);

View file

@ -701,7 +701,11 @@ grub_cmd_terminfo (grub_extcmd_context_t ctxt, int argc, char **args)
static grub_extcmd_t cmd;
#if defined (GRUB_MACHINE_IEEE1275) || defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_ARC)
void grub_terminfo_init (void)
#else
GRUB_MOD_INIT(terminfo)
#endif
{
cmd = grub_register_extcmd ("terminfo", grub_cmd_terminfo, 0,
N_("[[-a|-u|-v] [-g WxH] TERM [TYPE]]"),
@ -709,7 +713,11 @@ GRUB_MOD_INIT(terminfo)
options);
}
#if defined (GRUB_MACHINE_IEEE1275) || defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS) || defined (GRUB_MACHINE_ARC)
void grub_terminfo_fini (void)
#else
GRUB_MOD_FINI(terminfo)
#endif
{
grub_unregister_extcmd (cmd);
}

View file

@ -247,12 +247,3 @@ void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap)
return bitmap->data;
}
/* Initialize bitmap module. */
GRUB_MOD_INIT(bitmap)
{
}
/* Finalize bitmap module. */
GRUB_MOD_FINI(bitmap)
{
}

View file

@ -220,12 +220,20 @@ static struct grub_video_adapter grub_video_radeon_fuloong2e_adapter =
.next = 0
};
#ifdef GRUB_MACHINE_MIPS_LOONGSON
void grub_video_radeon_fuloong2e_init (void)
#else
GRUB_MOD_INIT(video_radeon_fuloong2e)
#endif
{
grub_video_register (&grub_video_radeon_fuloong2e_adapter);
}
#ifdef GRUB_MACHINE_MIPS_LOONGSON
void grub_video_radeon_fuloong2e_fini (void)
#else
GRUB_MOD_FINI(video_radeon_fuloong2e)
#endif
{
grub_video_unregister (&grub_video_radeon_fuloong2e_adapter);
}

View file

@ -430,12 +430,20 @@ static struct grub_video_adapter grub_video_sis315pro_adapter =
.next = 0
};
#ifdef GRUB_MACHINE_MIPS_LOONGSON
void grub_video_sis315pro_init (void)
#else
GRUB_MOD_INIT(video_sis315pro)
#endif
{
grub_video_register (&grub_video_sis315pro_adapter);
}
#ifdef GRUB_MACHINE_MIPS_LOONGSON
void grub_video_sis315pro_fini (void)
#else
GRUB_MOD_FINI(video_sis315pro)
#endif
{
grub_video_unregister (&grub_video_sis315pro_adapter);
}

View file

@ -771,12 +771,20 @@ static struct grub_video_adapter grub_video_sm712_adapter =
.next = 0
};
#ifdef GRUB_MACHINE_MIPS_LOONGSON
void grub_video_sm712_init (void)
#else
GRUB_MOD_INIT(video_sm712)
#endif
{
grub_video_register (&grub_video_sm712_adapter);
}
#ifdef GRUB_MACHINE_MIPS_LOONGSON
void grub_video_sm712_fini (void)
#else
GRUB_MOD_FINI(video_sm712)
#endif
{
grub_video_unregister (&grub_video_sm712_adapter);
}

View file

@ -707,13 +707,3 @@ grub_video_set_mode (const char *modestring,
return grub_error (GRUB_ERR_BAD_ARGUMENT,
N_("no suitable video mode found"));
}
/* Initialize Video API module. */
GRUB_MOD_INIT(video)
{
}
/* Finalize Video API module. */
GRUB_MOD_FINI(video)
{
}

View file

@ -35,4 +35,7 @@
#define KEYBOARD_ISREADY(x) ((x) & 0x01)
#define KEYBOARD_SCANCODE(x) ((x) & 0x7f)
extern void grub_at_keyboard_init (void);
extern void grub_at_keyboard_fini (void);
#endif

View file

@ -34,6 +34,24 @@
*/
#ifndef ASM_FILE
#if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
#ifndef GRUB_MOD_INIT
#define GRUB_MOD_INIT(name) \
static void grub_mod_init (grub_dl_t mod __attribute__ ((unused))) __attribute__ ((used)); \
static void \
grub_mod_init (grub_dl_t mod __attribute__ ((unused)))
#endif
#ifndef GRUB_MOD_FINI
#define GRUB_MOD_FINI(name) \
static void grub_mod_fini (void) __attribute__ ((used)); \
static void \
grub_mod_fini (void)
#endif
#else
#ifndef GRUB_MOD_INIT
#define GRUB_MOD_INIT(name) \
static void grub_mod_init (grub_dl_t mod __attribute__ ((unused))) __attribute__ ((used)); \
@ -56,6 +74,8 @@ grub_mod_fini (void)
#endif
#endif
#ifndef ASM_FILE
#ifdef APPLE_CC
#define GRUB_MOD_SECTION(x) "_" #x ", _" #x ""

View file

@ -139,4 +139,9 @@ typedef enum grub_keyboard_key
unsigned EXPORT_FUNC(grub_term_map_key) (grub_keyboard_key_t code, int status);
#ifndef GRUB_MACHINE_EMU
extern void grub_keylayouts_init (void);
extern void grub_keylayouts_fini (void);
#endif
#endif /* GRUB_KEYBOARD_LAYOUTS */

View file

@ -65,4 +65,9 @@ struct grub_preboot *EXPORT_FUNC(grub_loader_register_preboot_hook) (grub_err_t
/* Unregister given preboot hook. */
void EXPORT_FUNC (grub_loader_unregister_preboot_hook) (struct grub_preboot *hnd);
#ifndef GRUB_MACHINE_EMU
void grub_boot_init (void);
void grub_boot_fini (void);
#endif
#endif /* ! GRUB_LOADER_HEADER */

View file

@ -173,4 +173,9 @@ struct grub_serial_port *grub_serial_find (const char *name);
extern struct grub_serial_driver grub_ns8250_driver;
void EXPORT_FUNC(grub_serial_unregister_driver) (struct grub_serial_driver *driver);
#ifndef GRUB_MACHINE_EMU
extern void grub_serial_init (void);
extern void grub_serial_fini (void);
#endif
#endif

View file

@ -78,4 +78,9 @@ grub_err_t EXPORT_FUNC (grub_terminfo_output_register) (struct grub_term_output
const char *type);
grub_err_t EXPORT_FUNC (grub_terminfo_output_unregister) (struct grub_term_output *term);
#ifndef GRUB_MACHINE_EMU
void grub_terminfo_init (void);
void grub_terminfo_fini (void);
#endif
#endif /* ! GRUB_TERMINFO_HEADER */

View file

@ -529,4 +529,17 @@ int EXPORT_FUNC (grub_video_get_named_color) (const char *name,
grub_err_t EXPORT_FUNC (grub_video_parse_color) (const char *s,
grub_video_rgba_color_t *color);
#ifndef GRUB_MACHINE_EMU
extern void grub_font_init (void);
extern void grub_font_fini (void);
extern void grub_gfxterm_init (void);
extern void grub_gfxterm_fini (void);
extern void grub_video_sm712_init (void);
extern void grub_video_sm712_fini (void);
extern void grub_video_sis315pro_init (void);
extern void grub_video_radeon_fuloong2e_init (void);
extern void grub_video_sis315pro_fini (void);
extern void grub_video_radeon_fuloong2e_fini (void);
#endif
#endif /* ! GRUB_VIDEO_HEADER */