#ifndef _MIPS_INTR_H_
#define _MIPS_INTR_H_
#ifdef _KERNEL_OPT
#include "opt_multiprocessor.h"
#endif
#define IPL_NONE 0
#define IPL_SOFTCLOCK (IPL_NONE+1)
#define IPL_SOFTBIO (IPL_SOFTCLOCK)
#define IPL_SOFTNET (IPL_SOFTBIO+1)
#define IPL_SOFTSERIAL (IPL_SOFTNET)
#define IPL_VM (IPL_SOFTSERIAL+1)
#define IPL_SCHED (IPL_VM+1)
#define IPL_DDB (IPL_SCHED+1)
#define IPL_HIGH (IPL_DDB+1)
#define IPL_SAFEPRI IPL_SOFTSERIAL
#define _IPL_N (IPL_HIGH+1)
#define _IPL_NAMES(pfx) { pfx"none", pfx"softclock/bio", pfx"softnet/serial", \
pfx"vm", pfx"sched", pfx"ddb", pfx"high" }
#define IST_UNUSABLE -1
#define IST_NONE 0
#define IST_PULSE 1
#define IST_EDGE 2
#define IST_LEVEL 3
#define IST_LEVEL_HIGH 4
#define IST_LEVEL_LOW 5
#define IST_MPSAFE 0x100
#define IPI_NOP 0
#define IPI_AST 1
#define IPI_SHOOTDOWN 2
#define IPI_SYNCICACHE 3
#define IPI_KPREEMPT 4
#define IPI_SUSPEND 5
#define IPI_HALT 6
#define IPI_XCALL 7
#define IPI_GENERIC 8
#define IPI_WDOG 9
#define NIPIS 10
#ifdef __INTR_PRIVATE
struct splsw {
int (*splsw_splhigh)(void);
int (*splsw_splsched)(void);
int (*splsw_splvm)(void);
int (*splsw_splsoftserial)(void);
int (*splsw_splsoftnet)(void);
int (*splsw_splsoftbio)(void);
int (*splsw_splsoftclock)(void);
int (*splsw_splraise)(int);
void (*splsw_spl0)(void);
void (*splsw_splx)(int);
int (*splsw_splhigh_noprof)(void);
void (*splsw_splx_noprof)(int);
void (*splsw__setsoftintr)(uint32_t);
void (*splsw__clrsoftintr)(uint32_t);
int (*splsw_splintr)(uint32_t *);
void (*splsw_splcheck)(void);
};
struct ipl_sr_map {
uint32_t sr_bits[_IPL_N];
};
#else
struct splsw;
#endif
typedef int ipl_t;
typedef struct {
ipl_t _spl;
} ipl_cookie_t;
#ifdef _KERNEL
#if 0
#if defined(MULTIPROCESSOR) && defined(__HAVE_FAST_SOFTINTS)
#define __HAVE_PREEMPTION 1
#define SOFTINT_KPREEMPT (SOFTINT_COUNT+0)
#endif
#endif
#ifdef __INTR_PRIVATE
extern struct splsw mips_splsw;
extern struct ipl_sr_map ipl_sr_map;
#endif
int splhigh(void);
int __noprofile splhigh_noprof(void);
int splsched(void);
int splvm(void);
int splsoftserial(void);
int splsoftnet(void);
int splsoftbio(void);
int splsoftclock(void);
int splraise(int);
void splx(int);
void __noprofile splx_noprof(int);
void spl0(void);
int splintr(uint32_t *);
void _setsoftintr(uint32_t);
void _clrsoftintr(uint32_t);
struct cpu_info;
void ipi_init(struct cpu_info *);
void ipi_process(struct cpu_info *, uint64_t);
static inline ipl_cookie_t
makeiplcookie(ipl_t s)
{
return (ipl_cookie_t){._spl = s};
}
static inline int
splraiseipl(ipl_cookie_t icookie)
{
return splraise(icookie._spl);
}
#endif
#endif