cpu.h revision 1.5 1 #ifndef _MACHINE_CPU_H_
2 #define _MACHINE_CPU_H_
3
4 #if defined(_KERNEL) && !defined(_LKM)
5 #include "opt_lockdebug.h"
6 #endif
7
8 #include <machine/frame.h>
9 #include <machine/psl.h>
10 #include <machine/intr.h>
11
12 #include <sys/sched.h>
13 struct cpu_info {
14 struct schedstate_percpu ci_schedstate; /* scheduler state */
15 #if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
16 u_long ci_spin_locks; /* # of spin locks held */
17 u_long ci_simple_locks; /* # of simple locks held */
18 #endif
19 };
20
21 #ifdef _KERNEL
22 extern struct cpu_info cpu_info_store;
23
24 #define curcpu() (&cpu_info_store)
25
26 u_long clkread __P((void));
27 void physaccess __P((caddr_t, caddr_t, int, int));
28
29 #endif /* _KERNEL */
30
31 /* ADAM: taken from macppc/cpu.h */
32 #define CLKF_USERMODE(frame) (((frame)->srr1 & PSL_PR) != 0)
33 #define CLKF_BASEPRI(frame) ((frame)->pri == 0)
34 #define CLKF_PC(frame) ((frame)->srr0)
35 #define CLKF_INTR(frame) ((frame)->depth > 0)
36
37 #define PROC_PC(p) (trapframe(p)->srr0)
38
39 #define cpu_swapout(p)
40 #define cpu_wait(p)
41 #define cpu_number() 0
42
43 extern void delay __P((unsigned));
44 #define DELAY(n) delay(n)
45
46 extern __volatile int want_resched;
47 extern __volatile int astpending;
48
49 #define need_resched(ci) (want_resched = 1, astpending = 1)
50 #define need_proftick(p) ((p)->p_flag |= P_OWEUPC, astpending = 1)
51 #define signotify(p) (astpending = 1)
52
53 extern char bootpath[];
54
55 #if defined(_KERNEL) || defined(_STANDALONE)
56 #define CACHELINESIZE 32
57 #endif
58
59 /* ADAM: commented out to avoid CTL_MACHDEP_NAMES redefiniton (see below) */
60 /*#include <powerpc/cpu.h>*/
61
62 /* end of ADAM */
63
64
65 /* ADAM: maybe we will need this??? */
66 /* values for machineid (happen to be AFF_* settings of AttnFlags) */
67 /*
68 #define AMIGA_68020 (1L<<1)
69 #define AMIGA_68030 (1L<<2)
70 #define AMIGA_68040 (1L<<3)
71 #define AMIGA_68881 (1L<<4)
72 #define AMIGA_68882 (1L<<5)
73 #define AMIGA_FPU40 (1L<<6)
74 #define AMIGA_68060 (1L<<7)
75 */
76
77 #ifdef _KERNEL
78 int machineid;
79 #endif
80
81 /* ADAM: copied from powerpc/cpu.h */
82 #ifndef _POWERPC_CPU_H_
83 #define _POWERPC_CPU_H_
84
85 extern void __syncicache __P((void *, int));
86
87 /*
88 * CTL_MACHDEP definitions.
89 */
90 #define CPU_CACHELINE 1
91 #define CPU_MAXID 2
92
93 #endif /* _POWERPC_CPU_H_ */
94
95 /* ADAM: copied from amiga/cpu.h */
96 #define CTL_MACHDEP_NAMES { \
97 { 0, 0 }, \
98 { "console_device", CTLTYPE_STRUCT }, \
99 }
100
101 #ifdef _KERNEL
102 /*
103 * Prototypes from amiga_init.c
104 */
105 void *alloc_z2mem __P((long));
106
107 /*
108 * Prototypes from autoconf.c
109 */
110 int is_a1200 __P((void));
111 int is_a3000 __P((void));
112 int is_a4000 __P((void));
113 #endif
114
115 #endif /* !_MACHINE_CPU_H_ */
116