summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_cpu.h
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-04-01 19:04:54 +0000
committermarcel <marcel@FreeBSD.org>2006-04-01 19:04:54 +0000
commit01ed5990aef062b97e91680895804b9689c8076b (patch)
treef866ed454b38b3e3ed100d7237faffef820e51f3 /sys/dev/uart/uart_cpu.h
parent6d14bcd43fdc1e895dd4255bb9f88dba939296ce (diff)
downloadFreeBSD-src-01ed5990aef062b97e91680895804b9689c8076b.zip
FreeBSD-src-01ed5990aef062b97e91680895804b9689c8076b.tar.gz
Don't hold the hardware mutex across getc(). It can wait indefinitely
for a character to be received. Instead let getc() do any necesary locking.
Diffstat (limited to 'sys/dev/uart/uart_cpu.h')
-rw-r--r--sys/dev/uart/uart_cpu.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/dev/uart/uart_cpu.h b/sys/dev/uart/uart_cpu.h
index 310d6b9..a3f0dcb 100644
--- a/sys/dev/uart/uart_cpu.h
+++ b/sys/dev/uart/uart_cpu.h
@@ -42,7 +42,7 @@ struct uart_ops {
void (*term)(struct uart_bas *);
void (*putc)(struct uart_bas *, int);
int (*poll)(struct uart_bas *);
- int (*getc)(struct uart_bas *);
+ int (*getc)(struct uart_bas *, struct mtx *);
};
extern struct uart_ops uart_i8251_ops;
@@ -150,12 +150,8 @@ uart_poll(struct uart_devinfo *di)
static __inline int
uart_getc(struct uart_devinfo *di)
{
- int res;
- uart_lock(di->hwmtx);
- res = di->ops.getc(&di->bas);
- uart_unlock(di->hwmtx);
- return (res);
+ return (di->ops.getc(&di->bas, di->hwmtx));
}
#endif /* _DEV_UART_CPU_H_ */
OpenPOWER on IntegriCloud