Home | History | Annotate | only in /src/sys/arch/alpha/jensenio
History log of /src/sys/arch/alpha/jensenio
RevisionDateAuthorComments
 1.19 07-May-2021  thorpej Liberally sprinkle static around to get more symbols out of the
global namespace. A small bit of const poisoning in the TC code.
 1.18 25-Sep-2020  thorpej branches: 1.18.6;
Changes to make interrupt {,dis}establish MP-safe on Alpha:
- Protect all of the system interrupt linkage with the cpu_lock mutex.
- Re-order some of the stores to the SCB vector table to make it safe
in the face of lockless interrupt dispatch.
- Add a framework for routing interrupts to specific CPUs. Interrupts
are still funneled only to the primary CPU, but that will change for
some systems soon. Ensure that interrupt handler lists are manipulated
only on the CPUs that handle that specific interrupt source. This required
a re-factor of the alpha_shared_intr_*() family of functions.
- Enable __HAVE_INTR_CONTROL, although interrupt redistribution is still
a no-op.
- Reduce code duplication in the Jenson direct-SCB interrupt handlers.
 1.17 22-Sep-2020  thorpej Changes to make MPSAFE interrupts work on Alpha:

- Remove the ipl argument to scb_set() and the associated array of
"mpsafe" booleans initialized based on the ipl. It was bogus
anyway; all IPL_{BIO,NET,TTY}, etc. values are aliases of IPL_VM,
and for all practical purposes, there is really only one device
interrrupt level on Alpha anyway. Intead, we now treat all dispatches
from the SCB vector table as MP-safe, and it is now the handler for
that vector who is responsible for acquiring the KERNEL_LOCK if needed.

- Update the direct interrupt vector handlers in jensenio and TURBOchannel
to acquire the KERNEL_LOCK.

- Introduce a new ALPHA_INTR_MPSAFE flag, and add a flags argument to
alpha_shared_intr_establish(). When it is set, indicate that the
handler is MP-safe. Update alpha_shared_intr_dispatch() to pay
attention and acquire the KERNEL_LOCK (or not) as indicated.

- Re-factor all of the PCI interrupt handling, providing "generic PCI"
"PCI interrupts through ISA IRQs" implementations to significantly
reduce code duplication. Supplement the PCI chipset tag with more
info to facilitate this, and make the PCI interrupt-related routines
take a pci_chipset_tag_t argument rather than a void * argument.

- Because PCI interrupts on KN8AE are dispatched directly from the
SCB, provide a wrapper for non-MPSAFE interrupt handlers that
acquires the KERNEL_LOCK.

- Change the pci_intr_handle_t type to be a struct rather than an
integer type in order to catch any direct use of it as a value.
Add a set of functions to interact with pci_intr_handle_t, including
setting interrupt flags.

- Implement pci_intr_setattr() so that the PCI_INTR_MPSAFE attribute
can be set on a pci_intr_handle_t.

- While I'm here, make all of the MI PCI back-end operations call
through real functions rather than hopping directly through function
pointers in the chipset tag.

This change looks a lot bigger than it really is because of the re-factor
in the plethora of model-specific PCI interrupt back-ends. The KN8AE,
KN300, and T2/T3/T4 (Sable) are largely un-changed.
 1.16 19-Sep-2020  tsutsui Possible fix for hangup on Jensen mentioned in PR/36628.

According to comments in Linux drivers/tty/serial/8250/8250.h,
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/8250/8250.h?h=v5.8#n242
the driver has to set OUT1 and OUT2 lines for "some ALPHA"
otherwise "the machine locks up with endless interrupts."
Note OUT2 (MCR_IENABLE) is set in MI com_attach_subr()
so we have to set OUT1 (MCR_DSR) in the MD attachment.

The information was notified from Miod Vallat.
 1.15 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.14 21-Mar-2014  christos branches: 1.14.28; 1.14.30;
gc sprintf; reduce local static usage of interrupt strings that are only
used once for autoconf printing.
 1.13 01-Jul-2011  dyoung branches: 1.13.2; 1.13.12; 1.13.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.12 14-Jun-2011  matt Major cleanup of alpha device drivers.
Switch to CFATTACH_DECL_NEW.
struct device * -> device_t
struct cfdata * -> cfdata_t
Use of device_xname. No direct access to struct device members.
Use aprint* (not complete).
 1.11 21-Nov-2009  rmind branches: 1.11.10;
- Use lwp_getpcb() on Alpha.
- Replace and clean struct user usage, slightly simplify some code parts.
- Include sys/user.h in MD proc.h .
 1.10 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.9 14-Mar-2008  cube branches: 1.9.2; 1.9.4;
Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.8 29-Feb-2008  dyoung Use pmf_device_register1() instead of shutdownhook_establish() to
register com_cleanup() as the shutdown hook.

Add a generic suspend routine. Suspend and resume com@isa.

Protect against dereferencing a NULL softc in comioctl().

Destroy both a mutex and a callout in com_detach().

Cosmetic: use aprint_*_dev(). Use PMF_FN_ARGS, PMF_FN_PROTO.
 1.7 03-Dec-2007  ad branches: 1.7.10; 1.7.14;
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.6 13-Jul-2006  gdamore branches: 1.6.14; 1.6.32; 1.6.34; 1.6.40;
Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.5 02-Oct-2002  thorpej branches: 1.5.22; 1.5.36; 1.5.40; 1.5.48;
Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.2 27-Jul-2001  thorpej branches: 1.2.2;
Rework the interrupt code, shaving some cycles off in the process.
Rather than an "iointr" routine that decomposes a vector into an
IRQ, we maintain a vector table directly, hooking up each "iointr"
routine at the correct vector. This also allows us to hook device
interrupts up to specific vectors (c.f. Jensen).

We can shave even more cycles off, here, and I will, but it requires
some changes to the alpha_shared_intr stuff.
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.8;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.8.1 03-Aug-2001  lukem update to -current
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file com_jensenio.c was added on branch thorpej_scsipi on 2000-11-20 19:56:57 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file com_jensenio.c was added on branch netbsd-1-5 on 2000-07-12 20:59:11 +0000
 1.2.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.1 27-Jul-2001  nathanw file com_jensenio.c was added on branch nathanw_sa on 2002-10-18 02:34:15 +0000
 1.5.48.4 17-Jun-2006  gdamore Undo the undo. Restore COM_INIT_REGS.
 1.5.48.3 17-Jun-2006  gdamore Undo most of the work I did, but leave in the change to use a common
com_cleanup().
 1.5.48.2 16-Jun-2006  gdamore Convert MD specific cleanups to com_cleanup.
 1.5.48.1 15-Jun-2006  gdamore Alpha com(4) ports.
 1.5.40.1 11-Aug-2006  yamt sync with head
 1.5.36.1 09-Sep-2006  rpaulo sync with head
 1.5.22.3 17-Mar-2008  yamt sync with head.
 1.5.22.2 07-Dec-2007  yamt sync with head
 1.5.22.1 30-Dec-2006  yamt sync with head.
 1.6.40.1 08-Dec-2007  mjf Sync with HEAD.
 1.6.34.2 23-Mar-2008  matt sync with HEAD
 1.6.34.1 09-Jan-2008  matt sync with HEAD
 1.6.32.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.6.14.1 03-Dec-2007  ad Sync with HEAD.
 1.7.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.7.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.7.10.1 24-Mar-2008  keiichi sync with head.
 1.9.4.2 11-Mar-2010  yamt sync with head
 1.9.4.1 16-May-2008  yamt sync with head.
 1.9.2.1 18-May-2008  yamt sync with head.
 1.11.10.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.13.16.1 18-May-2014  rmind sync with head
 1.13.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.30.1 10-Jun-2019  christos Sync with HEAD
 1.14.28.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.18.6.1 13-May-2021  thorpej Sync with HEAD.
 1.25 19-Oct-2025  thorpej Use {,e}isabus_attach().
 1.24 21-Feb-2025  thorpej Fix a paste-o introduced in rev 1.22 that prevented ISA bus instances from
attaching.
 1.23 04-Dec-2023  thorpej branches: 1.23.2;
Convert the Alpha port's bus_space back-end to manage address space
with vmem(9) arenas (using statically-allocated private boundary tags
for very early-in-boot) rather than extent(9).

As a side-effect, there's arguments to some initialization functions
that are no longer required, so garbage-collect those, update all the
call sites.
 1.22 07-Aug-2021  thorpej branches: 1.22.6;
Merge thorpej-cfargs2.
 1.21 07-May-2021  thorpej branches: 1.21.6;
Liberally sprinkle static around to get more symbols out of the
global namespace. A small bit of const poisoning in the TC code.
 1.20 24-Apr-2021  thorpej branches: 1.20.2;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.19 19-Aug-2009  dyoung branches: 1.19.78;
isa_detach_hook() needs two arguments, the first an isa_chipset_tag_t.
 1.18 19-Aug-2009  dyoung Define isa_dmadestroy and isa_detach_hook. Hook up a couple of
isa_detach_hook implementations.
 1.17 09-Jul-2008  joerg - Statify
- Split device/softc.
 1.16 28-Apr-2008  martin branches: 1.16.2; 1.16.4; 1.16.6;
Remove clause 3 and 4 from TNF licenses
 1.15 17-Oct-2007  garbled branches: 1.15.16; 1.15.18; 1.15.20;
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.14 22-Jul-2007  tsutsui branches: 1.14.6;
More fixes for Jensen, reported and tested by Christoph Franzen
in PR port-alpha/36628:
- make jensenio_eisa_maxslots() return 8 (instead of 16) since
EISA config for slot 8-15 on jensen could return invalid values
- pass eisa_chipset_tag_t to eisa_init() and check eisa_maxslots()
on probing EISA config space
- pass M_ZERO to malloc(9) and make sure malloc(9) doesn't fail
- fix typo in a debug printf, add more debug printfs, and
use #ifdef EISA_DEBUG to enable them
- cast uint8_t value to uint32_t before shift more than 8 bits
- check buffer region on reading compressed data from EISA config space
 1.13 11-Dec-2005  christos branches: 1.13.24; 1.13.30; 1.13.38; 1.13.40; 1.13.42; 1.13.44;
merge ktrace-lwp.
 1.12 26-Aug-2005  drochner kill some more simple submatch() functions, use config_stdsubmatch()
 1.11 25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.10 14-Sep-2004  drochner branches: 1.10.12;
include "locators.h" explicitely (don't rely on isavar.h doing so)
 1.9 30-Aug-2004  drochner Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
 1.8 01-Jan-2003  thorpej branches: 1.8.2;
Use aprint_normal() for cfprint routines.
 1.7 02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.4 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.3 27-Jul-2001  thorpej branches: 1.3.2;
Rework the interrupt code, shaving some cycles off in the process.
Rather than an "iointr" routine that decomposes a vector into an
IRQ, we maintain a vector table directly, hooking up each "iointr"
routine at the correct vector. This also allows us to hook device
interrupts up to specific vectors (c.f. Jensen).

We can shave even more cycles off, here, and I will, but it requires
some changes to the alpha_shared_intr stuff.
 1.2 14-Aug-2000  thorpej branches: 1.2.2; 1.2.6;
Add support for EISA configuration space on the Jensen (it's
mapped differently than on other EISA sysetms).
 1.1 12-Jul-2000  thorpej branches: 1.1.2;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.3 14-Aug-2000  thorpej Pullup rev. 1.2:
Add support for EISA configuration space on the Jensen (it's
mapped differently than on other EISA sysetms).
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file jensenio.c was added on branch netbsd-1-5 on 2000-07-12 20:59:11 +0000
 1.2.6.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.6.1 03-Aug-2001  lukem update to -current
 1.2.2.2 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.2.2.1 14-Aug-2000  bouyer file jensenio.c was added on branch thorpej_scsipi on 2000-11-20 19:57:00 +0000
 1.3.2.3 03-Jan-2003  thorpej Sync with HEAD.
 1.3.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.3.2.1 27-Jul-2001  nathanw file jensenio.c was added on branch nathanw_sa on 2002-10-18 02:34:15 +0000
 1.8.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.8.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1 03-Sep-2004  skrll Sync with HEAD
 1.10.12.2 03-Sep-2007  yamt sync with head.
 1.10.12.1 21-Jun-2006  yamt sync with head.
 1.13.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.13.42.1 07-Aug-2007  matt Sync with HEAD.
 1.13.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.13.38.1 03-Oct-2007  garbled Sync with HEAD
 1.13.30.1 20-Aug-2007  ad Sync with HEAD.
 1.13.24.1 21-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #815):
sys/arch/alpha/pci/sio.c: revision 1.41
sys/arch/alpha/eisa/eisa_machdep.c: revision 1.6
sys/arch/alpha/jensenio/jensenio.c: revision 1.14
sys/arch/alpha/jensenio/jensenio_intr.c: revision 1.6
sys/arch/alpha/include/eisa_machdep.h: revision 1.8
sys/arch/alpha/alpha/dec_2000_300.c: revision 1.14
sys/arch/alpha/jensenio/lpt_jensenio.c: revision 1.6
Avoid NULL pointer dereference in MD device_register() function.
Fixes a part of PR port-alpha/36628.
Backout changes on lpt_jensenio.c rev 1.2.
lpt at jensenio doesn't seem to have a specific interrupt vector
but uses a normal EISA interrupt.
Fixes another part of PR port-alpha/36628 and PR port-alpha/20386.
More fixes for Jensen, reported and tested by Christoph Franzen
in PR port-alpha/36628:
- make jensenio_eisa_maxslots() return 8 (instead of 16) since
EISA config for slot 8-15 on jensen could return invalid values
- pass eisa_chipset_tag_t to eisa_init() and check eisa_maxslots()
on probing EISA config space
- pass M_ZERO to malloc(9) and make sure malloc(9) doesn't fail
- fix typo in a debug printf, add more debug printfs, and
use #ifdef EISA_DEBUG to enable them
- cast uint8_t value to uint32_t before shift more than 8 bits
- check buffer region on reading compressed data from EISA config space
Check a correct value on a sanity check in jensenio_eisa_intr_map().
Fixes yet another bug on Jensen found on tracking PR port-alpha/36628.
 1.14.6.1 06-Nov-2007  matt sync with HEAD
 1.15.20.3 19-Aug-2009  yamt sync with head.
 1.15.20.2 04-May-2009  yamt sync with head.
 1.15.20.1 16-May-2008  yamt sync with head.
 1.15.18.1 18-May-2008  yamt sync with head.
 1.15.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.15.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.6.1 19-Oct-2008  haad Sync with HEAD.
 1.16.4.1 18-Jul-2008  simonb Sync with head.
 1.16.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.19.78.2 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.19.78.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.20.2.1 13-May-2021  thorpej Sync with HEAD.
 1.21.6.1 03-Aug-2021  thorpej Adapt to CFARGS().
 1.22.6.1 22-Feb-2025  martin Pull up following revision(s) (requested by thorpej in ticket #1065):

sys/arch/alpha/jensenio/jensenio.c: revision 1.24

Fix a paste-o introduced in rev 1.22 that prevented ISA bus instances from attaching.
 1.23.2.1 02-Aug-2025  perseant Sync with HEAD
 1.7 04-Dec-2023  thorpej Convert the Alpha port's bus_space back-end to manage address space
with vmem(9) arenas (using statically-allocated private boundary tags
for very early-in-boot) rather than extent(9).

As a side-effect, there's arguments to some initialization functions
that are no longer required, so garbage-collect those, update all the
call sites.
 1.6 04-Jul-2021  thorpej Remove unnecessary #include <sys/malloc.h>
 1.5 06-Feb-2012  matt branches: 1.5.64;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c
 1.4 25-Sep-2011  chs branches: 1.4.2; 1.4.6;
change inline to static inline to appease gcc 4.5.
 1.3 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.130; 1.1.132; 1.1.134;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.134.1 16-May-2008  yamt sync with head.
 1.1.132.1 18-May-2008  yamt sync with head.
 1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file jensenio_bus_intio.c was added on branch thorpej_scsipi on 2000-11-20 19:57:00 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file jensenio_bus_intio.c was added on branch netbsd-1-5 on 2000-07-12 20:59:11 +0000
 1.4.6.1 18-Feb-2012  mrg merge to -current.
 1.4.2.1 17-Apr-2012  yamt sync with head
 1.5.64.1 01-Aug-2021  thorpej Sync with HEAD.
 1.5 04-Dec-2023  thorpej Convert the Alpha port's bus_space back-end to manage address space
with vmem(9) arenas (using statically-allocated private boundary tags
for very early-in-boot) rather than extent(9).

As a side-effect, there's arguments to some initialization functions
that are no longer required, so garbage-collect those, update all the
call sites.
 1.4 04-Jul-2021  thorpej Remove unnecessary #include <sys/malloc.h>
 1.3 01-Jul-2011  dyoung branches: 1.3.70;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.130; 1.1.132; 1.1.134;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.134.1 16-May-2008  yamt sync with head.
 1.1.132.1 18-May-2008  yamt sync with head.
 1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file jensenio_bus_io.c was added on branch thorpej_scsipi on 2000-11-20 19:57:01 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file jensenio_bus_io.c was added on branch netbsd-1-5 on 2000-07-12 20:59:12 +0000
 1.3.70.1 01-Aug-2021  thorpej Sync with HEAD.
 1.5 04-Dec-2023  thorpej Convert the Alpha port's bus_space back-end to manage address space
with vmem(9) arenas (using statically-allocated private boundary tags
for very early-in-boot) rather than extent(9).

As a side-effect, there's arguments to some initialization functions
that are no longer required, so garbage-collect those, update all the
call sites.
 1.4 04-Jul-2021  thorpej Remove unnecessary #include <sys/malloc.h>
 1.3 01-Jul-2011  dyoung branches: 1.3.70;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.130; 1.1.132; 1.1.134;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.134.1 16-May-2008  yamt sync with head.
 1.1.132.1 18-May-2008  yamt sync with head.
 1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file jensenio_bus_mem.c was added on branch thorpej_scsipi on 2000-11-20 19:57:01 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file jensenio_bus_mem.c was added on branch netbsd-1-5 on 2000-07-12 20:59:12 +0000
 1.3.70.1 01-Aug-2021  thorpej Sync with HEAD.
 1.10 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.9 04-Jul-2021  thorpej Remove unnecessary #include <sys/malloc.h>
 1.8 07-May-2021  thorpej Liberally sprinkle static around to get more symbols out of the
global namespace. A small bit of const poisoning in the TC code.
 1.7 14-Oct-2020  thorpej branches: 1.7.6;
Add a mechanism to allow a platform to optionally shelter some region
of physical memory from random allocations from the default VM page
free list. Use this hook to shelter regions within 0-16MB of physical
RAM on Jensen and Irongate systems; those platforms do not have SGMAP
DMA, and so we need to shelter this range so that devices using ISA DMA
(e.g. floppy controller) have an opportunity to allocate DMA-safe memory.

PR port-alpha/27087
 1.6 10-Oct-2020  thorpej G/C alpha_XXX_dmamap() / alpha_XXX_dmamap_or. They haven't been needed
for a long time.
 1.5 06-Feb-2012  matt Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c
 1.4 01-Jul-2011  dyoung branches: 1.4.2; 1.4.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 02-Feb-2010  skrll Typo in comment.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.130; 1.1.132; 1.1.134;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.134.2 11-Mar-2010  yamt sync with head
 1.1.134.1 16-May-2008  yamt sync with head.
 1.1.132.1 18-May-2008  yamt sync with head.
 1.1.130.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file jensenio_dma.c was added on branch thorpej_scsipi on 2000-11-20 19:57:01 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file jensenio_dma.c was added on branch netbsd-1-5 on 2000-07-12 20:59:12 +0000
 1.4.6.1 18-Feb-2012  mrg merge to -current.
 1.4.2.1 17-Apr-2012  yamt sync with head
 1.7.6.2 01-Aug-2021  thorpej Sync with HEAD.
 1.7.6.1 13-May-2021  thorpej Sync with HEAD.
 1.18 15-Jul-2021  thorpej - Use defined constants for PIC registers, not magic numbers (XXX except
for the ELCR register; need a new header file).
- In jensenio_specific_eoi(), actually issue a specific EOI (the code
was erroneously issuing a non-specific EOI).
- In jensenio_pic_init(), ensure all IRQs are initialized to EDGE trigger.
 1.17 04-Jul-2021  thorpej Remove unnecessary #include <sys/malloc.h>
 1.16 04-Jul-2021  thorpej Reduce code duplication when setting up the interrupt handler data
structures:
- alpha_shared_intr_alloc() no longer takes a "string length" argument,
and just uses kmem_asprintf() to create an "irq %u" string by default.
This is suitable for nearly every caller.
- Add a alpha_shared_intr_set_string() that allows callers to override
the default IRQ description string.
- Related: make alpha_shared_intr_string() return a const char *, since
no callers should need to modify the string directly now.
- Re-factor PCI shared interrupt structure allocation / initialization
into a new alpha_pci_intr_alloc(), which is suitable for nearly every
Alpha PCI platform. Callers are expected to first have initialized
the interrupt hardware to the quiescent state.

Adjust various call sites of above functions to account for changes,
even if they are not able to use the newly re-factored code.
 1.15 25-Jun-2021  thorpej Tweak how the IRQ description strings are generated to enable additional
duplicated code re-factoring.
 1.14 07-May-2021  thorpej Liberally sprinkle static around to get more symbols out of the
global namespace. A small bit of const poisoning in the TC code.
 1.13 25-Sep-2020  thorpej branches: 1.13.6;
Changes to make interrupt {,dis}establish MP-safe on Alpha:
- Protect all of the system interrupt linkage with the cpu_lock mutex.
- Re-order some of the stores to the SCB vector table to make it safe
in the face of lockless interrupt dispatch.
- Add a framework for routing interrupts to specific CPUs. Interrupts
are still funneled only to the primary CPU, but that will change for
some systems soon. Ensure that interrupt handler lists are manipulated
only on the CPUs that handle that specific interrupt source. This required
a re-factor of the alpha_shared_intr_*() family of functions.
- Enable __HAVE_INTR_CONTROL, although interrupt redistribution is still
a no-op.
- Reduce code duplication in the Jenson direct-SCB interrupt handlers.
 1.12 22-Sep-2020  thorpej Changes to make MPSAFE interrupts work on Alpha:

- Remove the ipl argument to scb_set() and the associated array of
"mpsafe" booleans initialized based on the ipl. It was bogus
anyway; all IPL_{BIO,NET,TTY}, etc. values are aliases of IPL_VM,
and for all practical purposes, there is really only one device
interrrupt level on Alpha anyway. Intead, we now treat all dispatches
from the SCB vector table as MP-safe, and it is now the handler for
that vector who is responsible for acquiring the KERNEL_LOCK if needed.

- Update the direct interrupt vector handlers in jensenio and TURBOchannel
to acquire the KERNEL_LOCK.

- Introduce a new ALPHA_INTR_MPSAFE flag, and add a flags argument to
alpha_shared_intr_establish(). When it is set, indicate that the
handler is MP-safe. Update alpha_shared_intr_dispatch() to pay
attention and acquire the KERNEL_LOCK (or not) as indicated.

- Re-factor all of the PCI interrupt handling, providing "generic PCI"
"PCI interrupts through ISA IRQs" implementations to significantly
reduce code duplication. Supplement the PCI chipset tag with more
info to facilitate this, and make the PCI interrupt-related routines
take a pci_chipset_tag_t argument rather than a void * argument.

- Because PCI interrupts on KN8AE are dispatched directly from the
SCB, provide a wrapper for non-MPSAFE interrupt handlers that
acquires the KERNEL_LOCK.

- Change the pci_intr_handle_t type to be a struct rather than an
integer type in order to catch any direct use of it as a value.
Add a set of functions to interact with pci_intr_handle_t, including
setting interrupt flags.

- Implement pci_intr_setattr() so that the PCI_INTR_MPSAFE attribute
can be set on a pci_intr_handle_t.

- While I'm here, make all of the MI PCI back-end operations call
through real functions rather than hopping directly through function
pointers in the chipset tag.

This change looks a lot bigger than it really is because of the re-factor
in the plethora of model-specific PCI interrupt back-ends. The KN8AE,
KN300, and T2/T3/T4 (Sable) are largely un-changed.
 1.11 21-Mar-2014  christos gc sprintf; reduce local static usage of interrupt strings that are only
used once for autoconf printing.
 1.10 06-Feb-2012  matt branches: 1.10.6; 1.10.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c
 1.9 28-Apr-2008  martin branches: 1.9.34; 1.9.38;
Remove clause 3 and 4 from TNF licenses
 1.8 03-Dec-2007  ad branches: 1.8.14; 1.8.16; 1.8.18;
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.7 17-Oct-2007  garbled branches: 1.7.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.6 27-Jul-2007  tsutsui branches: 1.6.4; 1.6.6;
Check a correct value on a sanity check in jensenio_eisa_intr_map().

Fixes yet another bug on Jensen found on tracking PR port-alpha/36628.
 1.5 24-Dec-2005  perry branches: 1.5.24; 1.5.30; 1.5.38; 1.5.40; 1.5.42; 1.5.44;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.4 27-Sep-2002  provos branches: 1.4.22;
remove trailing \n in panic(). approved perry.
 1.3 27-Jul-2001  thorpej branches: 1.3.2;
Rework the interrupt code, shaving some cycles off in the process.
Rather than an "iointr" routine that decomposes a vector into an
IRQ, we maintain a vector table directly, hooking up each "iointr"
routine at the correct vector. This also allows us to hook device
interrupts up to specific vectors (c.f. Jensen).

We can shave even more cycles off, here, and I will, but it requires
some changes to the alpha_shared_intr stuff.
 1.2 14-Aug-2000  thorpej branches: 1.2.2; 1.2.6;
Clean this up a little bit, and issue a Specific EOI after
dispatching an EISA interrupt.
 1.1 12-Jul-2000  thorpej branches: 1.1.2;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.3 14-Aug-2000  thorpej Pull up rev. 1.2:
Clean this up a little bit, and issue a Specific EOI after
dispatching an EISA interrupt.
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file jensenio_intr.c was added on branch netbsd-1-5 on 2000-07-12 20:59:13 +0000
 1.2.6.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.2.6.1 03-Aug-2001  lukem update to -current
 1.2.2.2 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.2.2.1 14-Aug-2000  bouyer file jensenio_intr.c was added on branch thorpej_scsipi on 2000-11-20 19:57:02 +0000
 1.3.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.3.2.1 27-Jul-2001  nathanw file jensenio_intr.c was added on branch nathanw_sa on 2002-10-18 02:34:15 +0000
 1.4.22.3 07-Dec-2007  yamt sync with head
 1.4.22.2 03-Sep-2007  yamt sync with head.
 1.4.22.1 21-Jun-2006  yamt sync with head.
 1.5.44.1 15-Aug-2007  skrll Sync with HEAD.
 1.5.42.1 07-Aug-2007  matt Sync with HEAD.
 1.5.40.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.5.38.1 03-Oct-2007  garbled Sync with HEAD
 1.5.30.2 03-Dec-2007  ad Sync with HEAD.
 1.5.30.1 20-Aug-2007  ad Sync with HEAD.
 1.5.24.1 21-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #815):
sys/arch/alpha/pci/sio.c: revision 1.41
sys/arch/alpha/eisa/eisa_machdep.c: revision 1.6
sys/arch/alpha/jensenio/jensenio.c: revision 1.14
sys/arch/alpha/jensenio/jensenio_intr.c: revision 1.6
sys/arch/alpha/include/eisa_machdep.h: revision 1.8
sys/arch/alpha/alpha/dec_2000_300.c: revision 1.14
sys/arch/alpha/jensenio/lpt_jensenio.c: revision 1.6
Avoid NULL pointer dereference in MD device_register() function.
Fixes a part of PR port-alpha/36628.
Backout changes on lpt_jensenio.c rev 1.2.
lpt at jensenio doesn't seem to have a specific interrupt vector
but uses a normal EISA interrupt.
Fixes another part of PR port-alpha/36628 and PR port-alpha/20386.
More fixes for Jensen, reported and tested by Christoph Franzen
in PR port-alpha/36628:
- make jensenio_eisa_maxslots() return 8 (instead of 16) since
EISA config for slot 8-15 on jensen could return invalid values
- pass eisa_chipset_tag_t to eisa_init() and check eisa_maxslots()
on probing EISA config space
- pass M_ZERO to malloc(9) and make sure malloc(9) doesn't fail
- fix typo in a debug printf, add more debug printfs, and
use #ifdef EISA_DEBUG to enable them
- cast uint8_t value to uint32_t before shift more than 8 bits
- check buffer region on reading compressed data from EISA config space
Check a correct value on a sanity check in jensenio_eisa_intr_map().
Fixes yet another bug on Jensen found on tracking PR port-alpha/36628.
 1.6.6.2 09-Jan-2008  matt sync with HEAD
 1.6.6.1 06-Nov-2007  matt sync with HEAD
 1.6.4.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.7.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.8.18.1 16-May-2008  yamt sync with head.
 1.8.16.1 18-May-2008  yamt sync with head.
 1.8.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.9.38.1 18-Feb-2012  mrg merge to -current.
 1.9.34.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9.34.1 17-Apr-2012  yamt sync with head
 1.10.10.1 18-May-2014  rmind sync with head
 1.10.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.6.2 01-Aug-2021  thorpej Sync with HEAD.
 1.13.6.1 13-May-2021  thorpej Sync with HEAD.
 1.4 06-Feb-2012  matt Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c
 1.3 28-Apr-2008  martin branches: 1.3.34; 1.3.38;
Remove clause 3 and 4 from TNF licenses
 1.2 24-Dec-2005  perry branches: 1.2.74; 1.2.76; 1.2.78;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.44;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.44.1 21-Jun-2006  yamt sync with head.
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file jensenioreg.h was added on branch thorpej_scsipi on 2000-11-20 19:57:02 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file jensenioreg.h was added on branch netbsd-1-5 on 2000-07-12 20:59:13 +0000
 1.2.78.1 16-May-2008  yamt sync with head.
 1.2.76.1 18-May-2008  yamt sync with head.
 1.2.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.38.1 18-Feb-2012  mrg merge to -current.
 1.3.34.1 17-Apr-2012  yamt sync with head
 1.7 04-Dec-2023  thorpej Convert the Alpha port's bus_space back-end to manage address space
with vmem(9) arenas (using statically-allocated private boundary tags
for very early-in-boot) rather than extent(9).

As a side-effect, there's arguments to some initialization functions
that are no longer required, so garbage-collect those, update all the
call sites.
 1.6 14-Oct-2020  thorpej Add a mechanism to allow a platform to optionally shelter some region
of physical memory from random allocations from the default VM page
free list. Use this hook to shelter regions within 0-16MB of physical
RAM on Jensen and Irongate systems; those platforms do not have SGMAP
DMA, and so we need to shelter this range so that devices using ISA DMA
(e.g. floppy controller) have an opportunity to allocate DMA-safe memory.

PR port-alpha/27087
 1.5 25-Sep-2020  thorpej Changes to make interrupt {,dis}establish MP-safe on Alpha:
- Protect all of the system interrupt linkage with the cpu_lock mutex.
- Re-order some of the stores to the SCB vector table to make it safe
in the face of lockless interrupt dispatch.
- Add a framework for routing interrupts to specific CPUs. Interrupts
are still funneled only to the primary CPU, but that will change for
some systems soon. Ensure that interrupt handler lists are manipulated
only on the CPUs that handle that specific interrupt source. This required
a re-factor of the alpha_shared_intr_*() family of functions.
- Enable __HAVE_INTR_CONTROL, although interrupt redistribution is still
a no-op.
- Reduce code duplication in the Jenson direct-SCB interrupt handlers.
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.74; 1.3.76; 1.3.78;
merge ktrace-lwp.
 1.2 30-Aug-2004  drochner Phase out the use of a string as first "attach args" member to control
which bustype should be attached with a specific call to config_found()
(from a "mainbus" or a bus bridge).
Do it for isa/eisa/mca and pci/agp for now. These buses all attach to
an mi interface attribute "isabus", "eisabus" etc., and the autoconf
framework now allows to specify an interface attribute on config_found()
and config_search(), which limits the search of matching config data
to these which attach to that specific attribute.
So we basically have to call config_found_ia(..., "foobus", ...) where
such a bus is attached.
As a consequence, where a "mainbus" or alike also attaches other
devices (eg CPUs) which do not attach to a specific attribute yet,
we need at least pass an attribute name (different from "foobus") so
that the foo bus is not found at these places. This made some minor
changes necessary which are not obviously related to the mentioned buses.
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.28;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.28.1 03-Sep-2004  skrll Sync with HEAD
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file jenseniovar.h was added on branch thorpej_scsipi on 2000-11-20 19:57:02 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file jenseniovar.h was added on branch netbsd-1-5 on 2000-07-12 20:59:14 +0000
 1.3.78.1 16-May-2008  yamt sync with head.
 1.3.76.1 18-May-2008  yamt sync with head.
 1.3.74.1 02-Jun-2008  mjf Sync with HEAD.
 1.14 07-May-2021  thorpej Liberally sprinkle static around to get more symbols out of the
global namespace. A small bit of const poisoning in the TC code.
 1.13 29-Mar-2014  christos branches: 1.13.46;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.12 21-Mar-2014  christos gc sprintf; reduce local static usage of interrupt strings that are only
used once for autoconf printing.
 1.11 01-Jul-2011  dyoung branches: 1.11.2; 1.11.12; 1.11.16;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.10 21-Nov-2009  rmind - Use lwp_getpcb() on Alpha.
- Replace and clean struct user usage, slightly simplify some code parts.
- Include sys/user.h in MD proc.h .
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 07-Mar-2008  cube branches: 1.8.2; 1.8.4;
Split the softc from the device_t for all lpt(4) variants and attachments
except the ppbus stuff (which doesn't compile) and ulpt(4) which is
unrelated and can be dealt with separately.

As usual, it comes with related cosmetic changes.
 1.7 17-Oct-2007  garbled branches: 1.7.12; 1.7.16;
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.6 19-Jul-2007  tsutsui branches: 1.6.6;
Backout changes on lpt_jensenio.c rev 1.2.
lpt at jensenio doesn't seem to have a specific interrupt vector
but uses a normal EISA interrupt.

Fixes another part of PR port-alpha/36628 and PR port-alpha/20386.
 1.5 02-Oct-2002  thorpej branches: 1.5.22; 1.5.58; 1.5.64; 1.5.72; 1.5.74; 1.5.76; 1.5.78;
Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.2 27-Jul-2001  thorpej branches: 1.2.2;
Rework the interrupt code, shaving some cycles off in the process.
Rather than an "iointr" routine that decomposes a vector into an
IRQ, we maintain a vector table directly, hooking up each "iointr"
routine at the correct vector. This also allows us to hook device
interrupts up to specific vectors (c.f. Jensen).

We can shave even more cycles off, here, and I will, but it requires
some changes to the alpha_shared_intr stuff.
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.8;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.8.1 03-Aug-2001  lukem update to -current
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file lpt_jensenio.c was added on branch thorpej_scsipi on 2000-11-20 19:57:03 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file lpt_jensenio.c was added on branch netbsd-1-5 on 2000-07-12 20:59:14 +0000
 1.2.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.1 27-Jul-2001  nathanw file lpt_jensenio.c was added on branch nathanw_sa on 2002-10-18 02:34:16 +0000
 1.5.78.1 15-Aug-2007  skrll Sync with HEAD.
 1.5.76.1 07-Aug-2007  matt Sync with HEAD.
 1.5.74.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.5.72.1 03-Oct-2007  garbled Sync with HEAD
 1.5.64.1 20-Aug-2007  ad Sync with HEAD.
 1.5.58.1 21-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #815):
sys/arch/alpha/pci/sio.c: revision 1.41
sys/arch/alpha/eisa/eisa_machdep.c: revision 1.6
sys/arch/alpha/jensenio/jensenio.c: revision 1.14
sys/arch/alpha/jensenio/jensenio_intr.c: revision 1.6
sys/arch/alpha/include/eisa_machdep.h: revision 1.8
sys/arch/alpha/alpha/dec_2000_300.c: revision 1.14
sys/arch/alpha/jensenio/lpt_jensenio.c: revision 1.6
Avoid NULL pointer dereference in MD device_register() function.
Fixes a part of PR port-alpha/36628.
Backout changes on lpt_jensenio.c rev 1.2.
lpt at jensenio doesn't seem to have a specific interrupt vector
but uses a normal EISA interrupt.
Fixes another part of PR port-alpha/36628 and PR port-alpha/20386.
More fixes for Jensen, reported and tested by Christoph Franzen
in PR port-alpha/36628:
- make jensenio_eisa_maxslots() return 8 (instead of 16) since
EISA config for slot 8-15 on jensen could return invalid values
- pass eisa_chipset_tag_t to eisa_init() and check eisa_maxslots()
on probing EISA config space
- pass M_ZERO to malloc(9) and make sure malloc(9) doesn't fail
- fix typo in a debug printf, add more debug printfs, and
use #ifdef EISA_DEBUG to enable them
- cast uint8_t value to uint32_t before shift more than 8 bits
- check buffer region on reading compressed data from EISA config space
Check a correct value on a sanity check in jensenio_eisa_intr_map().
Fixes yet another bug on Jensen found on tracking PR port-alpha/36628.
 1.5.22.2 17-Mar-2008  yamt sync with head.
 1.5.22.1 03-Sep-2007  yamt sync with head.
 1.6.6.2 23-Mar-2008  matt sync with HEAD
 1.6.6.1 06-Nov-2007  matt sync with HEAD
 1.7.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.7.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.7.12.1 24-Mar-2008  keiichi sync with head.
 1.8.4.2 11-Mar-2010  yamt sync with head
 1.8.4.1 16-May-2008  yamt sync with head.
 1.8.2.1 18-May-2008  yamt sync with head.
 1.11.16.1 18-May-2014  rmind sync with head
 1.11.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.46.1 13-May-2021  thorpej Sync with HEAD.
 1.12 06-Mar-2024  thorpej Wrap the mcclock driver's mc146818_softc inside a new mcclock_softc.
This commit represents no functional change, but forms the basis for
a future functional change.
 1.11 07-May-2021  thorpej Liberally sprinkle static around to get more symbols out of the
global namespace. A small bit of const poisoning in the TC code.
 1.10 01-Jul-2011  dyoung branches: 1.10.70;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.9 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8 29-Mar-2008  tsutsui branches: 1.8.2; 1.8.4;
Don't forget to initialize sc_dev.
 1.7 28-Mar-2008  tsutsui Split device_t and softc for MI mc146818 clock,
and other related misc cosmetics.
 1.6 17-Oct-2007  garbled branches: 1.6.16;
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.5 21-Jul-2007  tsutsui branches: 1.5.6;
Add MI todr(9) support and timercounter(9) support with kern_cctr.c to alpha:
- use todr(9) API with MI mc146818(4) driver and remove homegrown
todr stuff from MD alpha/clock.c and alpha/mcclock.c
- also remove obsolete cc_microtime stuff from MD code
- add ci_pcc_freq member in struct cpu_info for cpu_frequency(), and
calibrate it with mc146818 interval clock in mcclock attachment
- call cc_init() in cpu_initclocks(9) because all alpha cpus have
a pcc counter

Tested on DEC 3000/300 and AlphaPC 164, but not on any SMP machines yet.
 1.4 02-Oct-2002  thorpej branches: 1.4.22; 1.4.64; 1.4.72; 1.4.76; 1.4.78;
Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.8.1 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.6.1 18-Oct-2002  nathanw Catch up to -current.
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file mcclock_jensenio.c was added on branch thorpej_scsipi on 2000-11-20 19:57:03 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file mcclock_jensenio.c was added on branch netbsd-1-5 on 2000-07-12 20:59:15 +0000
 1.4.78.1 15-Aug-2007  skrll Sync with HEAD.
 1.4.76.1 07-Aug-2007  matt Sync with HEAD.
 1.4.72.1 03-Oct-2007  garbled Sync with HEAD
 1.4.64.1 20-Aug-2007  ad Sync with HEAD.
 1.4.22.1 03-Sep-2007  yamt sync with head.
 1.5.6.1 06-Nov-2007  matt sync with HEAD
 1.6.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.6.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.4.1 16-May-2008  yamt sync with head.
 1.8.2.1 18-May-2008  yamt sync with head.
 1.10.70.1 13-May-2021  thorpej Sync with HEAD.
 1.16 07-May-2021  thorpej Liberally sprinkle static around to get more symbols out of the
global namespace. A small bit of const poisoning in the TC code.
 1.15 18-Nov-2020  thorpej branches: 1.15.4;
malloc(9) -> kmem(9)
 1.14 25-Sep-2020  thorpej branches: 1.14.2;
Changes to make interrupt {,dis}establish MP-safe on Alpha:
- Protect all of the system interrupt linkage with the cpu_lock mutex.
- Re-order some of the stores to the SCB vector table to make it safe
in the face of lockless interrupt dispatch.
- Add a framework for routing interrupts to specific CPUs. Interrupts
are still funneled only to the primary CPU, but that will change for
some systems soon. Ensure that interrupt handler lists are manipulated
only on the CPUs that handle that specific interrupt source. This required
a re-factor of the alpha_shared_intr_*() family of functions.
- Enable __HAVE_INTR_CONTROL, although interrupt redistribution is still
a no-op.
- Reduce code duplication in the Jenson direct-SCB interrupt handlers.
 1.13 22-Sep-2020  thorpej Changes to make MPSAFE interrupts work on Alpha:

- Remove the ipl argument to scb_set() and the associated array of
"mpsafe" booleans initialized based on the ipl. It was bogus
anyway; all IPL_{BIO,NET,TTY}, etc. values are aliases of IPL_VM,
and for all practical purposes, there is really only one device
interrrupt level on Alpha anyway. Intead, we now treat all dispatches
from the SCB vector table as MP-safe, and it is now the handler for
that vector who is responsible for acquiring the KERNEL_LOCK if needed.

- Update the direct interrupt vector handlers in jensenio and TURBOchannel
to acquire the KERNEL_LOCK.

- Introduce a new ALPHA_INTR_MPSAFE flag, and add a flags argument to
alpha_shared_intr_establish(). When it is set, indicate that the
handler is MP-safe. Update alpha_shared_intr_dispatch() to pay
attention and acquire the KERNEL_LOCK (or not) as indicated.

- Re-factor all of the PCI interrupt handling, providing "generic PCI"
"PCI interrupts through ISA IRQs" implementations to significantly
reduce code duplication. Supplement the PCI chipset tag with more
info to facilitate this, and make the PCI interrupt-related routines
take a pci_chipset_tag_t argument rather than a void * argument.

- Because PCI interrupts on KN8AE are dispatched directly from the
SCB, provide a wrapper for non-MPSAFE interrupt handlers that
acquires the KERNEL_LOCK.

- Change the pci_intr_handle_t type to be a struct rather than an
integer type in order to catch any direct use of it as a value.
Add a set of functions to interact with pci_intr_handle_t, including
setting interrupt flags.

- Implement pci_intr_setattr() so that the PCI_INTR_MPSAFE attribute
can be set on a pci_intr_handle_t.

- While I'm here, make all of the MI PCI back-end operations call
through real functions rather than hopping directly through function
pointers in the chipset tag.

This change looks a lot bigger than it really is because of the re-factor
in the plethora of model-specific PCI interrupt back-ends. The KN8AE,
KN300, and T2/T3/T4 (Sable) are largely un-changed.
 1.12 21-Mar-2014  christos gc sprintf; reduce local static usage of interrupt strings that are only
used once for autoconf printing.
 1.11 06-Feb-2012  matt branches: 1.11.6; 1.11.10;
Do a minor cleanup of alpha (this will make applying pullups post branching
easier).
u_int{8,16,32,64}_t -> uint{*}_t
Change all old-style definitions to C89 prototypes.
Whitespace cleanup.
Constification in db_disasm.c
 1.10 28-Apr-2008  martin branches: 1.10.34; 1.10.38;
Remove clause 3 and 4 from TNF licenses
 1.9 15-Mar-2008  cube branches: 1.9.2; 1.9.4;
Split device_t and softc for pckbc(4) and its attachments.
 1.8 05-Jan-2008  ad branches: 1.8.2; 1.8.6;
Fix includes.
 1.7 03-Dec-2007  ad branches: 1.7.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.6 02-Oct-2002  thorpej branches: 1.6.22; 1.6.64; 1.6.82; 1.6.84; 1.6.90;
Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.3 27-Jul-2001  thorpej branches: 1.3.2;
Rework the interrupt code, shaving some cycles off in the process.
Rather than an "iointr" routine that decomposes a vector into an
IRQ, we maintain a vector table directly, hooking up each "iointr"
routine at the correct vector. This also allows us to hook device
interrupts up to specific vectors (c.f. Jensen).

We can shave even more cycles off, here, and I will, but it requires
some changes to the alpha_shared_intr stuff.
 1.2 12-Jul-2001  thorpej bzero -> memset
 1.1 12-Jul-2000  thorpej branches: 1.1.2; 1.1.4; 1.1.8;
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.8.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.8.1 03-Aug-2001  lukem update to -current
 1.1.4.2 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.4.1 12-Jul-2000  bouyer file pckbc_jensenio.c was added on branch thorpej_scsipi on 2000-11-20 19:57:03 +0000
 1.1.2.2 12-Jul-2000  thorpej Update from trunk:
Code to support the DEC 2000/300 (DECpc AXP 150, a.k.a. "Jensen")
systems. Thanks to Gyenes Istvan for the rounds of testing.
 1.1.2.1 12-Jul-2000  thorpej file pckbc_jensenio.c was added on branch netbsd-1-5 on 2000-07-12 20:59:15 +0000
 1.3.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.3.2.1 27-Jul-2001  nathanw file pckbc_jensenio.c was added on branch nathanw_sa on 2002-10-18 02:34:16 +0000
 1.6.90.2 18-Feb-2008  mjf Sync with HEAD.
 1.6.90.1 08-Dec-2007  mjf Sync with HEAD.
 1.6.84.2 23-Mar-2008  matt sync with HEAD
 1.6.84.1 09-Jan-2008  matt sync with HEAD
 1.6.82.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.6.64.1 03-Dec-2007  ad Sync with HEAD.
 1.6.22.3 17-Mar-2008  yamt sync with head.
 1.6.22.2 21-Jan-2008  yamt sync with head
 1.6.22.1 07-Dec-2007  yamt sync with head
 1.7.6.1 08-Jan-2008  bouyer Sync with HEAD
 1.8.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.8.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.8.2.1 24-Mar-2008  keiichi sync with head.
 1.9.4.1 16-May-2008  yamt sync with head.
 1.9.2.1 18-May-2008  yamt sync with head.
 1.10.38.1 18-Feb-2012  mrg merge to -current.
 1.10.34.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.34.1 17-Apr-2012  yamt sync with head
 1.11.10.1 18-May-2014  rmind sync with head
 1.11.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.2.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.15.4.1 13-May-2021  thorpej Sync with HEAD.

RSS XML Feed