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