a7d0570e67
state into global and per-CPU scheduler state: - Global state: sched_qs (run queues), sched_whichqs (bitmap of non-empty run queues), sched_slpque (sleep queues). NOTE: These may collectively move into a struct schedstate at some point in the future. - Per-CPU state, struct schedstate_percpu: spc_runtime (time process on this CPU started running), spc_flags (replaces struct proc's p_schedflags), and spc_curpriority (usrpri of processes on this CPU). - Every platform must now supply a struct cpu_info and a curcpu() macro. Simplify existing cpu_info declarations where appropriate. - All references to per-CPU scheduler state now made through curcpu(). NOTE: this will likely be adjusted in the future after further changes to struct proc are made. Tested on i386 and Alpha. Changes are mostly mechanical, but apologies in advance if it doesn't compile on a particular platform.
51 lines
1.1 KiB
C
51 lines
1.1 KiB
C
/* $NetBSD: cpu.h,v 1.15 2000/05/26 21:19:29 thorpej Exp $ */
|
|
/* $OpenBSD: cpu.h,v 1.9 1998/01/28 13:46:10 pefo Exp $ */
|
|
|
|
#ifndef _ARC_CPU_H_
|
|
#define _ARC_CPU_H_
|
|
|
|
/*
|
|
* Internal timer causes hard interrupt 5.
|
|
*/
|
|
#define MIPS_INT_MASK_CLOCK MIPS_INT_MASK_5
|
|
|
|
#include <mips/cpu.h>
|
|
#include <mips/cpuregs.h>
|
|
|
|
#ifndef _LOCORE
|
|
#if defined(_KERNEL) && !defined(_LKM)
|
|
#include "opt_lockdebug.h"
|
|
#endif
|
|
|
|
#include <sys/sched.h>
|
|
struct cpu_info {
|
|
struct schedstate_percpu ci_schedstate; /* scheduler state */
|
|
#if defined(DIAGNOSTIC) || defined(LOCKDEBUG)
|
|
u_long ci_spin_locks; /* # of spin locks held */
|
|
u_long ci_simple_locks; /* # of simple locks held */
|
|
#endif
|
|
};
|
|
|
|
#ifdef _KERNEL
|
|
extern struct cpu_info cpu_info_store;
|
|
|
|
#define curcpu() (&cpu_info_store)
|
|
#define cpu_number() (0)
|
|
#endif
|
|
#endif /* !_LOCORE */
|
|
|
|
/*
|
|
* definitions of cpu-dependent requirements
|
|
* referenced in generic code
|
|
*/
|
|
#define COPY_SIGCODE /* copy sigcode above user stack in exec */
|
|
|
|
#define INT_MASK_REAL_DEV MIPS3_HARD_INT_MASK /* XXX */
|
|
|
|
#ifndef _LOCORE
|
|
struct tlb;
|
|
extern void mips3_TLBWriteIndexedVPS __P((u_int index, struct tlb *tlb));
|
|
#endif /* ! _LOCORE */
|
|
|
|
#endif /* _ARC_CPU_H_ */
|