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