Commit Graph

2029 Commits

Author SHA1 Message Date
Bruce Evans
709db0871d `bootdev' is an ordinary u_long, so don't cast it to a pointer to print it.
gcc warns about the cast on i386's with 64-bit longs.

Print `bootdev' in all cases when we bail out because it is unreasonable.
1999-08-23 23:42:00 +00:00
Poul-Henning Kamp
845e0781ec Now that we can bind cdevsw to the individual dev_t, divorce the PERFMON
stuff from mem.c.  If PERFMON is there, it will "steal" a minor from
mem.c, but mem.c doesn't need to know about this.

Fixed type of cmd argument in perfmon_ioctl().
1999-08-23 21:34:23 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Peter Wemm
80e6247e72 The nexus_attach() code works a lot better if it's actually connected to
the device methods... Also, don't fail to add eisa/isa because a previous
device failed to attach.
1999-08-23 19:23:33 +00:00
Alan Cox
a236cb64a9 Modify the macros IMASK_UNLOCK, CPL_UNLOCK, and REL_FAST_INTR_LOCK
to perform the s_unlock inline.
1999-08-23 19:14:18 +00:00
Peter Wemm
a5a9efa92b The previous fix didn't do anything if you didn't have pnp. The ICU
macros are only called in the !APIC_IO case, include icu.h there.
1999-08-22 23:49:00 +00:00
Brian Feldman
1574a39bd2 Finish unbreaking autoconf.c includes (for non-SMP.) 1999-08-22 23:44:33 +00:00
Peter Wemm
2237f6ec54 Oops, that wasn't so clever after all. struct isa_device is still a
prerequisite for this old pnp.h.
1999-08-22 21:44:35 +00:00
Peter Wemm
be5890825d Zap a heap of unused cruft now. We don't need the ISA/EISA/PCI hooks
here any more as they are self identifying.  Only PNP remains but that
will be replaced any day now.
Also reword a comment that had been XXX'ed to death to make it clear[er]
why we don't enable interrupts before probing.
PCIBIOS interrupt routing controls may make this possible to fix one day.
1999-08-22 19:59:29 +00:00
Peter Wemm
ca29e71c56 Take advantage of the apm/npx code and let them identify themselves rather
than having explicit hooks here.
Treat the eisa/isa attach a little differently so that we defer the
decision about to attach eisa/isa to the motherboard directly only if
the PCI probe (if it exists) fails to turn up a PCI->EISA/ISA bridge.
This restores the original device geometry where ISA and/or EISA attach
to their bridge rather than bypassing and going to the root.
1999-08-22 19:56:55 +00:00
Peter Wemm
f3b63bd388 Make the identify routine add itself with priority 100 to make sure it
goes after the npx/apm devices and any other motherboard devices that
may get added down the track.
1999-08-22 19:54:11 +00:00
Peter Wemm
da4113b31f Add an identify method to allow npx to arrange itself to be attached to
the nexus without explicit code in the nexus to do so.
1999-08-22 19:52:51 +00:00
Bill Paul
23e4757cd7 This commit adds device driver support for the Sundance Technologies ST201
PCI fast ethernet controller. Currently, the only card I know that uses
this chip is the D-Link DFE-550TX. (Don't ask me where to buy these: the
only cards I have are samples sent to me by D-Link.)

This driver is the first to make use of the miibus code once I'm sure
it all works together nicely, I'll start converting the other drivers.

The Sundance chip is a clone of the 3Com 3c90x Etherlink XL design
only with its own register layout. Support is provided for ifmedia,
hardware multicast filtering, bridging and promiscuous mode.
1999-08-21 18:34:58 +00:00
Mike Smith
f996ef6395 Loosen up the constructed argument segment generation slightly; rather than
trying to size it intelligently just make it 64k and leave it up to the caller
to ensure that the arguments all fit within that range.

This should resolve the issue that some people were seeing with the PnP BIOS
scan crashing on a large PnP node.
1999-08-20 21:08:41 +00:00
KATO Takenori
9212e4c73a There may exist two kinds of IBM BlueLightning CPU. One is that 5/2
test does not change undefined flag like Cyrix CPUs.  Another is that
5/2 test changes undefined flag like Intel CPUs.  Latter one could not
be detected and was recognized 486DX CPU.  To solve this,
finishidentcpu() calls identblue() when cpu_vendor is null string
(that is, CPUID instruction is not supported) and cpu == CPU_486.
Tests have been done on IBM BlueLightning CPUs, i486SX and i486DX.
1999-08-20 09:31:18 +00:00
Peter Wemm
264c3d8738 Undo my previous commit and do it differently. Break the ffs() etc macros
into two parts - one to do the bsfl and the other to convert the result
(base 0) to ffs()-like (base 1) in inline C.  This enables the optimizer
to be a lot smarter in certain cases, like where it knows that the argument
is non-zero and we want ffs(known non zero arg) - 1.  This appears to
produce identical code to the old inline when the argument is unknown.
1999-08-19 14:54:40 +00:00
Peter Wemm
bb41d37104 Try using the builtin ffs() for egcs, it (by random inspection)
generates slightly better code and avoids the incl then subl when
using ffs(foo) - 1.
1999-08-19 00:32:48 +00:00
Peter Wemm
ebf9e95f31 Update for MI switch code, and trim a heap of unused (I believe) entries. 1999-08-19 00:20:10 +00:00
Peter Wemm
28f31ccfaf Use the MI process selection. We use a quick routine to decide whether
to get the mplock and enter the kernel to run a process in the SMP case.
1999-08-19 00:18:48 +00:00
Alan Cox
08c40841d8 Create callable (non-inline) versions of the atomic_OP_TYPE functions
that are linked into the kernel.  The KLD compilation options are
changed to call these functions, rather than in-lining the
atomic operations.

This approach makes atomic operations from KLDs significantly
faster on UP systems (though somewhat slower on SMP systems).

PR:		i386/13111
Submitted by:	peter.jeremy@alcatel.com.au
1999-08-18 04:08:31 +00:00
Mike Smith
dc055b0c58 Remove the SMBIOS detection and definitions; this should be handled in a
loadable module (under development).
1999-08-18 02:20:04 +00:00
Mike Smith
cb5f885bdf Search for and interrogate the PnP BIOS if found. This code just prints
the PnP device IDs in verbose mode; it does not (yet) save any resource
data or contribute to the PnP process nor resource management.
1999-08-17 07:10:34 +00:00
Mike Smith
7880e8b2d5 Mindbogglingly, many BIOS vendors expect to be able to load %ds with
0x40 and then access data stored in real-mode segment 0x40, even when
called in protected mode.  Microsoft unfortunately coddle these individuals,
and so must we if we want to run their code.

This change works around GPFs in some APM and PnP BIOS implementations.

Obtained from:	Linux
1999-08-17 07:09:13 +00:00
Justin T. Gibbs
3c0dcb2cf2 Fix a bug in busdma_mem_free() where we were improperly checking
the map associated with the region to free.
1999-08-16 01:51:38 +00:00
Poul-Henning Kamp
c6ba8fec16 Give if_tun the "almost clone" makeover. 1999-08-15 09:54:57 +00:00
Poul-Henning Kamp
bd3a53203f Give BPF the "almost-clone" update. If you need more of them, make
more entries in /dev and be happy you don't need to recompile your
kernel.
1999-08-15 09:38:21 +00:00
Poul-Henning Kamp
7dc5cd047f The bdevsw() and cdevsw() are now identical, so kill the former. 1999-08-13 10:29:38 +00:00
Alan Cox
7308467da9 _pmap_allocpte:
If the pte page isn't PQ_NONE, panic rather than silently
	covering up the problem.
1999-08-11 19:19:04 +00:00
Peter Wemm
accc665bbe Hopefully fix the previous commit, it caused *all* bridges to be detected
as PCI->HOST bridges on my (440BX) box.

My change is to remove the test at the beginning entirely, letting the
switch on the device ID happen first.  If the device ID is unknown, then
(in the default case) check for the generic PCIS_BRIDGE_HOST tag.  This
should allow wierd cases (eg: wpaul's IMS VL bridge) to work by using the
id override.  This strategy is more in line with the other PCI match
methods we use elsewhere,

I only have a limited testbed, but having my USB etc devices detected as
PCI->HOST bridges doesn't look good.
1999-08-10 09:22:21 +00:00
Alan Cox
7f8d227938 pmap_remove_pages:
Add KASSERT to detect out of range access to the pv_table and
	report the errant pte before it's overwritten.
1999-08-10 04:10:57 +00:00
Bill Paul
d9d628b000 Fix nexus_pcib_is_host_bridge() so that it detects my 486's PCI bus
correctly. It has the following code:

        if (class != PCIC_BRIDGE || subclass != PCIS_BRIDGE_HOST)
                return NULL;

My 486 has an Integrated Micro Solutions PCI bridge which identifies
itself as subclass PCIS_BRIDGE_OTHER, not PCIS_BRIDGE_HOST. Consequently,
it gets ignored. In my opinion, the correct test should be:

        if ((class != PCIC_BRIDGE) && (subclass != PCIS_BRIDGE_HOST))
                return NULL;

That way the test still succeeds because the chip's class is PCIC_BRIDGE.
Clearly it's not reasonable to expect all host to PCI bridges to always
have a subclass of PCIS_BRIDGE_HOST since I've got one that doesn't.
This way the sanity test should remain relatively sane while still allowing
some oddball yet correct hardware to work. If somebody has a better way
to do it, go ahead and tweak the test, but be aware that
class == PCIC_BRIDGE and subclass == PCIS_BRIDGE_OTHER is a valid case.

While I was here, I also added an explicit ID string for the IMS chipset.
I also dealt with a minor style nit: it's bad karma not to have a default
case for your switch statements, but the one in this routine doesn't have
one. The default string of "Host to PCI bridge" is now assigned in a
default case of the switch statement instead of initializing "s" with the
string before the switch and then not having any default case.
1999-08-09 21:12:18 +00:00
Poul-Henning Kamp
ce9edcf5b5 Merge the cons.c and cons.h to the best of my ability. alpha may or
may not compile, I can't test it.
1999-08-09 10:35:05 +00:00
Poul-Henning Kamp
ef40c56108 Make the pty driver as close to a cloning device as we can get for now,
we create the pty on the fly when it is first opened.

If you run out of ptys now, just MAKEDEV some more.

This also demonstrate the use of dev_t->si_tty_tty and dev_t->si_drv1
in a device driver.
1999-08-08 19:28:59 +00:00
Jordan K. Hubbard
0a729622af Enable bpf by default. There was no significant dissention to my proposal
of 2 weeks ago that this be done, and anyone who wishes to make bpf more
selective according to securelevel or compile-time options is more
than free to do so.
1999-08-07 01:42:08 +00:00
Poul-Henning Kamp
e26c9de235 Forgot the "bsd" slice, now setrootbyname() understands "wd0s1a". 1999-08-06 20:29:46 +00:00
Mike Smith
6d5e741cb8 Fix typo which would have caused MTRR support on non-SMP systems to
behave in an utterly random fashion.

Submitted by:	gibbs
1999-08-04 20:24:49 +00:00
Peter Wemm
cac6a04400 Don't probe if pci_cfgopen() fails to find pci hardware, like we used to
to.  This might have caused interesting things on non-PCI hardware if
PCI was compiled in.
1999-08-04 13:38:24 +00:00
Alan Cox
eaf183a844 pmap_object_init_pt:
Verify that object != NULL.
1999-07-31 23:02:57 +00:00
Alan Cox
5d2aec8927 Change the type of vpgqueues::lcnt from "int *" to "int". The indirection
served no purpose.
1999-07-31 18:31:00 +00:00
Alan Cox
086d0ae1dc Add parentheses for clarity.
Submitted by:	dillon
1999-07-31 04:10:31 +00:00
Mike Smith
3cc31bc262 Formatting-only cleanup accidentally omitted from the patch merge in the
previous major update.  Bring new code into style alignment with the
existing code.  No functional changes.
1999-07-29 18:47:39 +00:00
Peter Wemm
32610e173d GBIOSSTACK_SEL is undefined, but OTOH, BSSSEL apparently isn't used either. 1999-07-29 08:33:00 +00:00
Mike Smith
64ecbc4d0b Remove some duplicate definitions, as suggested by Alan Cox. 1999-07-29 07:10:35 +00:00
Mike Smith
27e901101c Fix for vmspace sharing as per Alan Cox. Thanks! 1999-07-29 06:48:26 +00:00
Mike Smith
496027bf08 Major update to the kernel's BIOS-calling ability.
- Add support for calling 32-bit code in other segments
 - Add support for calling 16-bit protected mode code

Update APM to use this facility.

Submitted by:	jlemon
1999-07-29 01:49:19 +00:00
Brian Feldman
8799702cbc Remove XXX from the headers (broke the build, I'm betting.) 1999-07-29 01:20:47 +00:00
Matthew N. Dodd
15317dd875 Alter the behavior of sys/kern/subr_bus.c:device_print_child()
- device_print_child() either lets the BUS_PRINT_CHILD
	  method produce the entire device announcement message or
	  it prints "foo0: not found\n"

Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on
the previous behavior of device_print_child() (printing the
"foo0: <FooDevice 1.1>" bit of the announce message.)

Provide bus_print_child_header() and bus_print_child_footer()
to actually print the output for bus_generic_print_child().
These functions should be used whenever possible (unless you can
just use bus_generic_print_child())

The BUS_PRINT_CHILD method now returns int instead of void.

Modify everything else that defines or uses a BUS_PRINT_CHILD
method to comply with the above changes.

	- Devices are 'on' a bus, not 'at' it.
	- If a custom BUS_PRINT_CHILD method does the same thing
	  as bus_generic_print_child(), use bus_generic_print_child()
	- Use device_get_nameunit() instead of both
	  device_get_name() and device_get_unit()
	- All BUS_PRINT_CHILD methods return the number of
	  characters output.

Reviewed by: dfr, peter
1999-07-29 01:03:04 +00:00
Mike Smith
e33bfde398 We're called too early to have any idea whether APM is going to be
active or not.  The only sane thing we can do here is assume that if
APM is supported it might be active at some point, and bail.

In reality, even this isn't good enough; regardless of whether we support
APM or not, the system may well futz with the CPU's clock speed and throw
the TSC off.  We need to stop using it for timekeeping except under
controlled circumstances.  Curse the lack of a dependable high-resolution
timer.
1999-07-28 20:22:30 +00:00
Mike Smith
dce593b01e Remove some droppings left over from the removal of the APM hooks. 1999-07-28 19:34:16 +00:00
Doug Rabson
aa595accc9 Add support for SYS_RES_DENSE and SYS_RES_BWX resource types. These are
equivalent to SYS_RES_MEMORY for x86 but for alpha, the rman_get_virtual()
address of the resource is initialised to point into either dense-mapped
or bwx-mapped space respectively, allowing direct memory pointers to be
used to device memory.

Reviewed by: Andrew Gallatin <gallatin@cs.duke.edu>
1999-07-28 07:57:48 +00:00