summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc64/include/cpu.h
blob: 867133533832dbeb2ed0a65f81be623bdea30948 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef _MACHINE_CPU_H_
#define _MACHINE_CPU_H_

#include <machine/intr.h>
#include <machine/frame.h>

#include <sys/device.h>
#include <sys/sched.h>

struct cpu_info {
	struct device	*ci_dev;
	struct cpu_info	*ci_next;
	struct schedstate_percpu ci_schedstate;

	struct proc	*ci_curproc;

#define CPUSAVE_LEN	9
	register_t	ci_tempsave[CPUSAVE_LEN];

	uint32_t	ci_ipending;
#ifdef DIAGNOSTIC
	int		ci_mutex_level;
#endif
	int		ci_want_resched;

	uint32_t	ci_randseed;
};

extern struct cpu_info cpu_info_primary;

register struct cpu_info *__curcpu asm("r13");
#define curcpu()	__curcpu

#define MAXCPUS			1
#define CPU_IS_PRIMARY(ci)	1
#define CPU_INFO_UNIT(ci)	0
#define CPU_INFO_ITERATOR	int
#define CPU_INFO_FOREACH(cii, ci) \
	for (cii = 0, ci = curcpu(); ci != NULL; ci = NULL)


#define CLKF_INTR(frame)	0
#define CLKF_USERMODE(frame)	0
#define CLKF_PC(frame)		0

#define aston(p)		((p)->p_md.md_astpending = 1)
#define need_proftick(p)	aston(p)

#define cpu_kick(ci)
#define cpu_unidle(ci)
#define CPU_BUSY_CYCLE()	do {} while (0)
#define signotify(p)		setsoftast()

unsigned int cpu_rnd_messybits(void);

void need_resched(struct cpu_info *);
#define clear_resched(ci)	((ci)->ci_want_resched = 0)

void delay(u_int);
#define DELAY(x)	delay(x)

#define setsoftast()		aston(curcpu()->ci_curproc)

#define PROC_STACK(p)		0
#define PROC_PC(p)		0

#define intr_disable()		0
#define intr_restore(s)		do {} while (0)

#endif /* _MACHINE_CPU_H_ */