Commit Graph

240 Commits

Author SHA1 Message Date
Nate Lawson
a2b31c5b4f Add a devd(8) event that is sent after the system resumes. This can be
used by utilities to reset moused(8), for example.  The syntax is:

    !system=kern subsystem=power type=resume

Note that it would be nice to have notification of suspend, but it's more
difficult since there would have to be a method of doing request/ack
to userland and automatically timing out if no response.  apm(4) has a
similar mechanism.

MFC after:	2 weeks
2006-01-22 01:06:25 +00:00
John Baldwin
267ec43593 When loading a driver that is a subclass of another driver don't set the
devclass's parent pointer if the two drivers share the same devclass.  This
can happen if the drivers use the same new-bus name.  For example, we
currently have 3 drivers that use the name "pci": the generic PCI bus
driver, the ACPI PCI bus driver, and the OpenFirmware PCI bus driver.  If
the ACPI PCI bus driver was defined as a subclass of the generic PCI bus
driver, then without this check the "pci" devclass would point to itself
as its parent and device_probe_child() would spin forever when it
encountered the first PCI device that did have a matching driver.

Reviewed by:	dfr, imp, new-bus@
2006-01-20 21:59:13 +00:00
Poul-Henning Kamp
c9df826b0a Correct STAILQ usage in purge of resourcelist.
Found with:   Coverity Prevent(tm)
2006-01-14 09:41:35 +00:00
Warner Losh
2f624c21c5 When data passed into devctl_notify is NULL, don't print (null). Instead
don't print anything at all.

# this fixes a problem that I noticed with devd.pipe not terminating lines
# with \n correctly sometimes.
2005-10-04 22:25:14 +00:00
Poul-Henning Kamp
a778923149 Add two convenience functions for device drivers: bus_alloc_resources()
and bus_free_resources().  These functions take a list of resources
and handle them all in one go.  A flag makes it possible to mark
a resource as optional.

A typical device driver can save 10-30 lines of code by using these.

Usage examples will follow RSN.

MFC:	A good idea, eventually.
2005-09-24 19:31:10 +00:00
Warner Losh
fe0519b171 MFp4: Expose device_probe_child() 2005-09-18 01:32:09 +00:00
Warner Losh
139f16505d Simplify the code a bit after the bzero(). 2005-06-09 05:50:01 +00:00
Nate Lawson
96ab794b26 Document that the returned pointer should be freed even if the number
of items returned is 0.
2005-05-20 05:04:22 +00:00
Colin Percival
fd94099ec2 If we are going to
1. Copy a NULL-terminated string into a fixed-length buffer, and
2. copyout that buffer to userland,
we really ought to
0. Zero the entire buffer
first.

Security: FreeBSD-SA-05:08.kmem
2005-05-06 02:50:00 +00:00
Warner Losh
2bd5d8147a resource_list_purge: release the resources in this list, and purge the
elements of this list (eg, reset it).

Man page to follow
2005-04-12 15:20:36 +00:00
Warner Losh
cdf7c848cf Return the resource created/found in resource_list_add to avoid an extra
resouce_list_find in some places.

Suggested by: sam
Found by: Coventry Analysis tool.
2005-04-12 04:22:17 +00:00
Nate Lawson
4abfd70c87 Document that devclass_get_maxunit(9) returns one greater than the current
highest unit.

Reviewed by:	dfr
MFC after:	2 weeks
2005-04-04 15:37:59 +00:00
Nate Lawson
fada20b989 Add devclass_get_drivers(9) which provides an array of pointers to driver
instances in a given devclass.  This is useful for systems that want to
call code in driver static methods, similar to device_identify().

Reviewed by:	dfr
MFC after:	2 weeks
2005-04-04 15:26:51 +00:00
Nate Lawson
a44732323f maxunit is actually one higher than the greatest currently-allocated unit
in a devclass.  All the other uses of maxunit are correct and this one was
safe since it checks the return value of devclass_get_device(), which would
always say that the highest unit device doesn't exist.

Reviewed by:	dfr
MFC after:	3 days
2005-04-03 22:23:18 +00:00
John Baldwin
ea2b9b3e36 - Denote a few places where kobj class references are manipulated without
holding the appropriate lock.
- Add a comment explaining why we bump a driver's kobj class reference
  when loading a module.
2005-03-31 22:49:31 +00:00
Poul-Henning Kamp
eb0d6cde00 Move implementation of hw.bus.rman sysctl to subr_rman.c so that
subr_bus.c doesn't need to peek inside struct resource.

OK from:	imp
2005-03-24 18:13:11 +00:00
Warner Losh
36fed96550 Use STAILQ in preference to SLIST for the resources. Insert new resources
last in the list rather than first.

This makes the resouces print in the 4.x order rather than the 5.x order
(eg fdc0 at 0x3f0-0x3f5,0x3f7 is 4.x, but 0x3f7,0x3f0-0x3f5 is 5.x).  This
also means that the pci code will once again print the resources in BAR
ascending order.
2005-03-18 05:19:50 +00:00
Poul-Henning Kamp
78e253c8d5 Use dynamic major number allocation. 2005-02-27 22:00:45 +00:00
Sam Leffler
3e55226c46 kill dead code
Noticed by:	Coverity Prevent analysis tool
2005-02-23 00:43:00 +00:00
Nate Lawson
7990a18c7b Maxunit is inclusive so fix off-by-one in previous commit. 2005-02-08 18:03:17 +00:00
Nate Lawson
5b68bf38ab Update device_find_child(9) to return the first matching child if unit
is set to -1.

Reviewed by:	dfr, imp
2005-02-08 18:00:29 +00:00
Robert Watson
3fcd9325ec Correct a minr whitespace inconsistency introduced in revision 1.159:
add a tab between #define and DF_REBID instead of a space.
2005-01-29 22:04:30 +00:00
Warner Losh
234111d6d0 Introduce bus_free_resource. It is a convenience function which wraps
bus_release_resource by grabbing the rid from the resource.
2005-01-19 06:52:19 +00:00
Warner Losh
d0d4cc63e3 Implement device_quiesce. This method means 'you are about to be
unloaded, cleanup, or return ebusy of that's inconvenient.'  The
default module hanlder for newbus will now call this when we get a
MOD_QUIESCE event, but in the future may call this at other times.

This shouldn't change any actual behavior until drivers start to use it.
2004-12-31 20:47:51 +00:00
Nate Lawson
8844d5efa6 Add the devclass_get_count(9) function and man page. It gets a count of
the number of devices in a devclass and is a subset of
devclass_get_devices(9).

Reviewed by:	imp, dfr
2004-12-08 02:39:56 +00:00
David E. O'Brien
405a104ec0 When panicing in device_unbusy(), actually tell what device has the issue. 2004-12-05 20:58:56 +00:00
Warner Losh
891e611130 Start to add GIANT_REQUIRED; macros in places where giant is required
and that I've verified things seem to basically work.  I was able to
boot and hot plug usb devices.  Please let me know if this causes
problems for anybody.

The push down of giant has proceeded to the point that this will start
to matter more and more.
2004-12-05 07:55:30 +00:00
Poul-Henning Kamp
f71a47143f Don't print the singularly unhelpful message:
unknown: not probled (disabled)

During verbose boot.
2004-11-03 09:06:45 +00:00
Nate Lawson
66ae9f6384 Update flags patch for the !ISA case.
* Get flags first, in case there is no devclass.
* Reset flags after each probe in case the next driver has no hints so it
  doesn't inherit the old ones.
* Set them again before the winning probe.

Tested ok both with and without ACPI for ISA device flags.

Reviewed by:	imp
MFC after:	1 day
2004-10-14 17:14:56 +00:00
Nate Lawson
6f857c4b9f Set flags for devices before probing them. In the non-ISA case, flags set
via hints were not getting passed to the child.

PR:		kern/72489
MFC after:	1 day
2004-10-13 07:10:41 +00:00
Warner Losh
2063e05140 Fix BUS_DEBUG case 2004-08-30 05:48:49 +00:00
Warner Losh
f52c5866ea Initial support (disabled) for rebidding devices. I've been running
this in my tree for a while and in its disabled state there are no
issues.  It isn't enabled yet because some drivers (in acpi) have side
effects in their probe routines that need to be resolved in some
manner before this can be turned on.  The consensus at the last
developer's summit was to provide a static method for each driver
class that will return characteristics of the driver, one of which is
if can be reprobed idempotently.
2004-08-29 18:25:21 +00:00
Warner Losh
3cdf2a3f20 MFp4: Merge in the patches, submitted long ago by someone whose email
address I've lost, that move the location information to the atttach
routine as well.  While one could use devinfo to get this data, that
is difficult and error prone and subject to races for short lived
devices.

Would make a good MT5 candidate.
2004-08-29 18:11:10 +00:00
Warner Losh
0160658e84 Set the description to NULL in the right detach routine. This should
keep dangling pointers to strings in loaded modules from hanging
around after the drivers are unloaded.
2004-08-24 05:19:15 +00:00
Doug Rabson
4c4392e791 Add doxygen doc comments for most of newbus and the BUS interface. 2004-07-18 16:30:31 +00:00
Poul-Henning Kamp
3e019deaed Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".
2004-07-15 08:26:07 +00:00
Warner Losh
0363a12688 Hide struct resource and struct rman. You must define
__RMAN_RESOURCE_VISIBLE to see inside these now.

Reviewed by: dfr, njl (not njr)
2004-06-30 16:54:10 +00:00
Warner Losh
37b4e4f471 Include more information about the device in the devadded and
devremoved events.  This reduces the races around these events.  We
now include the pnp info in both.  This lets one do more interesting
thigns with devd on device insertion.

Submitted by: Bernd Walter
2004-06-30 02:46:25 +00:00
Warner Losh
29b95d5a7e Turns out that jhb didn't really like this. And nate pointed out that
it wasn't a good idea to have the test for NULL on only a limited
subset.  Go back because I'm not sure adding NULL to all the others is
a good idea.
2004-06-28 03:40:23 +00:00
Warner Losh
d5ca7f4f2b Allow dev to be NULL and assume that a device is not alive or not
attached.

Reviewed by: njl(?) and jhb
2004-06-28 02:24:04 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Maxime Henrion
bd304417e1 When we don't have any meaningful value to print for the device sysctl
tree, output an empty string instead of "?".  This is already what
happened with DEVICE_SYSCTL_LOCATION and DEVICE_SYSCTL_PNPINFO.  This
makes the output of "sysctl dev" much nicer (it won't display those
empty sysctls).

Reviewed by:	des
2004-06-05 11:39:05 +00:00
Dag-Erling Smørgrav
35e32fd8a3 Add a devclass level to the dev sysctl tree, in order to support per-
class variables in addition to per-device variables.  In plain English,
this means that dev.foo0.bar is now called dev.foo.0.bar, and it is
possible to to have dev.foo.bar as well.
2004-06-04 10:23:00 +00:00
Maxime Henrion
2e34ae7a26 As discussed on arch@, flatten the device sysctl tree to make it
more convenient to deal with.  The notion of hierarchy is however
preserved by adding a new %parent node.
2004-06-02 22:43:35 +00:00
Pawel Jakub Dawidek
d860b24150 Sysctl hw.bus.devctl_disable shouldn't be writtable from inside a jail.
Approved by:	imp
2004-05-26 16:36:32 +00:00
Dag-Erling Smørgrav
5c1921b779 As previously threatened, give each device its own sysctl context and
subtree (under the new dev top-level node).  This should greatly simplify
drivers which need per-device sysctl variables (such as ndis).
2004-05-25 12:06:26 +00:00
Scott Long
cd587b1397 Don't print out 'GIANT-LOCKED' for INTR_FAST drivers. 2004-04-01 07:18:42 +00:00
Warner Losh
9fc0327792 Conform to local file sytle and prefer (a && (b & flag)). 2004-03-24 16:49:37 +00:00
David E. O'Brien
0d50bcb36b Change the !MPSAFE boot string to something that doesn't potentially
scare users that the kernel won't run on MP systems.
2004-03-23 01:58:09 +00:00
David E. O'Brien
f1c8692d0a Rather than display which interrupts are MPSAFE, display those that aren't.
This way we can take stock of the work to be done.  boot -v will note those
interrupts that are MPSAFE.
2004-03-22 22:36:11 +00:00
Dag-Erling Smørgrav
854a417d92 Whitespace cleanup 2004-02-24 19:31:30 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Sam Leffler
d3be1471c7 o make debug_mpsafenet globally visible
o move it from subr_bus.c to netisr.c where it more properly belongs
o add NET_PICKUP_GIANT and NET_DROP_GIANT macros that will be used to
  grab Giant as needed when MPSAFE operation is enabled

Supported by:	FreeBSD Foundation
2003-11-05 23:42:51 +00:00
Warner Losh
252af39a96 Minor style(9) nit 2003-11-05 06:14:48 +00:00
Sam Leffler
3465702f13 disable MPSAFE network drivers; we aren't ready yet` 2003-11-04 02:01:42 +00:00
Sam Leffler
90fc7b7cb8 Add a temporary mechanism to disble INTR_MPSAFE from network interface
drivers.  This is prepatory to running more parts of the network system
w/o Giant.
2003-10-29 18:29:50 +00:00
Warner Losh
17e02bb39b Convenience functions to generate notifications from the kernel. The ACPI
code will start using these shortly.

Reviewed by: njl
2003-10-24 22:41:54 +00:00
Doug Rabson
46ba7a35f2 * Add multiple inheritance to kobj. Each class can have zero or more base
classes and if a method is not found in a given class, its base classes
  are searched (in the order they were declared). This search is recursive,
  i.e. a method may be define in a base class of a base class.
* Change the kobj method lookup algorithm to one which is SMP-safe. This
  relies only on the constraint that an observer of a sequence of writes
  of pointer-sized values will see exactly one of those values, not a
  mixture of two or more values. This assumption holds for all processors
  which FreeBSD supports.
* Add locking to kobj class initialisation.
* Add a simpler form of 'inheritance' for devclasses. Each devclass can
  have a parent devclass. Searches for drivers continue up the chain of
  devclasses until either a matching driver is found or a devclass is
  reached which has no parent. This can allow, for instance, pci drivers
  to match cardbus devices (assuming that cardbus declares pci as its
  parent devclass).
* Increment __FreeBSD_version.

This preserves the driver API entirely except for one minor feature used
by the ISA compatibility shims. A workaround for ISA compatibility will
be committed separately. The kobj and newbus ABI has changed - all modules
must be recompiled.
2003-10-16 09:16:28 +00:00
Warner Losh
d29516dd82 With DIAGNOSTICS, sometimes we get weird crashes when some driver
accesses softc after it is freed.  Use a different malloc type for
softc than the rest of the bus code to make it more clear when these
things happen that it is the driver that's at fault, not the bus code.

Suggested by: sam and/or phk (I think)
2003-10-14 06:22:07 +00:00
Marcel Moolenaar
da13b8f9fe Introduce BUS_CONFIG_INTR(). The method allows devices to tell parents
about interrupt trigger mode and interrupt polarity. This allows ACPI
for example to pass interrupt resource information up the hierarchy.
The default implementation of the method therefore is to pass the
request to the parent.

Reviewed by: jhb, njl
2003-09-10 21:37:10 +00:00
Sam Leffler
7c00e355a2 Print a message at boot for interrupt handlers created with INTR_MPSAFE
and/or INTR_FAST.  This belongs elsehwere and perhaps under bootverbose;
I'm committing it for now as it's uesful to know which drivers have
been converted and which have not.
2003-09-05 22:51:18 +00:00
David E. O'Brien
677b542ea2 Use __FBSDID(). 2003-06-11 00:56:59 +00:00
Mark Murray
51da11a27a Fix some easy, global, lint warnings. In most cases, this means
making some local variables static. In a couple of cases, this means
removing an unused variable.
2003-04-30 12:57:40 +00:00
Warner Losh
01a9b4348f Create a new function, device_is_attached(), that is like
device_is_alive() that tells us if the device has successfully
attached.  device_is_alive just tells us that the device has
successfully probed.
2003-04-21 18:19:08 +00:00
Warner Losh
e22b0bf4b8 Fix /dev/devctl's implementation of poll. We should only be setting
the poll bits when there's actually something in the queue.
Otherwise, select always returned '2' when there were no items to be
read, and '3' when there were.  This would preclude being able to read
in a threaded (libc_r) program, as well as checking to see if there
were pending events or not.
2003-04-21 05:58:51 +00:00
John Baldwin
6751370f6f Lock the process before sending it a SIGIO. Not doing so is a panic(2)
implementation with INVARIANTS.
2003-04-02 21:54:51 +00:00
Alfred Perlstein
569d3c4bf0 Make sure we actually have a dev before dereferencing in case someone
botches and sends us a NULL pointer.  The other code in this file seems
to expect it to be able to handle it behaving this way.
2003-03-13 06:29:44 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Warner Losh
b47d073500 Fix comment about what we do when there are no listeners. 2003-01-19 00:34:17 +00:00
David Xu
4e77d3c6a2 Don't forget to disconnect object from class. 2003-01-15 14:58:07 +00:00
David Xu
7be6584678 Don't record thread pointer, it's not permanent in process life cycle,
use process pointer instead.
2003-01-10 09:54:51 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Warner Losh
62c8b32c71 Use 0600 for permissions for /dev/devctl until it is cloneable.
Use UID_ROOT and GID_WHEEL rather than 0.

Prompted by: rwatson
2003-01-01 03:43:58 +00:00
Warner Losh
304f10ce4a devd kernel improvements:
1) Record all device events when devctl is enabled, rather than just when
   devd has devctl open.  This is necessary to prevent races between when
   a device arrives, and when devd starts.
2) Add hw.bus.devctl_disable to disable devctl, this can also be set as a
   tunable.
3) Fix async support. Reset nonblocking and async_td in open.  remove
   async flags.
4) Free all memory when devctl is disabled.

Approved by: re (blanket)
2002-11-30 00:49:43 +00:00
John Baldwin
d0e938f4f1 Use %z to quiet a warning. 2002-11-07 22:38:04 +00:00
Poul-Henning Kamp
9736c8f03a Use ; not , as statement separator in PDEBUG() macro.
Ignoring a NULL dev in device_set_ivars() sounds wrong, KASSERT it to
non-NULL instead.

Do the same for device_get_ivars() for reasons of symmetry, though
it probably would have yielded a panic anyway, this gives more precise
diagnostics.

Absentmindedly nodded OK to by:	jhb
2002-10-15 18:56:13 +00:00
Warner Losh
0b294f891d Introducing /dev/devctl. This device reports events in the
configuration device hierarchy.  Device arrival, departure and not
matched are presently reported.  This will be the basis for devd, which
I still need to polish a little more before I commit it.  If you don't
use /dev/devctl, it will be a noop.
2002-10-07 23:17:44 +00:00
Warner Losh
c17fdbe3a9 Two minor bugfixes:
o Allow the bus_debug variable to be set via the bus.debug tunable.
o Return pnpinfo and location info via the devinfo interface to userland.
  devinfo(8) needs to be updated to print it.
2002-10-07 23:15:40 +00:00
Warner Losh
0a1d3ef9b8 Add wrappers around the newly created bus_child_pnpinfo_str and
bus_child_location_str.
2002-10-07 07:08:00 +00:00
Warner Losh
d71dec96bf Minor string handling cleanup that I've had in my tree for a while:
Don't use snprintf where strlcpy() will do the job.
Also, a NUL is '\0' not 0 in our style (C doesn't care), so spell it like.
Remove useless {} and () in the general area of this change.
2002-10-07 06:50:35 +00:00
Warner Losh
da7b83f9ea Don't need to NUL terminate after snprintf 2002-10-07 06:26:17 +00:00
Poul-Henning Kamp
c56c20f13d Absorb <sys/bus_private.h> into kern/subr_bus.c to prevent misunderstandings.
Suggested by:	bde
Approved by:	dfr
2002-10-02 09:34:29 +00:00
Poul-Henning Kamp
651dde1b81 Move includ of <sys/bus_priate.h> later to get semantic identity of
device_t the same throughout kernel.

This is a very fine point of C which fortunatly does not make any
difference in normal circumstances but which due to the pervasiveness
of device_t in the kernel can make a lint barf a lot.
2002-09-28 21:38:35 +00:00
Warner Losh
bed807193b Add additional information returned to userland by the device querying
functions.  We add pnpinfo, locationinfo, devflags (the newbus flags
on the device), flags (the flags that device_get_flags returns) and
state to the list of things we return.

pnpinfo and locationinfo are place holders at the moment that will be
filled in by the device's parent (optionally).  Userland programs will
likely use this information from time to time and take appropriate
actions.

Improvements to devinfo to follow.
2002-09-14 19:15:12 +00:00
Bruce Evans
f70de49661 Fixed style bugs in resource_list_add_next(). 2002-09-12 13:45:38 +00:00
Bruce Evans
527eee2d40 Include <vm/uma.h> instead of depending on namespace pollution in
<sys/malloc.h>.

Sorted includes as much as possible.  Removed banal comment(s) attached to
includes.
2002-09-11 07:13:28 +00:00
Warner Losh
5878eb3fca Add bus_child_present and the child_present method to bus_if.m 2002-07-21 03:28:43 +00:00
Poul-Henning Kamp
00d70dec4e Don't call malloc(9) to allocate zero bytes softc data for devices. 2002-04-23 15:48:23 +00:00
Matthew N. Dodd
32bc1098b2 Add resource_list_add_next() which returns the RID for the resource added. 2002-03-29 06:42:54 +00:00
Bruce Evans
3006e31679 Don't (blindly) truncate the unit number to 4 digits when formatting the
string returned by device_get_nameunit().
2002-03-06 11:34:02 +00:00
Bruce Evans
ffe4d2f7c7 Fixed 3 regressions in rev.1.99 (clobbering of the English fix in rev.1.98,
and 2 unformattings).
2002-02-26 16:17:45 +00:00
Søren Schmidt
ed57cfc480 Hide "bla bla exists, skipping it" behind bootverbose. 2002-02-26 10:38:33 +00:00
Bruce Evans
25bf7324c8 Fixed an apparent typo ("-" before ":") and an English error (comma
splice) in the "already exists" message.

Fixed some minor style bugs (KNFization to "return (foo)" had rotted
in 2 out of 177 cases).
2001-12-28 18:32:13 +00:00
Thomas Moestl
87b1520ae4 Add a generic __BUS_ACCESSOR macro to construct ivar accessor functions,
and a generic resource_list_print_type() function to print all resouces
of a certain type in a resource list.
Use ulmin()/ulmax() instead of min()/max() in two places to handle
u_longs correctly.
2001-12-21 21:45:09 +00:00
David E. O'Brien
a48740b6c5 Update to C99, s/__FUNCTION__/__func__/. 2001-12-10 05:51:45 +00:00
Andrew R. Reiter
22524ad0e2 o No need to set values to 0 when we utilize M_ZERO
Approved by: peter
2001-11-05 22:27:46 +00:00
Warner Losh
89bbe0cd1e Don't hide the failure to allocate device behind boot verbose. It is
still telling us of real problems so should remain until it stops
doing that.

Submitted by: OGAWA Takaya <t-ogawa@triaez.kaisei.org>
2001-11-02 17:33:06 +00:00
Andrey A. Chernov
82849b4dfe Add new interface function
int	devclass_find_free_unit(devclass_t dc, int unit);
which return first free unit in given class starting from 'unit'.
2001-11-01 05:07:28 +00:00
Andrey A. Chernov
e9c044bd9e 1) In devclass_alloc_unit(), skip duplicated wired devices (i.e. with fixed
number) instead of allocating next free unit for them.  If someone needs
fixed place, he must specify it correctly. "Allocating next" is especially bad
because leads to double device detection and to "repeat make_dev panic" as
result.  This can happens if the same devices present somewhere on PCI bus,
hints and  ACPI.  Making them present in one place only not always
possible, "sc" f.e.  can't be removed from hints, it results to no console at
all.

2) In make_device(), detect when devclass_add_device() fails, free dev and
return. I.e. add missing error checking. This part needed to finish fix in 1),
but must be done this way in anycase, with old variant too.
2001-10-28 23:32:35 +00:00
Peter Wemm
2fc4762c60 Move the hints gunk to a seperate file. It isn't really part of the
newbus structure (no more than subr_rman.c is anyway).
2001-07-14 08:25:18 +00:00