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