Deleted Added
sdiff udiff text old ( 107206 ) new ( 115084 )
full compact
1/* $FreeBSD: head/sys/ia64/include/cpu.h 115084 2003-05-16 21:26:42Z marcel $ */
2/* From: NetBSD: cpu.h,v 1.18 1997/09/23 23:17:49 mjacob Exp */
3
4/*
5 * Copyright (c) 1988 University of Utah.
6 * Copyright (c) 1982, 1990, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * This code is derived from software contributed to Berkeley by

--- 31 unchanged lines hidden (view full) ---

41 * from: Utah $Hdr: cpu.h 1.16 91/03/25$
42 *
43 * @(#)cpu.h 8.4 (Berkeley) 1/5/94
44 */
45
46#ifndef _MACHINE_CPU_H_
47#define _MACHINE_CPU_H_
48
49#include <machine/frame.h>
50
51/*
52 * Arguments to hardclock and gatherstats encapsulate the previous machine
53 * state in an opaque clockframe.
54 */
55struct clockframe {
56 struct trapframe cf_tf;
57};
58#define CLKF_PC(cf) ((cf)->cf_tf.tf_special.iip)
59#define CLKF_USERMODE(cf) ((CLKF_PC(cf) >> 61) < 5)
60
61/* Used by signaling code. */
62#define cpu_getstack(td) ((td)->td_frame->tf_special.sp)
63
64/* XXX */
65#define TRAPF_PC(tf) ((tf)->tf_special.iip)
66#define TRAPF_USERMODE(framep) \
67 (((framep)->tf_special.psr & IA64_PSR_CPL) == IA64_PSR_CPL_USER)
68
69/*
70 * CTL_MACHDEP definitions.
71 */
72#define CPU_CONSDEV 1 /* dev_t: console terminal device */
73#define CPU_ROOT_DEVICE 2 /* string: root device name */
74#define CPU_UNALIGNED_PRINT 3 /* int: print unaligned accesses */
75#define CPU_UNALIGNED_FIX 4 /* int: fix unaligned accesses */
76#define CPU_UNALIGNED_SIGBUS 5 /* int: SIGBUS unaligned accesses */

--- 22 unchanged lines hidden (view full) ---

99struct thread;
100struct reg;
101struct rpb;
102struct trapframe;
103
104extern struct rpb *hwrpb;
105extern volatile int mc_expected, mc_received;
106
107int badaddr(void *, size_t);
108int badaddr_read(void *, size_t, void *);
109u_int64_t console_restart(u_int64_t, u_int64_t, u_int64_t);
110int do_ast(struct trapframe *);
111void dumpconf(void);
112void frametoreg(struct trapframe *, struct reg *);
113long fswintrberr(void); /* MAGIC */
114int ia64_highfp_drop(struct thread *);
115int ia64_highfp_load(struct thread *);
116int ia64_highfp_save(struct thread *);
117void ia64_init(u_int64_t, u_int64_t);
118int ia64_pa_access(u_long);
119void init_prom_interface(struct rpb*);
120void interrupt(u_int64_t, struct trapframe *);
121void machine_check(unsigned long, struct trapframe *, unsigned long,
122 unsigned long);
123u_int64_t hwrpb_checksum(void);
124void hwrpb_restart_setup(void);
125void regdump(struct trapframe *);
126void regtoframe(struct reg *, struct trapframe *);
127void set_iointr(void (*)(void *, unsigned long));
128void fork_trampoline(void); /* MAGIC */
129int syscall(struct trapframe *);
130void trap(int vector, struct trapframe *framep);
131void ia64_probe_sapics(void);
132int ia64_count_cpus(void);
133void map_gateway_page(void);
134void map_pal_code(void);
135void map_port_space(void);
136void cpu_mp_add(uint, uint, uint);
137
138/*
139 * Return contents of in-cpu fast counter as a sort of "bogo-time"
140 * for non-critical timing.
141 */
142static __inline u_int64_t
143get_cyclecount(void)
144{
145 return (ia64_get_itc());
146}
147
148#endif /* _KERNEL */
149
150#endif /* _MACHINE_CPU_H_ */