xref: /xnu-8792.81.2/pexpert/pexpert/arm/protos.h (revision 19c3b8c28c31cb8130e034cfb5df6bf9ba342d90)
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 #if HIBERNATION
20 void serial_hibernation_init(void);
21 #endif /* HIBERNATION */
22 int serial_getc(void);
23 void serial_putc(char);
24 void uart_putc(char);
25 #ifdef PRIVATE
26 void serial_putc_options(char, bool);
27 void uart_putc_options(char, bool);
28 #endif /* PRIVATE */
29 int uart_getc(void);
30 
31 void pe_init_fiq(void);
32 
33 #ifdef PRIVATE
34 /**
35  * One hot ids to distinquish between all supported serial devices
36  */
37 typedef enum serial_device {
38 	SERIAL_UNKNOWN=0x0,
39 	SERIAL_APPLE_UART=0x1,
40 	SERIAL_DOCKCHANNEL=0x2,
41 	SERIAL_PI3_UART=0x4,
42 	SERIAL_VMAPPLE_UART=0x8,
43 	SERIAL_DCC_UART=0x10
44 } serial_device_t;
45 
46 kern_return_t serial_irq_enable(serial_device_t device);
47 kern_return_t serial_irq_action(serial_device_t device);
48 bool serial_irq_filter(serial_device_t device);
49 
50 void serial_go_to_sleep(void);
51 #endif /* PRIVATE */
52 
53 int switch_to_serial_console(void);
54 void switch_to_old_console(int);
55 
56 #ifdef __cplusplus
57 }
58 #endif /* __cplusplus */
59 #endif /* _PEXPERT_ARM_PROTOS_H */
60