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