9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 6d0bd290b34115ca8c810e9ff19ad015c9ddcf29
parent 7d263add03234a3f0aba33da8c3b055b338cb7f4
Author: Roberto E. Vargas Caballero <roberto.vargas@midokura.com>
Date:   Thu, 17 Nov 2022 11:20:45 +0100

os9/uart: Add some logging messages

Diffstat:
Msrc/os9/dev/devuart.c | 3+++
Msrc/os9/dev/dummyuart.c | 1+
Msrc/os9/dev/pl011.c | 1+
Msrc/os9/dev/uart.h | 1+
4 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/os9/dev/devuart.c b/src/os9/dev/devuart.c @@ -219,6 +219,7 @@ uartlink(Uartphy *phy, Attr *attr) Attr *a; char *cfg = NULL; + kprint("uart: Linking uart%d %s", nuarts, phy->name); if (nuarts == NR_UARTS) panic("uartlink1"); @@ -228,6 +229,7 @@ uartlink(Uartphy *phy, Attr *attr) uarts[nuarts++] = up; for (a = attr; a->key; a++) { + kprint(" %s=%s", a->key, a->value); if (!strcmp(a->key, "base")) up->base = (void *) strtoull(a->value, NULL, 0); else if (!strcmp(a->key, "clk")) @@ -235,6 +237,7 @@ uartlink(Uartphy *phy, Attr *attr) else if (!strcmp(a->key, "cfg")) cfg = a->value; } + kprint("\n"); (*phy->init)(up, attr); if (!cfg) diff --git a/src/os9/dev/dummyuart.c b/src/os9/dev/dummyuart.c @@ -78,6 +78,7 @@ dummyuartstatus(Uart *up, struct uartstat *st) } Uartphy dummyuartphy = { + .name = "dummyuart", .init = dummyuartinit, .setbauds = setbauds, .read = dummyuartread, diff --git a/src/os9/dev/pl011.c b/src/os9/dev/pl011.c @@ -378,6 +378,7 @@ pl011status(Uart *up, struct uartstat *st) } Uartphy pl011phy = { + .name = "pl011", .init = pl011init, .setbauds = setbauds, .read = pl011read, diff --git a/src/os9/dev/uart.h b/src/os9/dev/uart.h @@ -41,6 +41,7 @@ struct uart { }; struct uartphy { + char *name; void (*init)(Uart *up, Attr *attr); int (*setbauds)(Uart *up, long rate); int (*signal)(Uart *up, int mask, int val);