diff options
author | marcel <marcel@FreeBSD.org> | 2006-04-01 19:04:54 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2006-04-01 19:04:54 +0000 |
commit | 01ed5990aef062b97e91680895804b9689c8076b (patch) | |
tree | f866ed454b38b3e3ed100d7237faffef820e51f3 /sys/dev/uart/uart_cpu.h | |
parent | 6d14bcd43fdc1e895dd4255bb9f88dba939296ce (diff) | |
download | FreeBSD-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.h | 8 |
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_ */ |