summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/uart/uart_cpu.h')
-rw-r--r--sys/dev/uart/uart_cpu.h30
1 files changed, 6 insertions, 24 deletions
diff --git a/sys/dev/uart/uart_cpu.h b/sys/dev/uart/uart_cpu.h
index 99ced1a..2db0412 100644
--- a/sys/dev/uart/uart_cpu.h
+++ b/sys/dev/uart/uart_cpu.h
@@ -33,6 +33,8 @@
#include <sys/lock.h>
#include <sys/mutex.h>
+struct uart_softc;
+
/*
* Low-level operations for use by console and/or debug port support.
*/
@@ -43,8 +45,6 @@ struct uart_ops {
void (*putc)(struct uart_bas *, int);
int (*rxready)(struct uart_bas *);
int (*getc)(struct uart_bas *, struct mtx *);
- void (*grab)(struct uart_bas *);
- void (*ungrab)(struct uart_bas *);
};
extern bus_space_tag_t uart_bus_space_io;
@@ -53,7 +53,6 @@ extern bus_space_tag_t uart_bus_space_mem;
/*
* Console and debug port device info.
*/
-struct uart_softc;
struct uart_devinfo {
SLIST_ENTRY(uart_devinfo) next;
struct uart_ops *ops;
@@ -70,6 +69,7 @@ struct uart_devinfo {
int (*detach)(struct uart_softc*);
void *cookie; /* Type dependent use. */
struct mtx *hwmtx;
+ struct uart_softc *sc; /* valid only from start of attach */
};
int uart_cpu_eqres(struct uart_bas *, struct uart_bas *);
@@ -137,27 +137,6 @@ uart_putc(struct uart_devinfo *di, int c)
uart_unlock(di->hwmtx);
}
-static __inline void
-uart_grab(struct uart_devinfo *di)
-{
-
- uart_lock(di->hwmtx);
- if (di->ops->grab)
- di->ops->grab(&di->bas);
- uart_unlock(di->hwmtx);
-}
-
-static __inline void
-uart_ungrab(struct uart_devinfo *di)
-{
-
- uart_lock(di->hwmtx);
- if (di->ops->ungrab)
- di->ops->ungrab(&di->bas);
- uart_unlock(di->hwmtx);
-}
-
-
static __inline int
uart_rxready(struct uart_devinfo *di)
{
@@ -190,4 +169,7 @@ uart_getc(struct uart_devinfo *di)
return (di->ops->getc(&di->bas, di->hwmtx));
}
+void uart_grab(struct uart_devinfo *di);
+void uart_ungrab(struct uart_devinfo *di);
+
#endif /* _DEV_UART_CPU_H_ */
OpenPOWER on IntegriCloud