xref: /freebsd-src/sys/arm/include/machdep.h (revision 639a626b40503f81a184ccd93fb9bc023f86a3fd)
16fc729afSOlivier Houchard /* $NetBSD: machdep.h,v 1.7 2002/02/21 02:52:21 thorpej Exp $ */
26fc729afSOlivier Houchard 
36fc729afSOlivier Houchard #ifndef _MACHDEP_BOOT_MACHDEP_H_
46fc729afSOlivier Houchard #define _MACHDEP_BOOT_MACHDEP_H_
56fc729afSOlivier Houchard 
611612982SAndrew Turner /* Structs that need to be initialised by initarm */
784233ddbSIan Lepore extern vm_offset_t irqstack;
884233ddbSIan Lepore extern vm_offset_t undstack;
984233ddbSIan Lepore extern vm_offset_t abtstack;
1011612982SAndrew Turner 
1111612982SAndrew Turner /* Define various stack sizes in pages */
1211612982SAndrew Turner #define IRQ_STACK_SIZE	1
1311612982SAndrew Turner #define ABT_STACK_SIZE	1
1411612982SAndrew Turner #define UND_STACK_SIZE	1
1511612982SAndrew Turner 
166fc729afSOlivier Houchard /* misc prototypes used by the many arm machdeps */
17fce4536cSIan Lepore struct trapframe;
184ea15b87SAndrew Turner void init_proc0(vm_offset_t kstack);
196fc729afSOlivier Houchard void halt(void);
2026659812SIan Lepore void abort_handler(struct trapframe *, int );
2111612982SAndrew Turner void set_stackptrs(int cpu);
22fce4536cSIan Lepore void undefinedinstruction_bounce(struct trapframe *);
233590dad0SWarner Losh 
243590dad0SWarner Losh /* Early boot related helper functions */
25d39655d7SWarner Losh struct arm_boot_params;
260bb13a26SWarner Losh vm_offset_t default_parse_boot_param(struct arm_boot_params *abp);
27fda16d46SMichal Meloun vm_offset_t fake_preload_metadata(struct arm_boot_params *abp,
28fda16d46SMichal Meloun     void *dtb_ptr, size_t dtb_size);
290bb13a26SWarner Losh vm_offset_t parse_boot_param(struct arm_boot_params *abp);
30ffeeb2abSMichal Meloun void arm_parse_fdt_bootargs(void);
31ffeeb2abSMichal Meloun void arm_print_kenv(void);
32ffeeb2abSMichal Meloun 
33a86d7982SMichal Meloun int arm_get_vfpstate(struct thread *td, void *args);
34d39655d7SWarner Losh 
35e57c66d5SOleksandr Tymoshenko /* Board-specific attributes */
36e57c66d5SOleksandr Tymoshenko void board_set_serial(uint64_t);
37e57c66d5SOleksandr Tymoshenko void board_set_revision(uint32_t);
38e57c66d5SOleksandr Tymoshenko 
39232e189aSZbigniew Bodek int arm_predict_branch(void *, u_int, register_t, register_t *,
40232e189aSZbigniew Bodek     u_int (*)(void*, int), u_int (*)(void*, vm_offset_t, u_int*));
41232e189aSZbigniew Bodek 
429ce763a0SAndrew Turner #ifdef PLATFORM
43cca48a59SAndrew Turner typedef void delay_func(int, void *);
44cca48a59SAndrew Turner void arm_set_delay(delay_func *, void *);
45cca48a59SAndrew Turner #endif
46cca48a59SAndrew Turner 
47ffeeb2abSMichal Meloun #ifdef EFI
48ffeeb2abSMichal Meloun struct efi_map_header;
49ffeeb2abSMichal Meloun struct mem_region;
50ffeeb2abSMichal Meloun void arm_add_efi_map_entries(struct efi_map_header *efihdr,
51ffeeb2abSMichal Meloun     struct mem_region *mr, int *mrcnt);
52ffeeb2abSMichal Meloun #endif
53ffeeb2abSMichal Meloun 
54*639a626bSAndrew Turner #ifdef SOCDEV_PA
55*639a626bSAndrew Turner /*
56*639a626bSAndrew Turner  * The virtual address SOCDEV_PA is mapped at.
57*639a626bSAndrew Turner  */
58*639a626bSAndrew Turner extern uintptr_t socdev_va;
59*639a626bSAndrew Turner #endif
60*639a626bSAndrew Turner 
61e214f286SIan Lepore /*
62e214f286SIan Lepore  * Symbols created by ldscript.arm which are accessible in the kernel as global
63e214f286SIan Lepore  * symbols. They have uint8 type because they mark the byte location where the
64e214f286SIan Lepore  * corresponding data starts or ends (in the end case, it's the next byte
65e214f286SIan Lepore  * following the data, so the data size is end-start).  These are listed below
66e214f286SIan Lepore  * in the order they occur within the kernel (i.e., the address of each variable
67e214f286SIan Lepore  * should be greater than any of the ones before it).
68e214f286SIan Lepore  */
69e214f286SIan Lepore extern uint8_t _start;		/* Kernel entry point in locore.S */
70e214f286SIan Lepore extern uint8_t _etext;		/* text segment end */
71e214f286SIan Lepore extern uint8_t _extab_start;	/* unwind table start */
72e214f286SIan Lepore extern uint8_t _exidx_start;	/* unwind index start */
73e214f286SIan Lepore extern uint8_t _exidx_end;	/* unwind index end */
74e214f286SIan Lepore extern uint8_t _start_ctors;	/* ctors data start */
75e214f286SIan Lepore extern uint8_t _stop_ctors;	/* ctors data end */
76e214f286SIan Lepore extern uint8_t _edata;		/* data segment end */
77e214f286SIan Lepore extern uint8_t __bss_start;	/* bss segment start */
78e214f286SIan Lepore extern uint8_t _ebss;		/* bss segment end */
79e214f286SIan Lepore extern uint8_t _end;		/* End of kernel (text+ctors+unwind+data+bss) */
80e214f286SIan Lepore 
816fc729afSOlivier Houchard #endif /* !_MACHINE_MACHDEP_H_ */
82