Home | History | Annotate | Download | only in include
History log of /src/sys/arch/sparc64/include/intr.h
RevisionDateAuthorComments
 1.32  02-Sep-2023  jdc sparc64: fix interrupt level mapping for disk and and parallel devices
on SBUS-based machines
Change the mapping from PIL_SCSI to PIL_BIO, so that they interrupt above
the highest soft interrupt (softserial)
Remove unused PIL_SCSI, PIL_FDSOFT, PIL_AUSOFT and fix the printf in fdc.c
Add "socal" and "SUNW,bpp" to the interrupt map.
 1.31  27-Jul-2012  matt branches: 1.31.70;
Remove safepri and use IPL_SAFEPRI instead. This may be defined in a MD
header file (if not, a value of 0 is assmued).
 1.30  13-Apr-2011  mrg branches: 1.30.4;
install <machine/intr.h> for crash(8).

(we could avoid this, but it would require a lot of contortions that
make the header files ugly. maybe someone else can figure out a less
ugly way of doing this later.)
 1.29  24-May-2010  martin branches: 1.29.2;
Make C declarations match assembler reality: ipi functions get two arguments
(which most of them (partly) ignore, but anyway).
 1.28  06-Mar-2010  mrg branches: 1.28.2;
clean up a bunch of MULTIPROCESSOR:

- always include ci_ipi_evcnt[] in cpuinfo
- #define sparc_ncpus 1 for !MULTIPROCESSOR
- make struct pmap::pm_list an pm_ctx always be an array, and simplify
several functions and lookups to always be the same

tested on U60 and SB2500 before and after with one and two cpus in an
MP kernel, and UP kernels, and i can't find anything besides noise for
benchmark issues. (infact, i can't really tell the difference between
GENERIC and GENERIC.MP on these systems...)
 1.27  01-Feb-2010  mrg branches: 1.27.2;
- add a PDB_CTX_FLUSHALL debug type to pmap.c, and also log the cpu_number()
in a bunch more cases

- make sparc64_ipi_halt_thiscpu() and sparc64_ipi_pause_thiscpu() return void,
their callers never checked anyway.

- remove prototypes for sparc64_ipi_flush_ctx() and sparc64_ipi_flush_all(),
there are no such functions
 1.26  30-Nov-2009  nakayama sparc64_ipi_flush_ctx and sparc64_ipi_flush_all have been removed,
so remove its event counters as well.
 1.25  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.24  22-Apr-2008  nakayama branches: 1.24.2;
#include "opt_multiprocessor.h"
#include <machine/psl.h>

Make sparc64 kernel build again.
 1.23  14-Apr-2008  nakayama branches: 1.23.2;
Remove sparc64_ipi_sync_tick.

Since we can use counter-timer as timecounter instead of %tick on SMP kernel,
it is not necessary to sync all CPUs %tick registers.
 1.22  14-Mar-2008  nakayama Improve IPI handling:
- make IPI takes two arguments.
- add IPI event counters per-CPU.
- implement IPI functions which were missing or broken.
- insert DELAY while halting primary CPU in IPI handler.
 1.21  02-Mar-2008  martin Make ddb's "mach cpu" command do the right thing: run ddb on the requested
cpu. There is a tiny bit of cheating involved, but I assume we won't run
parallel + recursive ddb scripts to play towers of hanoi.

This fixes the wrong prompt, and (more importantly) makes things like
"mach dtlb" display the registers of the right MMU.
 1.20  15-Jan-2008  martin branches: 1.20.2; 1.20.6;
Rename cpuset_t for now to sparc64_cpuset_t, to avoid a name clash with
<sys/pset.h>. Mid-term we should probably convert to the MI cpuset_t.
 1.19  03-Dec-2007  ad branches: 1.19.6;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.18  17-Oct-2007  garbled branches: 1.18.2;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.17  17-May-2007  yamt branches: 1.17.8; 1.17.10;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.16  06-Oct-2006  jnemeth branches: 1.16.4; 1.16.8; 1.16.10; 1.16.16;
Initial support for floppy drives on sparc64. This has been tested
on an Ultra 2 and works fine, apart from formatting which is known
to be broken. It failed to work on an ebus machine. The ebus
support compiles fine, but I don't have hardware for testing. This
code is based on the sparc driver with hints from OpenBSD on how
to do the sbus and ebus attachments, along with help from martin@
and mrg@.

Initial commit approved by martin@

TODO:
- fix ebus support
- fix XXX issues
- check resource deallocation
- fix formatting
- merge remaining differences from sparc driver
- split out back end chip support
- have sparc driver use new common back end chip support
- adapt to newlock when branch is ready
- adapt to "disk-info" property dictionary
 1.15  18-Sep-2006  martin branches: 1.15.2;
Lazy FPU handling for the MULTIPROCESSOR case
 1.14  13-Sep-2006  mrg SMP cleanup. provide support for multiple CPUs in DDB. (SMP itself
is still not working.)

cpu.h:
- add a pointer for DDB regs in SMP environment to struct cpu_info
- remove the #defines for mp_pause_cpus() and mp_resume_cpus()
cpuset.h:
- remove CPUSET_ALL() and rename CPUSET_ALL_BUT() to CPUSET_EXCEPT()
from petrov.
db_machdep.h:
- rename the members of db_regs_t to be the same as sparc
- change "db_regs_t ddb_regs" to "db_regs_t *ddb_regp" and change
all references to suit
- redo DDB_REGS to no longer be a pointer to a fixed data structure
but to one allocated per-cpu when ddb is entered
- move a bunch of prototypes in here
intr.h:
- remove SPARC64_IPI_* macros, no longer used
db_interface.c:
- change "db_regs_t ddb_regs" to "db_regs_t *ddb_regp" and change
all references to suit
- make "nil" a 64 bit entity
- change the ddb register access methods to work in multiprocessor
environment, it is now very much like sparc does it
- in kdb_trap() avoid accessing ddb_regp when it is NULL
- update several messages to include the cpu number
- unpause other cpus much later when resuming from ddb
- rename db_lock() to db_lock_cmd(), as the sparc-like code has
db_lock as a simple lock
- remove "mach cpus" command, and replace it with "mach cpu" (which
does the same) and also implement "mach cpu N" to switch to
another cpus saved trapframe
db_trace.c:
- update for the ddb_regs -> ddb_regp change
genassym.cf:
- add TF_KSTACK as offsetof(struct trapframe64, tf_kstack)
ipifuncs.c:
- overhaul extensively
- remove all normal interrupt handlers as IPI's, we now handle
them all specially in locore.s:interrupt_vector
- add a simplelock around all ipi functions - it's not safe for
multiple cpus to be sending IPI's to each other right now
- rename sparc64_ipi_pause() to sparc64_ipi_pause_thiscpu() and,
if DDB is configured, enable it to save the passed-in trapframe
to a db_regs_t for this cpu's saved DDB registers.
- remove the "ipimask" system (SPARC64_IPI_* macros) and instead
pass functions directly
- in sparc64_send_ipi() always set the interrupt arguments to 0,
the address and argument of the to be called function. (the
argument right now is the address of ipi_tlb_args variable, and
part of the reason why only one CPU can send IPI's at a time.)
don't wait forever for an IPI to complete. some of this is
from petrov.
- rename sparc64_ipi_{halt,pause,resume}_cpus() to
mp_{halt,pause,resume}_cpus()
- new function mp_cpu_is_paused() used to avoid access missing
saved DDB registers
- actually broadcast the flush in smp_tlb_flush_pte(),
smp_tlb_flush_ctx() and smp_tlb_flush_all(). the other end may
not do anything yet in the pte/ctx cases yet...
kgdb_machdep.c:
- rework for changed member names in db_regs_t.
locore.s:
- shave an instruction from syscall_setup() (set + ld -> sethi + ld)
- remove some old dead debug code
- add new sparc64_ipi_halt IPI entry point, it just calls the C
vector to shutdown.
- add new sparc64_ipi_pause IPI entry point, which just traps into
the debugger using the normal breakpoint trap. these cpus usually
lose the race in db_interface.c:db_suspend_others() and end up
calling the C vector sparc64_ipi_pause_thiscpu().
- add #if 0'ed code to sparc64_ipi_flush_{pte,ctx}() IPI entry
points to call the sp_ version of these functions.
- in rft_kernel (return from trap, kernel), check to see if the
%tpc is at the sparc64_ipi_pause_trap_point and if so, call
"done" not "retry"
- rework cpu_switch slightly: save the passed-in lwp instead of
using the one in curlwp
- in cpu_loadproc(), save the new lwp not the old lwp, to curlwp
- in cpu_initialize(), set %tl to zero as well. from petrov.
- in cpu_exit(), fix a load register confusion. from petrov.
- change some "set" in delay branch to "mov".
machdep.c:
- deal with function renames
pmap.c:
- remove a spurious space
trap.c:
- remove unused "trapstats" variable
- add cpu number to a couple of messages
 1.13  04-May-2006  yamt branches: 1.13.8;
pull splraiseipl() for sparc64 from newlock branch.
reviewed by Martin Husemann.
 1.12  11-Dec-2005  christos branches: 1.12.4; 1.12.6; 1.12.8; 1.12.10; 1.12.12;
merge ktrace-lwp.
 1.11  20-May-2004  petrov branches: 1.11.12;
De-_P()fy, remove not MULTIPROCESSOR defines for sparc64_ipi_xxx.
 1.10  14-Mar-2004  chs checkpoint of MP work from dennis and myself. includes cross-processor
interrupt framework, a sledgehammer TLB invalidation and misc MP fixes.
doesn't work at all yet.
 1.9  16-Jun-2003  thorpej branches: 1.9.2;
Rename IPL_IMP -> IPL_VM.
 1.8  14-Jan-2001  thorpej branches: 1.8.12;
Rename __GENERIC_SOFT_INTERRUPTS to __HAVE_GENERIC_SOFT_INTERRUPTS,
and place the definition in <machine/types.h>. This can now be used
as a flag to indicate whether or not <machine/intr.h> can be included
to get the generic soft interrupt API.
 1.7  03-Dec-2000  fvdl Make softintr_establish prototype match other ports, avoiding compile
warnings.
 1.6  23-Aug-2000  eeh Update the scheduler to the new locking scheme.
 1.5  26-Jun-2000  eeh Advertise we have __GENERIC_SOFT_INTERRUPTS.
 1.4  24-Jun-2000  eeh Make these interrupt levels reflect reality a bit better.
 1.3  02-Jun-2000  eeh branches: 1.3.2;
New softintr interface.
 1.2  16-Mar-2000  eeh branches: 1.2.2;
Revamp interrupts again:

Fix a bug causing interrmittent panics in interrupt dispatch.
Use interrupt vectors for softints.
Add a new send_softint interface.
Improved D$ flushing.
Improve traptrace and other debugging enhancements.
 1.1  30-May-1999  mrg branches: 1.1.2; 1.1.4;
clone intr.h from the SPARC.
 1.1.4.3  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.1.4.2  08-Dec-2000  bouyer Sync with HEAD.
 1.1.4.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.1.2.1  21-Jun-1999  thorpej Sync w/ -current.
 1.2.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.2.1  18-Jul-2000  mrg pullup the contents of -current arch/sparc64. this gives us significant
ultrasparc PCI support (ultra5, ultra10, AXi, and E250 tested so far),
plus many other small fixes. netbooting is now supported.
 1.8.12.1  17-Mar-2002  thorpej IPL_IMP -> IPL_VM
 1.9.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1  03-Aug-2004  skrll Sync with HEAD
 1.11.12.6  17-Mar-2008  yamt sync with head.
 1.11.12.5  21-Jan-2008  yamt sync with head
 1.11.12.4  07-Dec-2007  yamt sync with head
 1.11.12.3  03-Sep-2007  yamt sync with head.
 1.11.12.2  30-Dec-2006  yamt sync with head.
 1.11.12.1  21-Jun-2006  yamt sync with head.
 1.12.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.12.10.1  11-May-2006  elad sync with head
 1.12.8.2  14-Sep-2006  yamt sync with head.
 1.12.8.1  24-May-2006  yamt sync with head.
 1.12.6.1  01-Jun-2006  kardel Sync with head.
 1.12.4.1  09-Sep-2006  rpaulo sync with head
 1.13.8.1  18-Nov-2006  ad Sync with head.
 1.15.2.2  22-Oct-2006  yamt sync with head
 1.15.2.1  18-Sep-2006  yamt file intr.h was added on branch yamt-splraiseipl on 2006-10-22 06:05:11 +0000
 1.16.16.1  22-May-2007  matt Update to HEAD.
 1.16.10.1  11-Jul-2007  mjf Sync with head.
 1.16.8.2  03-Dec-2007  ad Sync with HEAD.
 1.16.8.1  27-May-2007  ad Sync with head.
 1.16.4.1  28-Apr-2007  martin Add missing prototype for MP kernels
 1.17.10.3  23-Mar-2008  matt sync with HEAD
 1.17.10.2  09-Jan-2008  matt sync with HEAD
 1.17.10.1  06-Nov-2007  matt sync with HEAD
 1.17.8.1  09-Dec-2007  jmcneill Sync with HEAD.
 1.18.2.2  18-Feb-2008  mjf Sync with HEAD.
 1.18.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.19.6.1  19-Jan-2008  bouyer Sync with HEAD
 1.20.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.20.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.20.2.1  24-Mar-2008  keiichi sync with head.
 1.23.2.1  18-May-2008  yamt sync with head.
 1.24.2.3  11-Aug-2010  yamt sync with head.
 1.24.2.2  11-Mar-2010  yamt sync with head
 1.24.2.1  16-May-2008  yamt sync with head.
 1.27.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.27.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.28.2.2  21-Apr-2011  rmind sync with head
 1.28.2.1  30-May-2010  rmind sync with head
 1.29.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.30.4.1  30-Oct-2012  yamt sync with head
 1.31.70.1  09-Sep-2023  martin Pull up following revision(s) (requested by jdc in ticket #360):

sys/arch/sparc64/dev/fdc.c: revision 1.52
sys/arch/sparc64/include/intr.h: revision 1.32
sys/arch/sparc64/sparc64/autoconf.c: revision 1.239
sys/arch/sparc64/include/psl.h: revision 1.64

sparc64: fix interrupt level mapping for disk and and parallel devices
on SBUS-based machines

Change the mapping from PIL_SCSI to PIL_BIO, so that they interrupt above
the highest soft interrupt (softserial)

Remove unused PIL_SCSI, PIL_FDSOFT, PIL_AUSOFT and fix the printf in fdc.c

Add "socal" and "SUNW,bpp" to the interrupt map.

RSS XML Feed