xref: /src/sys/arm/include/machdep.h (revision 05609c5eff27ea7b382237bd2a937c01c1ceb59a)
1 /* $NetBSD: machdep.h,v 1.7 2002/02/21 02:52:21 thorpej Exp $ */
2 
3 #ifndef _MACHDEP_BOOT_MACHDEP_H_
4 #define _MACHDEP_BOOT_MACHDEP_H_
5 
6 /* Structs that need to be initialised by initarm */
7 extern vm_offset_t irqstack;
8 extern vm_offset_t undstack;
9 extern vm_offset_t abtstack;
10 
11 /* Define various stack sizes in pages */
12 #define IRQ_STACK_SIZE	1
13 #define ABT_STACK_SIZE	1
14 #define UND_STACK_SIZE	1
15 
16 /* misc prototypes used by the many arm machdeps */
17 struct trapframe;
18 void halt(void);
19 void abort_handler(struct trapframe *, int );
20 void set_stackptrs(int cpu);
21 void undefinedinstruction_bounce(struct trapframe *);
22 
23 /* Early boot related helper functions */
24 struct arm_boot_params;
25 vm_offset_t default_parse_boot_param(struct arm_boot_params *abp);
26 vm_offset_t fake_preload_metadata(struct arm_boot_params *abp,
27     void *dtb_ptr, size_t dtb_size);
28 vm_offset_t parse_boot_param(struct arm_boot_params *abp);
29 void arm_parse_fdt_bootargs(void);
30 void arm_print_kenv(void);
31 
32 int arm_get_vfpstate(struct thread *td, void *args);
33 
34 /* Board-specific attributes */
35 void board_set_serial(uint64_t);
36 void board_set_revision(uint32_t);
37 
38 int arm_predict_branch(void *, u_int, register_t, register_t *,
39     u_int (*)(void*, int), u_int (*)(void*, vm_offset_t, u_int*));
40 
41 #ifdef PLATFORM
42 typedef void delay_func(int, void *);
43 void arm_set_delay(delay_func *, void *);
44 #endif
45 
46 #ifdef EFI
47 struct efi_map_header;
48 struct mem_region;
49 void arm_add_efi_map_entries(struct efi_map_header *efihdr,
50     struct mem_region *mr, int *mrcnt);
51 #endif
52 
53 #ifdef SOCDEV_PA
54 /*
55  * The virtual address SOCDEV_PA is mapped at.
56  */
57 extern uintptr_t socdev_va;
58 #endif
59 
60 /*
61  * Symbols created by ldscript.arm which are accessible in the kernel as global
62  * symbols. They have uint8 type because they mark the byte location where the
63  * corresponding data starts or ends (in the end case, it's the next byte
64  * following the data, so the data size is end-start).  These are listed below
65  * in the order they occur within the kernel (i.e., the address of each variable
66  * should be greater than any of the ones before it).
67  */
68 extern uint8_t _start;		/* Kernel entry point in locore.S */
69 extern uint8_t _etext;		/* text segment end */
70 extern uint8_t _extab_start;	/* unwind table start */
71 extern uint8_t _exidx_start;	/* unwind index start */
72 extern uint8_t _exidx_end;	/* unwind index end */
73 extern uint8_t _start_ctors;	/* ctors data start */
74 extern uint8_t _stop_ctors;	/* ctors data end */
75 extern uint8_t _edata;		/* data segment end */
76 extern uint8_t __bss_start;	/* bss segment start */
77 extern uint8_t _ebss;		/* bss segment end */
78 extern uint8_t _end;		/* End of kernel (text+ctors+unwind+data+bss) */
79 
80 #endif /* !_MACHINE_MACHDEP_H_ */
81