2004-05-14 11:46:45 +00:00
|
|
|
/* $NetBSD: cpu.h,v 1.2 2001/02/23 21:23:52 reinoud Exp $ */
|
|
|
|
/* $FreeBSD$ */
|
|
|
|
|
|
|
|
#ifndef MACHINE_CPU_H
|
|
|
|
#define MACHINE_CPU_H
|
|
|
|
|
|
|
|
#include <machine/armreg.h>
|
2013-10-27 01:34:10 +00:00
|
|
|
#include <machine/frame.h>
|
2004-05-14 11:46:45 +00:00
|
|
|
|
2012-06-03 18:34:32 +00:00
|
|
|
void cpu_halt(void);
|
|
|
|
void swi_vm(void *);
|
2004-05-14 11:46:45 +00:00
|
|
|
|
2013-07-28 18:44:17 +00:00
|
|
|
#ifdef _KERNEL
|
2004-05-14 11:46:45 +00:00
|
|
|
static __inline uint64_t
|
|
|
|
get_cyclecount(void)
|
|
|
|
{
|
2004-11-04 19:15:43 +00:00
|
|
|
struct bintime bt;
|
|
|
|
|
|
|
|
binuptime(&bt);
|
2011-03-14 23:30:14 +00:00
|
|
|
return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
|
2004-11-04 19:15:43 +00:00
|
|
|
|
2004-05-14 11:46:45 +00:00
|
|
|
}
|
2013-07-28 18:44:17 +00:00
|
|
|
#endif
|
2004-05-14 11:46:45 +00:00
|
|
|
|
|
|
|
#define TRAPF_USERMODE(frame) ((frame->tf_spsr & PSR_MODE) == PSR_USR32_MODE)
|
|
|
|
|
|
|
|
#define TRAPF_PC(tfp) ((tfp)->tf_pc)
|
|
|
|
|
2012-06-03 18:34:32 +00:00
|
|
|
#define cpu_getstack(td) ((td)->td_frame->tf_usr_sp)
|
|
|
|
#define cpu_setstack(td, sp) ((td)->td_frame->tf_usr_sp = (sp))
|
2004-08-03 18:44:27 +00:00
|
|
|
#define cpu_spinwait() /* nothing */
|
2004-05-14 11:46:45 +00:00
|
|
|
|
|
|
|
#define ARM_NVEC 8
|
|
|
|
#define ARM_VEC_ALL 0xffffffff
|
|
|
|
|
|
|
|
extern vm_offset_t vector_page;
|
|
|
|
|
2014-02-09 15:54:31 +00:00
|
|
|
/*
|
|
|
|
* Params passed into initarm. If you change the size of this you will
|
|
|
|
* need to update locore.S to allocate more memory on the stack before
|
|
|
|
* it calls initarm.
|
|
|
|
*/
|
2012-06-03 18:34:32 +00:00
|
|
|
struct arm_boot_params {
|
|
|
|
register_t abp_size; /* Size of this structure */
|
|
|
|
register_t abp_r0; /* r0 from the boot loader */
|
|
|
|
register_t abp_r1; /* r1 from the boot loader */
|
|
|
|
register_t abp_r2; /* r2 from the boot loader */
|
|
|
|
register_t abp_r3; /* r3 from the boot loader */
|
2014-02-06 20:17:58 +00:00
|
|
|
vm_offset_t abp_physaddr; /* The kernel physical address */
|
2014-02-09 15:54:31 +00:00
|
|
|
vm_offset_t abp_pagetable; /* The early page table */
|
2012-06-03 18:34:32 +00:00
|
|
|
};
|
|
|
|
|
2005-02-01 06:36:27 +00:00
|
|
|
void arm_vector_init(vm_offset_t, int);
|
|
|
|
void fork_trampoline(void);
|
|
|
|
void identify_arm_cpu(void);
|
2012-06-03 18:34:32 +00:00
|
|
|
void *initarm(struct arm_boot_params *);
|
2004-05-14 11:46:45 +00:00
|
|
|
|
|
|
|
extern char btext[];
|
|
|
|
extern char etext[];
|
2012-06-03 18:34:32 +00:00
|
|
|
int badaddr_read(void *, size_t, void *);
|
2004-05-14 11:46:45 +00:00
|
|
|
#endif /* !MACHINE_CPU_H */
|