freebsd-nq/sys/dev/ppc
John Baldwin 2067d312d4 Add locking to ppc and ppbus and mark the whole lot MPSAFE:
- To avoid having a bunch of locks that end up always getting acquired as
  a group, give each ppc(4) device a mutex which it shares with all the
  child devices including ppbus(4), lpt(4), plip(4), etc.  This mutex
  is then used for all the locking.
- Rework the interrupt handling stuff yet again.  Now ppbus drivers setup
  their interrupt handler during attach and tear it down during detach
  like most other drivers.  ppbus(4) only invokes the interrupt handler
  of the device that currently owns the bus (if any) when an interrupt
  occurs, however.  Also, interrupt handlers in general now accept their
  softc pointers as their argument rather than the device_t.  Another
  feature of the ppbus interrupt handlers is that they are called with
  the parent ppc device's lock already held.  This minimizes the number
  of lock operations during an interrupt.
- Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE.
- lpbb(4) uses the ppc lock instead of Giant.
- Other plip(4) changes:
  - Add a mutex to protect the global tables in plip(4) and free them on
    module unload.
  - Add a detach routine.
  - Split out the init/stop code from the ioctl routine into separate
    functions.
- Other lpt(4) changes:
  - Use device_printf().
  - Use a dedicated callout for the lptout timer.
  - Allocate the I/O buffers at attach and detach rather than during
    open and close as this simplifies the locking at the cost of
    1024+32 bytes when the driver is attached.
- Other ppi(4) changes:
  - Use an sx lock to serialize open and close.
  - Remove unused HADBUS flag.
  - Add a detach routine.
  - Use a malloc'd buffer for each read and write to avoid races with
    concurrent read/write.
- Other pps(4) changes:
  - Use a callout rather than a callout handle with timeout().
  - Conform to the new ppbus requirements (regular mutex, non-filter
    interrupt handler).  pps(4) is probably going to have to become a
    standalone driver that doesn't use ppbus(4) to satisfy it's
    requirements for low latency as a result.
  - Use an sx lock to serialize open and close.
- Other vpo(4) changes:
  - Use the parent ppc device's lock to create the CAM sim instead of
    Giant.
- Other ppc(4) changes:
  - Fix ppc_isa's detach method to detach instead of calling attach.

Tested by:	  no one :-(
2009-01-21 23:10:06 +00:00
..
ppc_acpi.c Add locking to ppc and ppbus and mark the whole lot MPSAFE: 2009-01-21 23:10:06 +00:00
ppc_isa.c Add locking to ppc and ppbus and mark the whole lot MPSAFE: 2009-01-21 23:10:06 +00:00
ppc_pci.c Add locking to ppc and ppbus and mark the whole lot MPSAFE: 2009-01-21 23:10:06 +00:00
ppc_puc.c Add locking to ppc and ppbus and mark the whole lot MPSAFE: 2009-01-21 23:10:06 +00:00
ppc.c Add locking to ppc and ppbus and mark the whole lot MPSAFE: 2009-01-21 23:10:06 +00:00
ppcreg.h Add locking to ppc and ppbus and mark the whole lot MPSAFE: 2009-01-21 23:10:06 +00:00
ppcvar.h Add locking to ppc and ppbus and mark the whole lot MPSAFE: 2009-01-21 23:10:06 +00:00