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