#ifndef _ALPHA_H_
#define _ALPHA_H_
typedef union alpha_f_float {
uint32_t i;
uint32_t frac_hi: 7,
exp: 8,
sign: 1,
frac_lo: 16;
} f_float;
typedef union alpha_s_float {
uint32_t i;
uint32_t frac: 23,
exp: 8,
sign: 1;
} s_float;
typedef union alpha_t_float {
uint64_t i;
uint64_t frac: 52,
exp: 11,
sign: 1;
} t_float;
#ifdef _KERNEL
#include <sys/bus.h>
#include <sys/pcu.h>
struct pcb;
struct lwp;
struct reg;
struct rpb;
struct trapframe;
extern bool alpha_is_qemu;
extern int alpha_use_cctr;
extern u_long cpu_implver;
extern u_long cpu_amask;
extern int bootdev_debug;
extern int alpha_fp_sync_complete;
extern int alpha_fp_complete_debug;
extern int alpha_unaligned_print, alpha_unaligned_fix, alpha_unaligned_sigbus;
extern void (*alpha_delay_fn)(unsigned long);
void XentArith(uint64_t, uint64_t, uint64_t);
void XentIF(uint64_t, uint64_t, uint64_t);
void XentInt(uint64_t, uint64_t, uint64_t);
void XentMM(uint64_t, uint64_t, uint64_t);
void XentRestart(void);
void XentSys(uint64_t, uint64_t, uint64_t);
void XentUna(uint64_t, uint64_t, uint64_t);
void alpha_init(u_long, u_long, u_long, u_long, u_long);
void alpha_page_physload_sheltered(u_long, u_long, u_long, u_long);
void ast(struct trapframe *);
int badaddr(void *, size_t);
int badaddr_read(void *, size_t, void *);
uint64_t console_restart(struct trapframe *);
void do_sir(void);
void exception_return(void);
void alpha_kthread_backstop(void);
void frametoreg(const struct trapframe *, struct reg *);
void init_bootstrap_console(void);
void init_prom_interface(unsigned long, struct rpb *);
void interrupt(unsigned long, unsigned long, unsigned long,
struct trapframe *);
void machine_check(unsigned long, struct trapframe *, unsigned long,
unsigned long);
uint64_t hwrpb_checksum(void);
void hwrpb_restart_setup(void);
void regdump(struct trapframe *);
void regtoframe(const struct reg *, struct trapframe *);
void savectx(struct pcb *);
void trap(unsigned long, unsigned long, unsigned long, unsigned long,
struct trapframe *);
void trap_init(void);
void enable_nsio_ide(bus_space_tag_t);
extern const pcu_ops_t fpu_ops;
void fpu_state_load(struct lwp *, u_int);
void fpu_state_save(struct lwp *);
void fpu_state_release(struct lwp *);
static __inline bool
fpu_valid_p(struct lwp *l)
{
return pcu_valid_p(&fpu_ops, l);
}
static __inline void
fpu_load(void)
{
pcu_load(&fpu_ops);
}
static __inline void
fpu_save(lwp_t *l)
{
pcu_save(&fpu_ops, l);
}
static __inline void
fpu_discard(lwp_t *l, bool valid_p)
{
pcu_discard(&fpu_ops, l, valid_p);
}
void alpha_patch(bool);
struct cpu_info;
int cpu_iccb_send(long, const char *);
void cpu_iccb_receive(void);
void cpu_hatch(struct cpu_info *);
void cpu_halt(void) __attribute__((__noreturn__));
void cpu_spinup_trampoline(void);
void cpu_pause(unsigned long);
void cpu_resume(unsigned long);
#if defined(DDB)
void cpu_debug_dump(void);
#endif
void alpha_sts(int, s_float *);
void alpha_stt(int, t_float *);
void alpha_lds(int, s_float *);
void alpha_ldt(int, t_float *);
uint64_t alpha_read_fpcr(void);
void alpha_write_fpcr(uint64_t);
uint64_t alpha_read_fp_c(struct lwp *);
void alpha_write_fp_c(struct lwp *, uint64_t);
void alpha_fp_init(void);
int alpha_fp_complete(u_long, u_long, struct lwp *, uint64_t *);
int alpha_fp_complete_at(u_long, struct lwp *, uint64_t *);
void rlprintf(struct timeval *t, const char *fmt, ...);
#endif
#endif