Commit Graph

148 Commits

Author SHA1 Message Date
dyoung 9aff02ebc1 #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 20:57:45 +00:00
dyoung 59adf08e17 Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet.  Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
2011-07-01 17:09:58 +00:00
wiz 4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +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 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
tsutsui 7e87afa114 Add MI HIL (keyboard/mouse) support from OpenBSD.
Tested on 735/125 and ok'ed by skrll@.
2011-02-15 10:32:56 +00:00
skrll b0db353f1b Fix PR/44500 for hppa. 2011-02-07 12:19:35 +00:00
skrll 4ab536071f Fix CPU_INFO_FOREACH. 2011-01-31 18:21:33 +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 6c1ba1691b Trailing whitespace. 2011-01-25 21:27:48 +00:00
skrll 0f20ab8fc3 define<tab> 2011-01-25 21:27:11 +00:00
skrll b663b253b6 Provide LWP_PC 2011-01-24 07:44:16 +00:00
skrll 299a7684c7 Detect and spin up non-boot CPUs.
Mostly from OpenBSD.
2011-01-23 21:53:39 +00:00
skrll 16d5fda989 Make some more information (psw/fpu_state) per cpu. 2011-01-23 09:44:58 +00:00
skrll 2a78b12bfe Fix MULTIPROCESSOR curlwp/curcpu handling. 2011-01-22 10:57:07 +00:00
skrll b404656635 Move the clock_intr declaration. 2011-01-20 19:47:40 +00:00
skrll ddf6216538 Whitespace. 2011-01-17 12:37:46 +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 4ad49271c4 Unwrap short line. 2011-01-05 07:40:16 +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 9ed174ca8e Reformat comment. 2011-01-03 19:20:11 +00:00
he 3b9ac1bb43 Expose parts of struct cpu_info if _KMEMUSER is defined, for the benefit
of e.g. vmstat.
2010-12-26 21:05:34 +00:00
skrll 05364009f0 LOCKDEBUG is not referenced in this file anymore. 2010-12-24 16:00:13 +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 dd4fc49621 Remove trailing whitespace from previous. Today is not my day. 2010-12-04 16:04:45 +00:00
skrll fab9eed30a Define PDC_ERR_NMOD 2010-12-04 16:02:55 +00:00
skrll 4509878aef Get capabilities right THIS time. 2010-12-04 16:01:42 +00:00
skrll 8eb08cae49 Spell capabilities correctly in PDC_MODEL_CAPABILITES. 2010-12-04 15:58:52 +00:00
uebayasi 7d4ea18f4e Don't expose spl* symbols to userland. Should fix build. 2010-11-16 08:59:30 +00:00
skrll 4d532c945b MULTIPROCESSOR fixes
- provide curcpu in a control register instead of curlwp
- define {GET,SET}_CURLWP and GET_CURCPU and use whereever possible.
- define a cpu count and use it in CPU_INFO_FOREACH

XXX hppa_ncpus isn't valid yet.
2010-06-06 12:13:35 +00:00
skrll 8d20091e0c Fix CPU_INFO_FOREACH in previous. 2010-06-06 10:22:43 +00:00
skrll e2b7df5a2a *** empty log message *** 2010-06-06 10:15:51 +00:00
skrll 50cd7644e6 Remove unncessary cast. 2010-06-04 06:39:38 +00:00
skrll 7c33d11fea Change struct cpu_info layout to improve cache footprint. From OpenBSD. 2010-06-04 06:36:34 +00:00
skrll 57e5de8837 Add the lcd(4) driver from OpenBSD. Thanks to Adam Hoka for doing most of
the work.
2010-06-01 10:20:28 +00:00
ahoka 550ce899de Handle the HAVE_NBTOOL_CONFIG_H case.
Fixes hp700 build with objdir.
2010-05-17 09:13:03 +00:00
skrll 3a97a3e13a Provide hppa_cpu_hastlbu_p 2010-04-26 15:25:24 +00:00
skrll 05b7cce3dc Don't round the bus space map/unmap requests to page size, but keep track
of the exact regions requested.

Only ever map the whole FLEX area in when mapped and don't unmap.

G/C the BTLB stuff - it doesn't work. Maybe one day it will come back.
2010-04-23 15:04:09 +00:00
skrll 4bfaa8385e Add hppa_cpu_ispa20_p 2010-04-06 07:58:31 +00:00
skrll 4c773d30e5 G/C setsoftnet and hp700_intr_schedule prototype. 2010-04-06 07:47:48 +00:00
skrll 0be33f66cf Add md_astpending to struct mdlwp and use it. 2010-04-03 07:46:01 +00:00
skrll 45b51608bd Per-cpu "physical" trap save area. 2010-04-02 19:33:16 +00:00
skrll b47f9dd06a Make cpl, ipending, and intr_depth per CPU values. 2010-03-31 12:56:14 +00:00
skrll 03eb22ecf7 #define<tab> 2010-03-31 06:35:12 +00:00
skrll 0b76114e29 Comments against #endifs. 2010-03-30 19:54:28 +00:00
skrll 552862ce56 Whitespace. 2010-03-07 08:44:28 +00:00
skrll ea38704829 Add #include "opt_cputype.h" where necessary. 2010-03-06 21:22:42 +00:00
skrll 6216966bd3 Add some comments. 2010-02-17 11:33:51 +00:00
skrll def9f5d433 Whitespace. 2010-02-17 11:21:24 +00:00
skrll fe12c9786e Add aliasing defines for PA2.0 cpus.
They will cause unnecessary non-equiv alias handling on PA1.x machines if
PA2.0 cpu support is compiled into the kernel.  GENERIC currently doesn't
have this support enabled.

The performance hit of this needs testing.
2010-02-17 11:14:10 +00:00