xref: /xnu-11215.1.10/pexpert/pexpert/arm/protos.h (revision 8d741a5de7ff4191bf97d57b9f54c2f6d4a15585)
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_init_debug(void *args);
14 
15 #ifdef  PEXPERT_KERNEL_PRIVATE
16 extern void console_write_unbuffered(char);
17 #endif
18 int serial_init(void);
19 
20 /**
21  * Forbid or allow transmission over each serial until they receive data.
22  */
23 void
24 serial_set_on_demand(bool);
25 
26 #if HIBERNATION
27 void serial_hibernation_init(void);
28 #endif /* HIBERNATION */
29 int serial_getc(void);
30 void serial_putc(char);
31 void uart_putc(char);
32 #ifdef PRIVATE
33 void serial_putc_options(char, bool);
34 void uart_putc_options(char, bool);
35 #endif /* PRIVATE */
36 int uart_getc(void);
37 
38 void pe_init_fiq(void);
39 
40 #ifdef PRIVATE
41 /**
42  * One hot ids to distinquish between all supported serial devices
43  */
44 typedef enum serial_device {
45 	SERIAL_UNKNOWN=0x0,
46 	SERIAL_APPLE_UART=0x1,
47 	SERIAL_DOCKCHANNEL=0x2,
48 	SERIAL_PL011_UART=0x4,
49 	SERIAL_DCC_UART=0x8
50 } serial_device_t;
51 
52 kern_return_t serial_irq_enable(serial_device_t device);
53 kern_return_t serial_irq_action(serial_device_t device);
54 bool serial_irq_filter(serial_device_t device);
55 
56 void serial_go_to_sleep(void);
57 #endif /* PRIVATE */
58 
59 int switch_to_serial_console(void);
60 void switch_to_old_console(int);
61 
62 #ifdef __cplusplus
63 }
64 #endif /* __cplusplus */
65 #endif /* _PEXPERT_ARM_PROTOS_H */
66