Commit Graph

185 Commits

Author SHA1 Message Date
skrll a97306d52b Enable IPIs for MULTIPROCESSOR kernels 2012-05-23 21:11:34 +00:00
skrll 8e6e666e7a Rework the hp700 interrupt code to
- note chip restictions on interrupt in the kernel config
	- allocate interrupts at attach time
	- track per CPU interrupts
	- remove a funciton written in assembly
2012-05-23 16:11:37 +00:00
skrll feb2801c1e Whitespace. 2012-05-23 10:37:01 +00:00
skrll dc648e69c2 s/IRQ/interrupt/ in autoconf message. 2012-05-23 10:31:59 +00:00
skrll 4c621388a1 Add a KASSERT. 2012-05-23 09:49:56 +00:00
skrll 4aea3b4781 Count the cpus as they attach so that CPU_INFO_FOREACH works before
hatching the secondary cpus.
2012-05-23 07:06:02 +00:00
skrll 417560e99b Unwrap a line. 2012-05-21 21:15:39 +00:00
skrll 22e94347b7 KNF 2012-05-21 20:58:39 +00:00
skrll d2c7e180a1 Sync with the following OpenBSD changes, but do the shared interrupt
reporting differently.  Each cpu and device interrupt gets its own
counter.

revision 1.14
Fix counting of interrupts for devices that attach to elroy(4).  Shared
interrupts would be counted double, once for the interrupting device and
once for the device at the head of the chain.  The handlers would run properly
though.  Avoid this by giving each device its own interrupt counter instead
of using the counter provided by the generic interrupt handling code for the
head of the chain.

revision 1.13
Stop calling shared interrupt handlers as soon as one of them return 1
(positive interrupt was for me), like we do on other architectures.
This is done here, at the elroy(4) driver level, since this is where shared
PCI interrupts are handled.  We could do something similar for dino(4) but
this optimization is probably not very relevant there.
2012-04-14 10:43:19 +00:00
skrll 4a227ae20e Whitespace. 2012-04-14 06:04:34 +00:00
skrll 2f65c48678 unifdef FPEMUL. All our supported systems have an FPU. 2012-04-06 12:21:58 +00:00
skrll 595dd83961 Split out cpu_softc into cpuvar.h
Split out the interrupt definitions into intrdefs.h and add the IPI
definitions

Add the required field to cpu_info for the IPI functions.

Makes a MULTIPROCESSOR kernel compiles.
2012-04-05 21:00:29 +00:00
skrll 32ee1e59d6 Kill cpu_gethpa by using the HPA stored in the cpu_info structure. 2012-04-03 12:07:26 +00:00
skrll 896e94351b Make MULTIPROCESSOR compile. 2012-04-03 11:44:32 +00:00
skrll 69a1539631 Rename a field to match PDC documentation. 2012-02-26 08:44:12 +00:00
skrll 330ee79ba1 Regen 2012-02-26 07:51:56 +00:00
skrll 66ee3a47be Take an educiated guess at the CPU id for PCXW+ (Landshark) 2012-02-26 07:50:37 +00:00
skrll 71f73f2dac Delay some things to attach time - pdc_init is too early.
Minor tidyup while I'm here.

OK riz@
2012-02-05 21:46:37 +00:00
skrll 9b9495d4e1 Use __arraycount on hppa_knownmods rather than end-of-table record.
OK riz@
2012-02-05 08:31:53 +00:00
skrll 6c28a43a78 Regen from previous.
OK riz@
2012-02-04 17:05:38 +00:00
skrll 6059877bc7 Adapt to extent(9) changes. 2012-01-27 21:05:38 +00:00
para 89c9828deb converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
2012-01-27 18:52:47 +00:00
skrll fb251482e9 Copyright correction 2012-01-12 23:10:27 +00:00
skrll 0bd6a49498 Support virtual mode as PCX-U/U+ (and probably other) CPU based machines
required it. Only PCX-W seemed to work with real mode.

Gratuitous copying of code from astro. Deadlines!
2012-01-12 23:06:45 +00:00
chs 90d3e8aadd elroy regs don't need to be packed, makes this work with gcc 4.5. 2011-10-01 15:51:36 +00:00
chs 877ceea7f6 PDC_CHASSIS_INFO needs a third parameter, the size of the LCD structure. 2011-10-01 15:51:17 +00:00
dyoung e265f67bc1 #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:31:32 +00:00
rmind e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
dyoung a6b2b8396b PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name.  Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
2011-05-17 17:34:47 +00:00
rmind 2626d57668 Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency.  Remove some unnecessary malloc.h inclusions as well.
2011-04-24 16:26:51 +00:00
dyoung d3e53912d2 Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args.  Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
    pci_intr_map() was a leftover from Xen 2.  Probably a bug.  I
    stopped writing it.  I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
    Probably a bug.  I use a temporary variable.  I have not tested this
    change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
    Probably a bug.  Use a local pci_attach_args.  I have not tested
    this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
    caller's pci_attach_args.  Probably a bug.  Make a local copy of the
    caller's pci_attach_args and modify the copy.  I have not tested
    this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
	HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
	KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
	TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
	OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
2011-04-04 20:37:49 +00:00
skrll 0f27bfbde0 Whitespace. 2011-03-19 06:48:09 +00:00
skrll ca11663366 Change some structure and structure member names to better suit my eye.
No functional change.

Same code before and after.
2011-02-01 18:33:24 +00:00
skrll fb562d62f0 Rename hppa_ncpus hppa_ncpu.
Increment for primary CPU only for now.
2011-01-31 14:11:02 +00:00
skrll 30f0ea9e51 Trailing whitespace. 2011-01-27 13:57:39 +00:00
skrll 299a7684c7 Detect and spin up non-boot CPUs.
Mostly from OpenBSD.
2011-01-23 21:53:39 +00:00
skrll e44006ac79 KNF 2011-01-13 21:44:13 +00:00
skrll 4dfecf969c Redo the way devices are found.
Probe "Snake" machines with PDC_MEMMAP and others with PDC_SYSTEM_MAP.

Some PDCs don't tell us about all devices and/or the whole device tree.
Walk each bus to find these unreported devices.
2011-01-13 21:15:13 +00:00
skrll 2e4617519c Centralise the PDC procedure calls into one file and use a minimal set of
kernel data for PDC results.

Remove the filler components from the PDC structures as a result.

Other tidyups while here.
2011-01-04 10:42:33 +00:00
skrll 4b85f5c0b6 Unwrap/reformat long lines. 2010-12-24 15:29:08 +00:00
skrll bac8b2599d Update struct pdc_model with hwmodel and hv fields for hvers.
Rename cpu_hvers to cpu_modelno.
2010-12-12 08:23:14 +00:00
skrll 6720fc2ed9 Don't panic if something bad happens in attachment. Just print and error
and return.
2010-12-11 19:32:05 +00:00
skrll a32f8e9c7e Update hp700_intr_establish call. Missed in previous. 2010-12-08 09:48:27 +00:00
skrll 0281430f86 s/cannot/can't/ for consistency. 2010-12-06 10:24:04 +00:00
skrll 095b264380 Make the interrupt evcnt name consistent everywhere. 2010-12-05 12:19:09 +00:00
uebayasi 52232a9d0d Pull in uvm/uvm.h where UVM's page level interface is used. 2010-11-12 13:18:56 +00:00
skrll f2dcf75998 Update sti(4) from OpenBSD bringing across support for sti @ pci.
Thanks to Adam Hoka for testing.
2010-11-09 12:24:47 +00:00
skrll 9425fe2fb3 Fix the count usage of various bus_space methods that take a count. 2010-11-08 23:10:24 +00:00
skrll 16cdb55026 Remove some debug code. 2010-06-21 11:04:27 +00:00
skrll bb2cefaa36 Don't define UTURNDEBUG. 2010-06-21 09:06:03 +00:00