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