xref: /freebsd/sys/arm/include/cpu.h (revision 9f1b87f106100470dafeeab83abfa98ab86be3f7)
16fc729afSOlivier Houchard /* $NetBSD: cpu.h,v 1.2 2001/02/23 21:23:52 reinoud Exp $ */
26fc729afSOlivier Houchard /* $FreeBSD$ */
36fc729afSOlivier Houchard 
46fc729afSOlivier Houchard #ifndef MACHINE_CPU_H
56fc729afSOlivier Houchard #define MACHINE_CPU_H
66fc729afSOlivier Houchard 
76fc729afSOlivier Houchard #include <machine/armreg.h>
86fc729afSOlivier Houchard 
96fc729afSOlivier Houchard void    cpu_halt(void);
106fc729afSOlivier Houchard void    swi_vm(void *);
116fc729afSOlivier Houchard 
126fc729afSOlivier Houchard static __inline uint64_t
136fc729afSOlivier Houchard get_cyclecount(void)
146fc729afSOlivier Houchard {
156fc729afSOlivier Houchard 	return (0);
166fc729afSOlivier Houchard }
176fc729afSOlivier Houchard 
186fc729afSOlivier Houchard #define CPU_CONSDEV 1
196fc729afSOlivier Houchard #define CPU_ADJKERNTZ           2       /* int: timezone offset (seconds) */
206fc729afSOlivier Houchard #define CPU_DISRTCSET           3       /* int: disable resettodr() call */
216fc729afSOlivier Houchard #define CPU_BOOTINFO            4       /* struct: bootinfo */
226fc729afSOlivier Houchard #define CPU_WALLCLOCK           5       /* int: indicates wall CMOS clock */
236fc729afSOlivier Houchard #define CPU_MAXID               6       /* number of valid machdep ids */
246fc729afSOlivier Houchard 
256fc729afSOlivier Houchard 
266fc729afSOlivier Houchard #define CLKF_USERMODE(frame)    ((frame->if_spsr & PSR_MODE) == PSR_USR32_MODE)
276fc729afSOlivier Houchard 
286fc729afSOlivier Houchard #define TRAPF_USERMODE(frame)	((frame->tf_spsr & PSR_MODE) == PSR_USR32_MODE)
296fc729afSOlivier Houchard #define CLKF_PC(frame)          (frame->if_pc)
306fc729afSOlivier Houchard 
316fc729afSOlivier Houchard #define TRAPF_PC(tfp)		((tfp)->tf_pc)
326fc729afSOlivier Houchard 
336fc729afSOlivier Houchard #define cpu_getstack(td)        ((td)->td_frame->tf_usr_sp)
346fc729afSOlivier Houchard #define cpu_setstack(td, sp)    ((td)->td_frame->tf_usr_sp = (sp))
359f1b87f1SMaxime Henrion #define cpu_spinwait()		/* nothing */
366fc729afSOlivier Houchard 
376fc729afSOlivier Houchard #define ARM_NVEC		8
386fc729afSOlivier Houchard #define ARM_VEC_ALL		0xffffffff
396fc729afSOlivier Houchard 
406fc729afSOlivier Houchard extern vm_offset_t vector_page;
416fc729afSOlivier Houchard 
426fc729afSOlivier Houchard void fork_trampoline(void);
436fc729afSOlivier Houchard void *initarm(void *, void *);
446fc729afSOlivier Houchard void arm_vector_init(vm_offset_t, int);
456fc729afSOlivier Houchard void identify_arm_cpu(void);
466fc729afSOlivier Houchard 
476fc729afSOlivier Houchard extern char btext[];
486fc729afSOlivier Houchard extern char etext[];
496fc729afSOlivier Houchard int badaddr_read (void *, size_t, void *);
506fc729afSOlivier Houchard #endif /* !MACHINE_CPU_H */
51