Home | History | Annotate | Download | only in include
History log of /src/sys/arch/sparc/include/psl.h
RevisionDateAuthorComments
 1.53  07-Apr-2024  rillig sparc: fix typos and omissions in PSTATE_BITS and ECC_AFR_BITS

Fixes PR 57869.
 1.52  11-Jul-2023  martin fix editor mishap in previous
 1.51  11-Jul-2023  martin Make ipl_cookie_t visible for _KMEMUSER userland applications.
 1.50  02-Nov-2021  ryo branches: 1.50.4;
In order to prevent _mcount() from being recursively called when built with COPTS=-O0,
sprinkle `__always_inline' to make _mcount() be generated as a single function.
 1.49  18-May-2016  nakayama Fix (unused) pstate mask bits in tstate and comment.
 1.48  28-Aug-2011  mrg branches: 1.48.12; 1.48.30;
apply some always_inline attribute to setpsr and spl*. while i am
not yet sure exactly why this is necessary, but does avoid crashes
seen on sparc INSTALL with gcc 4.5.
 1.47  16-Jul-2011  nakayama Bring some fixes and minor differences from sparc64 version.
 1.46  15-Jul-2011  riz BLOCK_SIZE->SPARC64_BLOCK_SIZE
BLOCK_ALIGN->SPARC64_BLOCK_ALIGN

XXX these values are unused in sparc; this is merely to keep the sparc
and sparc64 versions of psl.h in sync, and to allow sparc to build again.
 1.45  16-May-2009  martin Add memory clobbers to the inline assembler modifying/testing the %psr
register, to avoid the compiler reordering instructions out of critical
sections. Should fix PR port-sparc/41372.
 1.44  19-Feb-2007  mrg branches: 1.44.46; 1.44.56; 1.44.62;
remove a redundant variable from spl0().
 1.43  16-Feb-2007  ad branches: 1.43.2;
Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
 1.42  26-Dec-2006  ad Define ipl_t as uint8_t so that it can be packed into a word with a lock
byte. Ok yamt@.
 1.41  21-Dec-2006  yamt merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.40  04-May-2006  yamt branches: 1.40.8; 1.40.10; 1.40.12; 1.40.18;
implement splraiseipl() for sparc.
reviewed by Martin Husemann.

while i'm here, use macros for some MD constants (eg. IPL_ZS)
as suggested by Havard Eidnes.
 1.39  16-Feb-2006  perry branches: 1.39.2; 1.39.4; 1.39.6;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.38  24-Dec-2005  perry branches: 1.38.2; 1.38.4; 1.38.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.37  11-Dec-2005  christos merge ktrace-lwp.
 1.36  19-Jun-2005  thorpej branches: 1.36.2;
Remove some unused definitions.
 1.35  19-Jun-2005  thorpej - Do away with the old _SPLRAISE() template macro. Instead, provide an
splraise() inline function, and define the various spl routines in terms
of splraise().
- Use ANSI function decls.
 1.34  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.33  16-Jun-2003  thorpej branches: 1.33.2;
Rename IPL_IMP -> IPL_VM.
 1.32  14-Jan-2003  pk Define spllowerschedclock().
To be used in the same spirit as spllowersoftclock().
 1.31  31-Dec-2002  pk Define IPL_SCHED at level 11 and make splsched() use it.
 1.30  06-Dec-2002  pk Start using IPL_* constants from intr.h; phase out PIL_* in psl.h
 1.29  08-Jun-2001  uwe branches: 1.29.8; 1.29.12;
Oops, missed in the previous commit: bump PIL_SER to 13 as well.
It seems to be unused...
 1.28  06-Jun-2001  uwe Bump splserial to 13 to support com port on Tadpole and JavaStations.
While I'm here - remove redefinition of PIL_TTY, move splnet
definition to keep the list sorted and sync its comment with reality.
 1.27  23-Apr-2001  pk Bump PIL_NET to 7; some sbus network boards use this interrupt level.
Nuke PIL_IMP.
 1.26  13-Apr-2001  thorpej Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
 1.25  22-Mar-2001  mrg sync with sparc64.
 1.24  14-Jan-2001  thorpej branches: 1.24.2;
Make sure everybody has an splvm() and equate it with splimp() (splimp()
is the historical name for this interrupt level, and the historical name
is going to go away in the near future).
 1.23  22-Aug-2000  thorpej Add spllock(). See spl(9) for details.
 1.22  21-Aug-2000  thorpej Make sure we provide splsched() as described in spl(9).
 1.21  09-Jun-2000  pk spl0() and spllowersoftclock() return void.
 1.20  21-Jan-2000  pk branches: 1.20.2;
Move several PIL_* definitions into the scope of LOCORE stuff.
 1.19  15-Dec-1999  garbled Add new spl level for tadpole devices splts102.
Device entrypoints for tctrl device (tadpole micro controller)
add header for direct-access ioctl to the tadpole microcontroller.
 1.18  05-Aug-1999  thorpej branches: 1.18.2; 1.18.8;
Change spl calls to always raise priority, except for the ones which are
specifically supposed to lower it.
 1.17  05-Aug-1999  thorpej Change the semantics of splsoftclock() to be like other spl*() functions,
that is priority is rasied. Add a new spllowersoftclock() to provide the
atomic drop-to-softclock semantics that the old splsoftclock() provided,
and update calls accordingly.

This fixes a problem with using the "rnd" pseudo-device from within
interrupt context to extract random data (e.g. from within the softnet
interrupt) where doing so would incorrectly unblock interrupts (causing
all sorts of lossage).

XXX 4 platforms do not have priority-raising capability: newsmips, sparc,
XXX sparc64, and VAX. This platforms still have this bug until their
XXX spl*() functions are fixed.
 1.16  26-Nov-1998  pk Add splserial().
 1.15  06-Feb-1998  mrg backout previous change.
 1.14  06-Feb-1998  mrg put PIL_CLOCK and splclock together, like the rest..
 1.13  19-Nov-1997  pk splpmap() is again equivalent to splimp().
 1.12  10-Mar-1997  pk branches: 1.12.8;
Add getmid
 1.11  31-Mar-1996  pk branches: 1.11.8;
Add a non-interrupt-priority-lowering version of SPL(). Used by splpmap()
at the moment.
 1.10  09-Feb-1996  christos A few prototype fixes
 1.9  03-Feb-1996  pk Move splbio to level 5.
 1.8  01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.7  13-Aug-1995  mycroft Replace splnet() with splsoftnet(). Add splnet().
 1.6  28-Mar-1995  jtc KERNEL -> _KERNEL
 1.5  23-Feb-1995  pk floppy levels.
 1.4  20-Nov-1994  deraadt copyright/Id cleanup
 1.3  22-Mar-1994  deraadt splimp >= (splnet or spltty)
 1.2  11-Oct-1993  deraadt stdarg.h, varargs.h, psl.h, autoconf.h: posted patches from torek
cpu.h: cpu_adjstack() won't work well in the NetBSD execve - need a
different model, stub enablertclock() for now..
exec.h: a netbsd-type exec.h file (ie. empty)
param.h: add MID_MACHINE
pmap.h: delete kernel_pmap hack - it doesn't work for us, + two proto's
vmparam.h: VM_MIN_ADDRESS = 0!
 1.1  02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.11.8.1  12-Mar-1997  is Merge in changes from The Trunk
 1.12.8.1  20-Nov-1997  mellon Pull rev 1.13 up from trunk (pk)
 1.18.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.18.2.4  21-Apr-2001  bouyer Sync with HEAD
 1.18.2.3  27-Mar-2001  bouyer Sync with HEAD.
 1.18.2.2  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.18.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.20.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.24.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.24.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.29.12.1  18-Mar-2002  thorpej Add splraiseipl() for use by kern_mutex.c
 1.29.8.4  15-Jan-2003  thorpej Sync with HEAD.
 1.29.8.3  03-Jan-2003  thorpej Sync with HEAD.

XXX ALT_SWITCH_CODE is not yet LWP'ified.
 1.29.8.2  11-Dec-2002  thorpej Sync with HEAD.
 1.29.8.1  08-Jun-2001  thorpej file psl.h was added on branch nathanw_sa on 2002-12-11 06:12:08 +0000
 1.33.2.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.33.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.33.2.1  03-Aug-2004  skrll Sync with HEAD
 1.36.2.3  26-Feb-2007  yamt sync with head.
 1.36.2.2  30-Dec-2006  yamt sync with head.
 1.36.2.1  21-Jun-2006  yamt sync with head.
 1.38.6.2  01-Jun-2006  kardel Sync with head.
 1.38.6.1  22-Apr-2006  simonb Sync with head.
 1.38.4.1  09-Sep-2006  rpaulo sync with head
 1.38.2.1  18-Feb-2006  yamt sync with head.
 1.39.6.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.39.4.1  11-May-2006  elad sync with head
 1.39.2.1  24-May-2006  yamt sync with head.
 1.40.18.1  18-May-2009  bouyer Pull up following revision(s) (requested by martin in ticket #1317):
sys/arch/sparc/include/psl.h: revision 1.45
Add memory clobbers to the inline assembler modifying/testing the %psr
register, to avoid the compiler reordering instructions out of critical
sections. Should fix PR port-sparc/41372.
 1.40.12.1  18-May-2009  bouyer Pull up following revision(s) (requested by martin in ticket #1317):
sys/arch/sparc/include/psl.h: revision 1.45
Add memory clobbers to the inline assembler modifying/testing the %psr
register, to avoid the compiler reordering instructions out of critical
sections. Should fix PR port-sparc/41372.
 1.40.10.1  19-Sep-2006  yamt implement new api for sparc.
 1.40.8.1  12-Jan-2007  ad Sync with head.
 1.43.2.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.44.62.1  18-May-2009  bouyer branches: 1.44.62.1.2;
Pull up following revision(s) (requested by martin in ticket #764):
sys/arch/sparc/include/psl.h: revision 1.45
Add memory clobbers to the inline assembler modifying/testing the %psr
register, to avoid the compiler reordering instructions out of critical
sections. Should fix PR port-sparc/41372.
 1.44.62.1.2.1  21-Apr-2010  matt sync to netbsd-5
 1.44.56.1  18-May-2009  bouyer Pull up following revision(s) (requested by martin in ticket #764):
sys/arch/sparc/include/psl.h: revision 1.45
Add memory clobbers to the inline assembler modifying/testing the %psr
register, to avoid the compiler reordering instructions out of critical
sections. Should fix PR port-sparc/41372.
 1.44.46.1  20-Jun-2009  yamt sync with head
 1.48.30.1  29-May-2016  skrll Sync with HEAD
 1.48.12.1  03-Dec-2017  jdolecek update from HEAD
 1.50.4.1  09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.

RSS XML Feed