* [PATCH] xen/serial: Drop serial_{put,get}c
@ 2024-02-08 14:16 Michal Orzel
2024-02-08 21:05 ` Stefano Stabellini
0 siblings, 1 reply; 2+ messages in thread
From: Michal Orzel @ 2024-02-08 14:16 UTC (permalink / raw)
To: xen-devel
Cc: Michal Orzel, Andrew Cooper, George Dunlap, Jan Beulich,
Julien Grall, Stefano Stabellini, Wei Liu
After removal of gdbstub by commit d182f9feae6d ("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>
---
xen/drivers/char/serial.c | 72 ---------------------------------------
xen/include/xen/serial.h | 10 ------
2 files changed, 82 deletions(-)
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index 324024c29a10..93e217d34859 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -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;
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index 12ef24351d0f..7548bb73249b 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -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);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xen/serial: Drop serial_{put,get}c
2024-02-08 14:16 [PATCH] xen/serial: Drop serial_{put,get}c Michal Orzel
@ 2024-02-08 21:05 ` Stefano Stabellini
0 siblings, 0 replies; 2+ messages in thread
From: Stefano Stabellini @ 2024-02-08 21:05 UTC (permalink / raw)
To: Michal Orzel
Cc: xen-devel, Andrew Cooper, George Dunlap, Jan Beulich,
Julien Grall, Stefano Stabellini, Wei Liu
On Thu, 8 Feb 2024, Michal Orzel wrote:
> After removal of gdbstub by commit d182f9feae6d ("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>
> ---
> xen/drivers/char/serial.c | 72 ---------------------------------------
> xen/include/xen/serial.h | 10 ------
> 2 files changed, 82 deletions(-)
>
> diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
> index 324024c29a10..93e217d34859 100644
> --- a/xen/drivers/char/serial.c
> +++ b/xen/drivers/char/serial.c
> @@ -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;
> diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
> index 12ef24351d0f..7548bb73249b 100644
> --- a/xen/include/xen/serial.h
> +++ b/xen/include/xen/serial.h
> @@ -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);
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-08 21:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-08 14:16 [PATCH] xen/serial: Drop serial_{put,get}c Michal Orzel
2024-02-08 21:05 ` Stefano Stabellini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.