1 // Copyright 2017 The Fuchsia Authors
2 //
3 // Use of this source code is governed by a MIT-style
4 // license that can be found in the LICENSE file or at
5 // https://opensource.org/licenses/MIT
6 
7 #pragma once
8 
9 #include <dev/uart.h>
10 #include <zircon/compiler.h>
11 
12 __BEGIN_CDECLS
13 
14 // UART interface
15 struct pdev_uart_ops {
16     int (*getc)(bool wait);
17 
18     /* panic-time uart accessors, intended to be run with interrupts disabled */
19     int (*pputc)(char c);
20     int (*pgetc)(void);
21 
22     void (*start_panic)(void);
23     void (*dputs)(const char* str, size_t len, bool block, bool map_NL);
24 };
25 
26 void pdev_register_uart(const struct pdev_uart_ops* ops);
27 
28 __END_CDECLS
29