mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/serial: Drop serial_{put,get}c
After removal of gdbstub by commit d182f9feae ("x86: Remove gdbstub"),
we no longer have users of serial_{put,get}c functions, so remove them.
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
1 parent
e36c106b0b
commit
06024b2619
2 files changed
-82
No files matched your search
@@ -196,36 +196,6 @@ static void __serial_putc(struct serial_port *port, char c)
|
||||
}
|
||||
}
|
||||
|
||||
void serial_putc(int handle, char c)
|
||||
{
|
||||
struct serial_port *port;
|
||||
unsigned long flags;
|
||||
|
||||
if ( handle == -1 )
|
||||
return;
|
||||
|
||||
port = &com[handle & SERHND_IDX];
|
||||
if ( !port->driver || !port->driver->putc )
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&port->tx_lock, flags);
|
||||
|
||||
if ( (c == '\n') && (handle & SERHND_COOKED) )
|
||||
__serial_putc(port, '\r' | ((handle & SERHND_HI) ? 0x80 : 0x00));
|
||||
|
||||
if ( handle & SERHND_HI )
|
||||
c |= 0x80;
|
||||
else if ( handle & SERHND_LO )
|
||||
c &= 0x7f;
|
||||
|
||||
__serial_putc(port, c);
|
||||
|
||||
if ( port->driver->flush )
|
||||
port->driver->flush(port);
|
||||
|
||||
spin_unlock_irqrestore(&port->tx_lock, flags);
|
||||
}
|
||||
|
||||
void serial_puts(int handle, const char *s, size_t nr)
|
||||
{
|
||||
struct serial_port *port;
|
||||
@@ -261,48 +231,6 @@ void serial_puts(int handle, const char *s, size_t nr)
|
||||
spin_unlock_irqrestore(&port->tx_lock, flags);
|
||||
}
|
||||
|
||||
char serial_getc(int handle)
|
||||
{
|
||||
struct serial_port *port;
|
||||
char c;
|
||||
unsigned long flags;
|
||||
|
||||
if ( handle == -1 )
|
||||
return '\0';
|
||||
|
||||
port = &com[handle & SERHND_IDX];
|
||||
if ( !port->driver || !port->driver->getc )
|
||||
return '\0';
|
||||
|
||||
do {
|
||||
for ( ; ; )
|
||||
{
|
||||
spin_lock_irqsave(&port->rx_lock, flags);
|
||||
|
||||
if ( port->rxbufp != port->rxbufc )
|
||||
{
|
||||
c = port->rxbuf[mask_serial_rxbuf_idx(port->rxbufc++)];
|
||||
spin_unlock_irqrestore(&port->rx_lock, flags);
|
||||
break;
|
||||
}
|
||||
|
||||
if ( port->driver->getc(port, &c) )
|
||||
{
|
||||
spin_unlock_irqrestore(&port->rx_lock, flags);
|
||||
break;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&port->rx_lock, flags);
|
||||
|
||||
cpu_relax();
|
||||
udelay(100);
|
||||
}
|
||||
} while ( ((handle & SERHND_LO) && (c & 0x80)) ||
|
||||
((handle & SERHND_HI) && !(c & 0x80)) );
|
||||
|
||||
return c & 0x7f;
|
||||
}
|
||||
|
||||
int __init serial_parse_handle(const char *conf)
|
||||
{
|
||||
int handle, flags = 0;
|
||||
|
||||
@@ -112,19 +112,9 @@ void serial_endboot(void);
|
||||
/* Takes a config string and creates a numeric handle on the COM port. */
|
||||
int serial_parse_handle(const char *conf);
|
||||
|
||||
/* Transmit a single character via the specified COM port. */
|
||||
void serial_putc(int handle, char c);
|
||||
|
||||
/* Transmit a string via the specified COM port. */
|
||||
void serial_puts(int handle, const char *s, size_t nr);
|
||||
|
||||
/*
|
||||
* An alternative to registering a character-receive hook. This function
|
||||
* will not return until a character is available. It can safely be
|
||||
* called with interrupts disabled.
|
||||
*/
|
||||
char serial_getc(int handle);
|
||||
|
||||
/* Forcibly prevent serial lockup when the system is in a bad way. */
|
||||
/* (NB. This also forces an implicit serial_start_sync()). */
|
||||
void serial_force_unlock(int handle);
|
||||
|
||||