Allow all modules to perform serial IO
* grub-core/term-serial.c (grub_serial_find): Remove static qualifier * include/grub/serial.h (grub_serial_port_configure): New inline function. (grub_serial_port_fetch): Likewise. (grub_serial_port_put): Likewise. (grub_serial_port_fini): Likewise. (grub_serial_find): New proto.
This commit is contained in:
parent
f627652531
commit
33f784e881
3 changed files with 40 additions and 1 deletions
|
@ -96,6 +96,32 @@ grub_err_t EXPORT_FUNC(grub_serial_register) (struct grub_serial_port *port);
|
|||
|
||||
void EXPORT_FUNC(grub_serial_unregister) (struct grub_serial_port *port);
|
||||
|
||||
/* Convenience functions to perform primitive operations on a port. */
|
||||
static inline grub_err_t
|
||||
grub_serial_port_configure (struct grub_serial_port *port,
|
||||
struct grub_serial_config *config)
|
||||
{
|
||||
return port->driver->configure (port, config);
|
||||
}
|
||||
|
||||
static inline int
|
||||
grub_serial_port_fetch (struct grub_serial_port *port)
|
||||
{
|
||||
return port->driver->fetch (port);
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_serial_port_put (struct grub_serial_port *port, const int c)
|
||||
{
|
||||
port->driver->put (port, c);
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_serial_port_fini (struct grub_serial_port *port)
|
||||
{
|
||||
port->driver->fini (port);
|
||||
}
|
||||
|
||||
/* Set default settings. */
|
||||
static inline grub_err_t
|
||||
grub_serial_config_defaults (struct grub_serial_port *port)
|
||||
|
@ -117,6 +143,7 @@ grub_serial_config_defaults (struct grub_serial_port *port)
|
|||
|
||||
void grub_ns8250_init (void);
|
||||
char *grub_serial_ns8250_add_port (grub_port_t port);
|
||||
struct grub_serial_port *grub_serial_find (char *name);
|
||||
extern struct grub_serial_driver grub_ns8250_driver;
|
||||
void EXPORT_FUNC(grub_serial_unregister_driver) (struct grub_serial_driver *driver);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue