Commit Graph

115594 Commits

Author SHA1 Message Date
Maxim Konovalov
92aa3968f2 Add OpenBSD 3.7. 2005-05-20 05:13:25 +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
Nate Lawson
1c9ec53854 If devclass_get_devices() returns success but a count of 0, free the
pointer.  If kernel malloc(0) returns a valid pointer, it needs to be
freed.  If it returns NULL, it's ok to free this also.

Submitted by:	pjd
Reviewed by:	imp, dfr
Obtained from:	Coverity Prevent
2005-05-20 05:00:43 +00:00
Bruce A. Mah
201aed7a77 New release notes: libalias as kernel module, ng_nat(4), sed(1) -l,
ATA mkIII, chflags(1) -h, kldstat(8) -m, what(1) -q, GNU grep patches
from Fedora.
2005-05-20 04:19:56 +00:00
Bill Paul
0b6c3bf1bc Missed kern_windrv.c in the last checkin. 2005-05-20 04:01:36 +00:00
Bill Paul
450a94af7a Deal with a few bootstrap issues:
We can't call KeFlushQueuedDpcs() during bootstrap (cold == 1), since
the flush operation sleeps to wait for completion, and we can't sleep
here (clowns will eat us).

On an i386 SMP system, if we're loaded/probed/attached during bootstrap,
smp_rendezvous() won't run us anywhere except CPU 0 (since the other CPUs
aren't launched until later), which means we won't be able to set up
the GDTs anywhere except CPU 0. To deal with this case, ctxsw_utow()
now checks to see if the TID for the current processor has been properly
initialized and sets up the GTD for the current CPU if not.

Lastly, in if_ndis.c:ndis_shutdown(), do an ndis_stop() to insure we
really halt the NIC and stop interrupts from happening.

Note that loading a driver during bootstrap is, unfortunately, kind of
a hit or miss sort of proposition. In Windows, the expectation is that
by the time a given driver's MiniportInitialize() method is called,
the system is already in 'multiuser' state, i.e. it's up and running
enough to support all the stuff specified in the NDIS API, which includes
the underlying OS-supplied facilities it implicitly depends on, such as
having all CPUs running, having the DPC queues initialized, WorkItem
threads running, etc. But in UNIX, a lot of that stuff won't work during
bootstrap. This causes a problem since we need to call MiniportInitialize()
at least once during ndis_attach() in order to find out what kind of NIC
we have and learn its station address.

What this means is that some cards just plain won't work right if
you try to pre-load the driver along with the kernel: they'll only be
probed/attach correctly if the driver is kldloaded _after_ the system
has reached multiuser. I can't really think of a way around this that
would still preserve the ability to use an NDIS device for diskless
booting.
2005-05-20 04:00:50 +00:00
Sam Leffler
eb2a391f14 guard against bogus address data
Submitted by:	Bakul Shah
2005-05-20 03:58:53 +00:00
Peter Wemm
d9d99c5478 Fix libstand on amd64. Rev 1.46 (obrien) removed the -I. that the
bzip2 support provided, and amd64 depended on.  Amd64 has a custom
${.OBJDIR}/machine symlink in it and the -I. picked this up.  Without
it, the libstand code was being compiled in 32 bit mode, but with 64 bit
machine headers.
2005-05-20 03:18:19 +00:00
Bill Paul
cebddbda3b In ndis_halt_nic(), invalidate the miniportadapterctx early to try and
prevent anything from making calls to the NIC while it's being shut down.
This is yet another attempt to stop things like mdnsd from trying to
poke at the card while it's not properly initialized and panicking
the system.

Also, remove unneeded debug message from if_ndis.c.
2005-05-20 02:35:43 +00:00
Christian Brueffer
e9a32efc6e Document support for the 5714.
MFC after:	3 days
2005-05-20 01:20:23 +00:00
Christian Brueffer
bf7f62ef58 Add nve(4). 2005-05-20 01:19:02 +00:00
Maxim Sobolev
4d87b291ad Extend `autoboot_delay' handling - is this variable is set to -1 don't allow
user to interrupt autoboot process at all. Currently, even when
`autoboot_delay' is set to 0, loader(8) still allows autoboot process to be
interrupted by pressing any key on the console when the loader reads kernel
and modules from the disk. In some cases (i.e. untrusted environment) such
behaviour is highly indesirable and user should not be allowed to interfere
with the autoboot process at all.

Sponsored by:	PBXpress Inc.
MFC after:	3 days
2005-05-19 23:03:02 +00:00
Marius Strobl
cf87ad7afd Recognize the integrated USB controllers of Sun PCIO-2 chips which
are used onboard in most of the newer PCI-based sun4u machines
(cosmetic change as they were also already probed as generic OHCI
without this). Detect whether their intpin register is valid and
correct it if necessary, i.e. set the respective IVAR to the right
value for allocating the IRQ resource, as some of them come up
having it set to 0 (mainly those used in Blade 100 and the first
one on AX1105 boards). This fixes attaching affected controllers.
Correcting the intpin value might be better off in the PCI code
via a quirk table but on the other hand gem(4) and hem(4) also
correct it themselves and at least for the USB controller part
the intpin register is truely hardwired to 0 and can't be changed.
This means that we would have to hook up the quirk information
in a lot of places in the PCI code (i.e. whenever the value of the
intpin register is read from or written to the pci_devinfo of the
respective device) in order to do it the right way.

MFC after:	1 month
2005-05-19 23:00:46 +00:00
Marius Strobl
a30881c7d7 Sync with the other files.<arch> files and put the keyboard map
generation stuff at the beginning of this file as well as add a
dependency on dev/kbd/kbd.c for ukbd(4).
2005-05-19 22:56:00 +00:00
Maxime Henrion
8835fa2759 Correct a few places where we called warn() when warnx() should have
been used.

Submitted by:	"Liam J. Foy" <liamfoy@sepulcrum.org>
Obtained from:	DragonFlyBSD
2005-05-19 21:33:48 +00:00
Marius Strobl
003daaea5f o mc146818(4):
- Add locking.
  - Account for if the MC146818_NO_CENT_ADJUST flag is set we don't need
    to check wheter year < POSIX_BASE_YEAR.
  - Add some comments about mapping the day of week from the range the
    generic clock code uses to the range the chip uses and which I meant
    to add in the initial version.
  - Minor clean-up, use __func__ instead of hardcoded function names in
    error strings.

o in the rtc(4) front-end additionally:
  - Don't leak resources in case mc146818_attach() fails.
  - Account for ebus(4) defaulting to SYS_RES_MEMORY for the memory
    resources since ebus.c rev. 1.22.
2005-05-19 21:20:42 +00:00
Marius Strobl
fb596371a9 - Add locking.
- Add support for storing the century in MK48TXX_WDAY_CB on MK48Txx with
  extended registers when the MK48TXX_NO_CENT_ADJUST flag is set (and which
  is termed somewhat confusing as it actually means don't manually adjust
  the century in the driver).
- Add the MI part of interfacing the watchdog functionality of MK48Txx with
  extended registers with watchdog(9). This is inspired by the SunOS/Solaris
  drivers for the 'eeprom' devices also having watchdog support. I actually
  expected this to work out of the box on Sun Exx00 machines with 'eeprom'
  devices which have a 'watchdog-enable' property. On terminal count of the
  the watchdog timer however only the MK48TXX_FLAGS_WDF bit rises but the
  reset signal and the interrupt respectively (depending on whether the
  MK48TXX_WDOG_WDS bit of the chip and the MK48TXX_WDOG_ENABLE_WDS flag
  of the driver respectively is set) goes nowhere. Apparently passing the
  reset signal on to the WDR line of the CPUs has to be enabled somewhere
  else but we don't have documentation for the Exx00 specific controllers.
  I decided to commit this nevertheless so it can be enabled in the eeprom(4)
  front-end later in e.g. 6.0-STABLE without breaking the API. Besides the
  Exx00 the watchdog part of the MK48Txx should also work on E250 and E450.
  Possibly also without extra fiddling on these machines but I haven't
  found someone willing to give it a try on such a machine so far.
- Use uintXX_t instead of u_intXX_t, use __func__ instead of hardcoded
  function names in error strings.
2005-05-19 21:16:50 +00:00
Christian S.J. Peron
8e56d2ee05 Add cases for ENOBUFS and ENETDOWN. We need to make sure that we
catch all transient errors. This fixes situations where transient
error conditions such as network interfaces losing carrier signals
or the system running out of mbufs would result in the permanent
removal of forwarding syslog messages.

MFC after:	1 week
2005-05-19 21:09:44 +00:00
Paul Saab
419c028b36 Support the 5714C
Submitted by:	John Cagle <john dot cagle at hp dot com>
2005-05-19 21:08:59 +00:00
Gleb Smirnoff
fff7ff711b Document taskqueue_drain(). 2005-05-19 18:31:42 +00:00
Marius Strobl
a0b2f8d7fc - Collapse eeprom_ebus.c and eeprom_sbus.c into eeprom.c and
eeprom_ebus_attach() and eeprom_sbus_attach() into eeprom_attach()
  respectively. Since the introduction of the ofw_bus interface some
  time ago and now that ebus(4) also uses SYS_RES_MEMORY for the
  memory resources since ebus.c rev. 1.22 there is no longer a
  need to have separate front-ends for ebus(4), fhc(4) and sbus(4).
- Fail gracefully instead of panicing when the model can't be
  determined.
- Don't leak resources when mk48txx_attach() fails.
- Use FBSDID.
2005-05-19 18:15:37 +00:00
Marius Strobl
437bc968c0 Take advantage of ebus(4) having switched to SYS_RES_MEMORY for the
memory resources in ebus.c rev. 1.22 and treat both the EBus and SBus
variants alike in this regard.

Ok'ed by:	yongari
2005-05-19 18:13:49 +00:00
Marius Strobl
176da80446 - Artificially using SYS_RES_IOPORT for EBus devices for reasons of
compatibility with ISA devices while in fact all known EBus devices
  actually use memory space turned out to be not a good idea as so far
  there is only the 'rtc' device known to show up either on an EBus or
  ISA bus but not on any of the other busses used on sparc64. However
  there are quite a couple of them that show up on either EBus, FireHose
  or SBus. In order to save extra code in the respective drivers switch
  ebus(4) to actually use SYS_RES_MEMORY for the memory resources of
  its children. At least for transition still accept SYS_RES_IOPORT
  and silently change it to SYS_RES_MEMORY. [1]
- In ebus_probe() use ofw_bus_get_name() instead of re-implementing it
  via ofw_bus_get_node() and OF_getprop().
- Remove some unused variables.
- Use FBSDID.

Discussed with:	tmm (some time ago)
2005-05-19 18:11:46 +00:00
Marius Strobl
42be1191a0 - When iterating over the register resources of the children don't use
the iteration variable as the RID when adding the respective resource
  to the child via bus_set_resource(). In case a device has both I/O
  and memory resources this generates gaps in the newbus resources of
  the child, e.g. its first memory resource might end up as RID 1.
  To solve this mimic resource_list_add_next() via resource_list_find()
  and bus_set_resource(); we can't just use resource_list_add_next()
  here as this would circumvent the limit checks in isa_set_resource()
  of the common ISA code.
  This however is more or less a theoretical problem so far as all known
  ISA devices on sparc64 soley use I/O space.
- Just use bus_generic_rl_release_resource() for isa_release_resource()
  instead of re-implementing the former.
- Improve some comments to better reflect reality, minor clean-up and
  simplifications, return NULL instead of 0 were appropriate.
2005-05-19 15:47:37 +00:00
Poul-Henning Kamp
0f93d8245d Make the path to make.conf a parameter which can be overridden.
NB: you have to use absolute path!
2005-05-19 15:34:36 +00:00
Poul-Henning Kamp
af7b2a826c Save space by using -b 4096 -f 512 for newfs.
Retain -i 8192 to avoid wasting inodes.
2005-05-19 15:34:00 +00:00
Poul-Henning Kamp
3ed0460401 Run the "files" customization script 2005-05-19 15:24:23 +00:00
Poul-Henning Kamp
a2830531c0 Add some runtime admin/tool scripts 2005-05-19 15:23:47 +00:00
Marius Strobl
99998ae585 Sync with openfirm(4) and check the return value of malloc() although
this isn't exactly necessary with M_WAITOK.
2005-05-19 15:23:17 +00:00
Marius Strobl
2ad154205f Update the names of some member variables in comments to refect reality.
Apparently this was forgotten when this code was derived from the BSD
openprom(4).
2005-05-19 15:22:16 +00:00
Poul-Henning Kamp
63ad46aa0d Add a couple of basic customization scripts. 2005-05-19 15:20:49 +00:00
Marius Strobl
6283ced1e2 - Add suport for the bus_get_resource() device interface method to
central(4) and fhc(4) by using bus_generic_rl_get_resource().
- Remove some superfluous breaks in central.c
2005-05-19 15:09:56 +00:00
Christian Brueffer
6059b9e1fd Add nve(4). 2005-05-19 15:01:44 +00:00
Christian Brueffer
977f66ec53 Directly link to the nve(4) manpage. 2005-05-19 14:59:21 +00:00
Christian Brueffer
fed9784e38 - Connect nve(4)
- Correct sorting order

Suggested and reviewed by:	ru
2005-05-19 14:54:48 +00:00
Christian Brueffer
0a02677cd7 Manpage for the nve NVIDIA nForce MCP Ethernet driver. The manpage is based
on the nvnet driver manpage by Quinton Dolan.

Especially the list of supported hardware needs some work.
2005-05-19 14:52:42 +00:00
Marius Strobl
65fb49a994 - Try to not leak resources in the attach functions of the esp(4) SBus
front-end and the LSI64854 and NCR53C9x code in case one of these
  functions fails. Add detach functions to these parts and make esp(4)
  detachable.
- Revert rev. 1.7 of esp_sbus.c, since rev. 1.34 of sbus.c the clockfreq
  IVAR defaults to the per-child values.
- Merge ncr53c9x.c rev. 1.111 from NetBSD (partial):
  On reset, clear state flags and the msgout queue.
  In NetBSD code to notify the upper layer (i.e. CAM in FreeBSD) on reset
  was also added with this revision. This is believed to be not necessary
  in FreeBSD and was not merged.
  This makes ncr53c9x.c to be in sync with NetBSD up to rev. 1.114.
- Conditionalize the LSI64854 support on sbus(4) only instead of sbus(4)
  and esp(4) as it's also required for the 'dma', 'espdma' and 'ledma'
  busses/devices as well as the 'SUNW,bpp' device (printer port) which
  all hang off of sbus(4).
- Add a driver for the 'dma', 'espdma' and 'ledma' (pseudo-)busses/
  devices. These busses and devices actually represent the LSI64854 DMA
  engines for the ESP SCSI and LANCE Ethernet controllers found on the
  SBus of Ultra 1 and SBus add-on cards. With 'espdma' and 'ledma' the
  'esp' and 'le' devices hang off of the respective DMA bus instead of
  directly from the SBus. The 'dma' devices are either also used in this
  manner or on some add-on cards also as a companion device to an 'esp'
  device which also hangs off directly from the SBus. With the latter
  variant it's a bit tricky to glue the DMA engine to the core logic of
  the respective 'esp' device. With rev. 1.35 of sbus.c we are however
  guaranteed that such a 'dma' device is probed before the respective
  'esp' device which simplifies things a lot. [1]
- In the esp(4) SBus front-end read the part-unique ID code of Fast-SCSI
  capable chips the right way. This fixes erroneously detecting some
  chips as FAS366 when in fact they are not. Add explicit checks for the
  FAS100A, FAS216 and FAS236 variants instead treating all of these as
  ESP200. That way we can correctly set the respective Fast-SCSI config
  bits instead of driving them out of specs. This includes adding the
  FAS100A and FAS236 variants to the NCR53C9x core code. We probably
  still subsume some chip variants as ESP200 while in fact they are
  another variant which however shouldn't really matter as this will
  only happen when these chips are driven at 25MHz or less which implies
  not being able to run Fast-SCSI. [3]
- Add a workaround to the NCR53C9x interrupt handler which ignores the
  stray interrupt generated by FAS100A when doing path inquiry during
  boot and which otherwiese would trigger a panic.
- Add support for the 'esp' devices hanging off of a 'dma' or 'espdma'
  busses or which are companions of 'dma' devices to esp(4). In case of
  the variants that hang off of a DMA device this is a bit hackish as
  esp(4) then directly uses the softc of the respective parent to talk
  to the DMA engine. It might make sense to add an interface for this
  in order to implement this in a cleaner way however it's not yet clear
  how the requirements for the LANCE Ethernet controllers are and the
  hack works for now. [2]
  This effectively adds support for the onboard SCSI controller in
  Ultra 1 as well as most of the ESP-based SBus add-on cards to esp(4).
  With this the code for supporting the Performance Technologies SBS430
  SBus SCSI add-on cards is also largely in place the remaining bits
  were however omitted as it's unclear from the NetBSD how to couple
  the DMA engine and the core logic together for these cards.

Obtained from:	OpenBSD [1]
Obtained from:	NetBSD [2]
Clue from:	BSD/OS [3]
Reviewed by:	scottl (earlier version)
Tested with:	FSBE/S add-on card (FAS236), SSHA add-on card (ESP100A),
		Ultra 1 (onboard FAS100A), Ultra 2 (onboard FAS366)
2005-05-19 14:51:10 +00:00
Marius Strobl
410f3d914e - Add an IVAR for retrieving the interrupt group number of the parent Sbus
device and which also applies to the children. This is very usefull for
  drivers for the various subordinate busses so they don't need to fiddle
  with the OFW node of their parent themselves. As SBus busses hang of the
  nexus and we don't use the ofw_bus interface for nexus devices, yet, this
  would also require special knowledge about this in the drivers for the
  SBus children which these shouldn't need to have.
  This includes switching to use an unshifted IGN in the sc_ign member of
  the sbus(4) softc internally.
- For SBus child devices where there are variants that are actually split
  split into two SBus devices (as opposed to the first half of the device
  being a SBus device and the second half hanging off of the first one)
  like 'auxio' and 'SUNW,fdtwo' or 'dma' and 'esp' probe the SBus device
  which is a prerequisite to the driver attaching to the second one with
  a lower order. This saves us from dealing with different probe orders
  in the respective device drivers which generally is more hackish.
- Remove a stale comment about the 'specials' array above the attaching
  of the child devices. This is a remnant of the NetBSD/sparc origin of
  this code. There the 'specials' array is also used to probe certain
  devices which are prerequisites to others first. Why NetBSD soley
  relies on the devices having the expected order in the OFW tree on
  sparc64 isn't clear to me, as far as I can tell OFW doesn't guaranteed
  such things.
2005-05-19 14:47:31 +00:00
Bruce A. Mah
28629d2de8 SA-05.09.htt only applies to i386 and amd64, so conditionalize
appropriately.
2005-05-19 14:43:20 +00:00
Bruce A. Mah
d565684dc9 Catch up on some low-hanging fruit...
New release notes: SA-05:09.htt, awk 20050424, bzip2 1.0.3, libregex
from a glibc CVS snapshot, pf from OpenBSD 3.7.

Updated release notes:  lukemftp 20050219.
2005-05-19 14:33:44 +00:00
Giorgos Keramidas
3c2ab2b0ec The 'text' argument of u_header() is not used, so we don't need to
trim_header() it.

Noticed by:	bde
2005-05-19 13:34:19 +00:00
Poul-Henning Kamp
b715b67f2c Explain the magic 2005-05-19 13:33:21 +00:00
Hartmut Brandt
56f5aba2ca Some test cases for .SHELL target: builtin shell selection and
changing the path of a builtin shell.
2005-05-19 11:23:01 +00:00
Takanori Watanabe
b4b4c81522 Use General definition for general notify. 2005-05-19 09:13:26 +00:00
Doug Rabson
6f21c8127a Align the stack to a 16 byte boundary so that we can safely call functions
that use SSE. The compiler does attempt to do this in main() but not very
successfully - it still manages to use unaligned offsets from %ebp in some
cases. Also we need to have an aligned stack in case something uses SSE
via _init().

MFC After: 1 week
2005-05-19 07:36:07 +00:00
Doug Rabson
9310a53def Align the stack to a 16 byte boundary before calling _rtld so that we can
safely initialise shared libraries that use SSE in their init sections.

MFC After: 1 week
2005-05-19 07:32:42 +00:00
Doug Rabson
0ff6455012 Keep the stack aligned to a 16 byte boundary when calling init functions
so that we don't cause a bus error if they start storing SSE math stuff
on the stack.

MFC After: 1 week
2005-05-19 07:31:06 +00:00
Peter Grehan
a9f9f6ce08 Change ofw_readin/ofw_copyin to map the entire region before
copying, rather than a page at a time. This was creating far
too many single-page mappings, and eventually OFW overflowed
some internal data structure and refused to map any more.
The new algorithm creates far less mappings and fixed a bug
where multiple mappings for the same page would be created.

'Twas known this was a problem, but only became urgent when the
install CD's mfs_root grew large enough to cause the overflow.
2005-05-19 07:21:46 +00:00
Alan Cox
1aececdb5a Remove calls to spl*(). 2005-05-19 06:11:13 +00:00
Nate Lawson
c363ab2430 Fix low res profiling kernel build. Move two defines to collapse the
#ifdef GUPROF case.
2005-05-19 05:22:52 +00:00