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:
Shea Levy 2011-11-10 09:41:07 +01:00 committed by Vladimir 'phcoder' Serbinenko
parent f627652531
commit 33f784e881
3 changed files with 40 additions and 1 deletions

View file

@ -1,3 +1,15 @@
2011-11-10 Shea Levy <slevy@tieronedesign.com>
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.
2011-11-10 Vladimir Serbinenko <phcoder@gmail.com>
Put symlink at the end of the node and fix a potential

View file

@ -125,7 +125,7 @@ static struct grub_term_output grub_serial_term_output =
static struct grub_serial_port *
struct grub_serial_port *
grub_serial_find (char *name)
{
struct grub_serial_port *port;

View file

@ -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);