Implement serial on IEEE1275 and EFI.
* docs/grub.texi (Platform-specific limitations): Fix the columen video on emu. Mention arc and emu as the only platforms without serial support. * grub-core/Makefile.core.def (serial): Enable on all terminfomodule and ieee1275 platforms. * grub-core/term/efi/serial.c: New file. * grub-core/term/ieee1275/serial.c: Likewise. * grub-core/term/serial.c (grub_serial_find): Disable direct port specification if no ns8250 driver is available. (grub_cmd_serial): Likewise. (GRUB_MOD_INIT) [GRUB_MACHINE_IEEE1275]: Init ofserial. (GRUB_MOD_INIT) [GRUB_MACHINE_EFI]: Init efiserial. * include/grub/efi/api.h (GRUB_EFI_SERIAL_IO_GUID): New define. (grub_efi_parity_type_t): New type. (grub_efi_stop_bits_t): Likewise. (grub_efi_serial_io_interface): New struct. * include/grub/serial.h (grub_serial_port): Make 'broken' field available for all interfaces. Add EFI and IEEE1275 fields. (grub_ofserial_init): New proto. (grub_efiserial_init): Likeiwse. * util/grub.d/00_header.in: Don't check for the presence of serial module.
This commit is contained in:
parent
0ec820904e
commit
a9c7fd1c6c
9 changed files with 566 additions and 19 deletions
|
@ -22,7 +22,9 @@
|
|||
#include <grub/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/terminfo.h>
|
||||
#if !defined (GRUB_MACHINE_EMU) && (defined(__mips__) || defined (__i386__) || defined (__x86_64__))
|
||||
#include <grub/cpu/io.h>
|
||||
#endif
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/list.h>
|
||||
|
@ -134,7 +136,7 @@ grub_serial_find (const char *name)
|
|||
if (grub_strcmp (port->name, name) == 0)
|
||||
break;
|
||||
|
||||
#ifndef GRUB_MACHINE_EMU
|
||||
#if (defined(__mips__) || defined (__i386__) || defined (__x86_64__)) && !defined(GRUB_MACHINE_EMU)
|
||||
if (!port && grub_memcmp (name, "port", sizeof ("port") - 1) == 0
|
||||
&& grub_isxdigit (name [sizeof ("port") - 1]))
|
||||
{
|
||||
|
@ -224,7 +226,8 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args)
|
|||
err = port->driver->configure (port, &config);
|
||||
if (err)
|
||||
return err;
|
||||
#ifndef GRUB_MACHINE_EMU
|
||||
#if !defined (GRUB_MACHINE_EMU) && (defined(__mips__) || defined (__i386__) || defined (__x86_64__))
|
||||
|
||||
/* Compatibility kludge. */
|
||||
if (port->driver == &grub_ns8250_driver)
|
||||
{
|
||||
|
@ -383,10 +386,16 @@ GRUB_MOD_INIT(serial)
|
|||
grub_memcpy (&grub_serial_terminfo_input,
|
||||
&grub_serial_terminfo_input_template,
|
||||
sizeof (grub_serial_terminfo_input));
|
||||
|
||||
#ifndef GRUB_MACHINE_EMU
|
||||
|
||||
#if !defined (GRUB_MACHINE_EMU) && (defined(__mips__) || defined (__i386__) || defined (__x86_64__))
|
||||
grub_ns8250_init ();
|
||||
#endif
|
||||
#ifdef GRUB_MACHINE_IEEE1275
|
||||
grub_ofserial_init ();
|
||||
#endif
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
grub_efiserial_init ();
|
||||
#endif
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(serial)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue