cpu.h revision 1.4 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 cpu_swapout(p)
38 #define cpu_wait(p)
39 #define cpu_number() 0
40
41 extern void delay __P((unsigned));
42 #define DELAY(n) delay(n)
43
44 extern __volatile int want_resched;
45 extern __volatile int astpending;
46
47 #define need_resched(ci) (want_resched = 1, astpending = 1)
48 #define need_proftick(p) ((p)->p_flag |= P_OWEUPC, astpending = 1)
49 #define signotify(p) (astpending = 1)
50
51 extern char bootpath[];
52
53 #if defined(_KERNEL) || defined(_STANDALONE)
54 #define CACHELINESIZE 32
55 #endif
56
57 /* ADAM: commented out to avoid CTL_MACHDEP_NAMES redefiniton (see below) */
58 /*#include <powerpc/cpu.h>*/
59
60 /* end of ADAM */
61
62
63 /* ADAM: maybe we will need this??? */
64 /* values for machineid (happen to be AFF_* settings of AttnFlags) */
65 /*
66 #define AMIGA_68020 (1L<<1)
67 #define AMIGA_68030 (1L<<2)
68 #define AMIGA_68040 (1L<<3)
69 #define AMIGA_68881 (1L<<4)
70 #define AMIGA_68882 (1L<<5)
71 #define AMIGA_FPU40 (1L<<6)
72 #define AMIGA_68060 (1L<<7)
73 */
74
75 #ifdef _KERNEL
76 int machineid;
77 #endif
78
79 /* ADAM: copied from powerpc/cpu.h */
80 #ifndef _POWERPC_CPU_H_
81 #define _POWERPC_CPU_H_
82
83 extern void __syncicache __P((void *, int));
84
85 /*
86 * CTL_MACHDEP definitions.
87 */
88 #define CPU_CACHELINE 1
89 #define CPU_MAXID 2
90
91 #endif /* _POWERPC_CPU_H_ */
92
93 /* ADAM: copied from amiga/cpu.h */
94 #define CTL_MACHDEP_NAMES { \
95 { 0, 0 }, \
96 { "console_device", CTLTYPE_STRUCT }, \
97 }
98
99 #ifdef _KERNEL
100 /*
101 * Prototypes from amiga_init.c
102 */
103 void *alloc_z2mem __P((long));
104
105 /*
106 * Prototypes from autoconf.c
107 */
108 int is_a1200 __P((void));
109 int is_a3000 __P((void));
110 int is_a4000 __P((void));
111 #endif
112
113 #endif /* !_MACHINE_CPU_H_ */
114