xref: /xnu-11417.121.6/pexpert/pexpert/arm/protos.h (revision a1e26a70f38d1d7daa7b49b258e2f8538ad81650)
1 /*
2  * Copyright (c) 2000-2021 Apple Inc. All rights reserved.
3  */
4 #ifndef _PEXPERT_ARM_PROTOS_H
5 #define _PEXPERT_ARM_PROTOS_H
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif /* __cplusplus */
10 
11 extern vm_offset_t pe_arm_get_soc_base_phys(void);
12 extern uint32_t pe_arm_init_interrupts(void *args);
13 extern void pe_arm_debug_init_early(void *args);
14 extern void pe_arm_debug_init_late(void);
15 
16 #ifdef  PEXPERT_KERNEL_PRIVATE
17 extern void console_write_unbuffered(char);
18 #endif
19 int serial_init(void);
20 
21 /**
22  * Forbid or allow transmission over each serial until they receive data.
23  */
24 void
25 serial_set_on_demand(bool);
26 
27 #if HIBERNATION
28 void serial_hibernation_init(void);
29 #endif /* HIBERNATION */
30 int serial_getc(void);
31 void serial_putc(char);
32 void uart_putc(char);
33 #ifdef PRIVATE
34 void serial_putc_options(char, bool);
35 void uart_putc_options(char, bool);
36 #endif /* PRIVATE */
37 int uart_getc(void);
38 
39 void pe_init_fiq(void);
40 
41 #ifdef PRIVATE
42 /**
43  * One hot ids to distinquish between all supported serial devices
44  */
45 typedef enum serial_device {
46 	SERIAL_UNKNOWN=0x0,
47 	SERIAL_APPLE_UART=0x1,
48 	SERIAL_DOCKCHANNEL=0x2,
49 	SERIAL_PL011_UART=0x4,
50 	SERIAL_DCC_UART=0x8
51 } serial_device_t;
52 
53 kern_return_t serial_irq_enable(serial_device_t device);
54 kern_return_t serial_irq_action(serial_device_t device);
55 bool serial_irq_filter(serial_device_t device);
56 
57 void serial_go_to_sleep(void);
58 #endif /* PRIVATE */
59 
60 int switch_to_serial_console(void);
61 void switch_to_old_console(int);
62 
63 #ifdef __cplusplus
64 }
65 #endif /* __cplusplus */
66 #endif /* _PEXPERT_ARM_PROTOS_H */
67