Unify splraiseipl(9) implementation among m68k ports as per
suggestion from isaki@ on port-m68k. For sun68k (sun2, sun3 and sun3x): - export ipl2psl_table[] and make it uint16_t - make makeiplcookie(9) inline - put PSL_S bit into ipl2psl_table[] rather than adding it in makeiplcookie(9)
This commit is contained in:
parent
7ff875bed5
commit
43a0e8e404
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: intr.h,v 1.18 2008/01/26 14:02:54 tsutsui Exp $ */
|
/* $NetBSD: intr.h,v 1.19 2008/06/15 07:23:26 tsutsui Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Matt Fredette.
|
* Copyright (c) 2001 Matt Fredette.
|
||||||
|
@ -47,6 +47,7 @@
|
||||||
#define IPL_VM 5
|
#define IPL_VM 5
|
||||||
#define IPL_SCHED 6
|
#define IPL_SCHED 6
|
||||||
#define IPL_HIGH 7
|
#define IPL_HIGH 7
|
||||||
|
#define NIPL 8
|
||||||
|
|
||||||
#define _IPL_SOFT_LEVEL1 1
|
#define _IPL_SOFT_LEVEL1 1
|
||||||
#define _IPL_SOFT_LEVEL2 2
|
#define _IPL_SOFT_LEVEL2 2
|
||||||
|
@ -57,13 +58,19 @@
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
|
|
||||||
extern int idepth;
|
extern int idepth;
|
||||||
|
extern const uint16_t ipl2psl_table[NIPL];
|
||||||
|
|
||||||
typedef int ipl_t;
|
typedef int ipl_t;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16_t _psl;
|
uint16_t _psl;
|
||||||
} ipl_cookie_t;
|
} ipl_cookie_t;
|
||||||
|
|
||||||
ipl_cookie_t makeiplcookie(ipl_t ipl);
|
static inline ipl_cookie_t
|
||||||
|
makeiplcookie(ipl_t ipl)
|
||||||
|
{
|
||||||
|
|
||||||
|
return (ipl_cookie_t){._psl = ipl2psl_table[ipl]};
|
||||||
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
splraiseipl(ipl_cookie_t icookie)
|
splraiseipl(ipl_cookie_t icookie)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: isr.c,v 1.21 2008/04/28 20:23:39 martin Exp $ */
|
/* $NetBSD: isr.c,v 1.22 2008/06/15 07:23:26 tsutsui Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.21 2008/04/28 20:23:39 martin Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.22 2008/06/15 07:23:26 tsutsui Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
@ -258,20 +258,13 @@ get_vector_entry(int entry)
|
||||||
return (void *)vector_table[entry];
|
return (void *)vector_table[entry];
|
||||||
}
|
}
|
||||||
|
|
||||||
static const int ipl2psl_table[] = {
|
const uint16_t ipl2psl_table[NIPL] = {
|
||||||
[IPL_NONE] = PSL_IPL0,
|
[IPL_NONE] = PSL_S | PSL_IPL0,
|
||||||
[IPL_SOFTBIO] = PSL_IPL1,
|
[IPL_SOFTBIO] = PSL_S | PSL_IPL1,
|
||||||
[IPL_SOFTCLOCK] = PSL_IPL1,
|
[IPL_SOFTCLOCK] = PSL_S | PSL_IPL1,
|
||||||
[IPL_SOFTNET] = PSL_IPL1,
|
[IPL_SOFTNET] = PSL_S | PSL_IPL1,
|
||||||
[IPL_SOFTSERIAL] = PSL_IPL3,
|
[IPL_SOFTSERIAL] = PSL_S | PSL_IPL3,
|
||||||
[IPL_VM] = PSL_IPL4,
|
[IPL_VM] = PSL_S | PSL_IPL4,
|
||||||
[IPL_SCHED] = PSL_IPL6,
|
[IPL_SCHED] = PSL_S | PSL_IPL6,
|
||||||
[IPL_HIGH] = PSL_IPL7,
|
[IPL_HIGH] = PSL_S | PSL_IPL7,
|
||||||
};
|
};
|
||||||
|
|
||||||
ipl_cookie_t
|
|
||||||
makeiplcookie(ipl_t ipl)
|
|
||||||
{
|
|
||||||
|
|
||||||
return (ipl_cookie_t){._psl = ipl2psl_table[ipl] | PSL_S};
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue