Move most of the contents of opt_compat.h to opt_global.h.opt_compat.h is mentioned in nearly 180 files. In-progress networkdriver compabibility improvements may add over 100 more so this isclose
Move most of the contents of opt_compat.h to opt_global.h.opt_compat.h is mentioned in nearly 180 files. In-progress networkdriver compabibility improvements may add over 100 more so this iscloser to "just about everywhere" than "only some files" per theguidance in sys/conf/options.Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset ofsys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.his created on all architectures.Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control theset of compiled files.Reviewed by: kib, cem, jhb, jtlSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D14941
show more ...
Revert r327828, r327949, r327953, r328016-r328026, r328041:Uses of mallocarray(9).The use of mallocarray(9) has rocketed the required swap to build FreeBSD.This is likely caused by the allocation
Revert r327828, r327949, r327953, r328016-r328026, r328041:Uses of mallocarray(9).The use of mallocarray(9) has rocketed the required swap to build FreeBSD.This is likely caused by the allocation size attributes which put extra pressureon the compiler.Given that most of these checks are superfluous we have to choose betterwhere to use mallocarray(9). We still have more uses of mallocarray(9) buthopefully this is enough to bring swap usage to a reasonable level.Reported by: woschPR: 225197
dev: make some use of mallocarray(9).Focus on code where we are doing multiplications within malloc(9). None ofthese is likely to overflow, however the change is still useful as somestatic checke
dev: make some use of mallocarray(9).Focus on code where we are doing multiplications within malloc(9). None ofthese is likely to overflow, however the change is still useful as somestatic checkers can benefit from the allocation attributes we use formallocarray.This initial sweep only covers malloc(9) calls with M_NOWAIT. No goodreason but I started doing the changes before r327796 and at that time itwas convenient to make sure the sorrounding code could handle NULL values.
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Most calls to bus_alloc_resource() use "anywhere" as the range, with a givencount. Migrate these to use the new bus_alloc_
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Most calls to bus_alloc_resource() use "anywhere" as the range, with a givencount. Migrate these to use the new bus_alloc_resource_anywhere() API.Reviewed by: jhbDifferential Revision: https://reviews.freebsd.org/D5370
Use the callout(9) API instead of timeout(9). To do this more cleanly,convert a global timer to a per-controller timer. This works much betterwith locking and removes the need for several global
Use the callout(9) API instead of timeout(9). To do this more cleanly,convert a global timer to a per-controller timer. This works much betterwith locking and removes the need for several global lookup tables.Tested by: ambrisko
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIcommand register. The lazy BAR allocation code in FreeBSD sometimesdisables this bit when it detects a range conflict, and w
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIcommand register. The lazy BAR allocation code in FreeBSD sometimesdisables this bit when it detects a range conflict, and will re-enableit on demand when a driver allocates the BAR. Thus, the bit is no longera reliable indication of capability, and should not be checked. Thisresults in the elimination of a lot of code from drivers, and also givesthe opportunity to simplify a lot of drivers to use a helper API to setthe busmaster enable bit.This changes fixes some recent reports of disk controllers and theirassociated drives/enclosures disappearing during boot.Submitted by: jhbReviewed by: jfv, marius, achadd, achimMFC after: 1 day
These checks against BUSY aren't needed: the newbus layer does thisalready with the appropriate locks held... There's no need to do ithere, so just delete the checks.
Temporarily revert the new-bus locking for 8.0 release. It will bereintroduced after HEAD is reopened for commits by re@.Approved by: re (kib), attilio
Make the newbus subsystem Giant free by adding the new newbus sxlock.The newbus lock is responsible for protecting newbus internIal structures,device states and devclass flags. It is necessary to h
Make the newbus subsystem Giant free by adding the new newbus sxlock.The newbus lock is responsible for protecting newbus internIal structures,device states and devclass flags. It is necessary to hold it when allsuch datas are accessed. For the other operations, softc locking shouldensure enough protection to avoid races.Newbus lock is automatically held when virtual operations on the deviceand bus are invoked when loading the driver or when the suspend/resumetake place. For other 'spourious' operations trying to access/modifythe newbus topology, newbus lock needs to be automatically acquired anddropped.For the moment Giant is also acquired in some key point (modules subsystem)in order to avoid problems before the 8.0 release as module handlers couldmake assumptions about it. This Giant locking should go just afterthe release happens.Please keep in mind that the public interface can be expanded in orderto provide more support, if there are really necessities at some pointand also some bugs could arise as long as the patch needs a bit offurther testing.Bump __FreeBSD_version in order to reflect the newbus lock introduction.Reviewed by: ed, hps, jhb, imp, mav, scottlNo answer by: ariff, thompsa, yongariTested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com>Sponsored by: Yahoo! IncorporatedApproved by: re (ksmith)
Last minute TTY API change: remove mutex argument from tty_alloc().I don't want people to override the mutex when allocating a TTY. It hasto be there, to keep drivers like syscons happy. So I'm cr
Last minute TTY API change: remove mutex argument from tty_alloc().I don't want people to override the mutex when allocating a TTY. It hasto be there, to keep drivers like syscons happy. So I'm creating atty_alloc_mutex() which can be used in those cases. tty_alloc_mutex()should eventually be removed.The advantage of this approach, is that we can just remove a function,without breaking the regular API in the future.
Start to convert this over to the new tty layer. These changes allowthis driver to compile and limp along with the new layer. These changesdo not deal with proper locking around access to the HW.
Start to convert this over to the new tty layer. These changes allowthis driver to compile and limp along with the new layer. These changesdo not deal with proper locking around access to the HW. This is onlya starting point. I have not tested modem control but tip seems to workokay and I can send and receive characters which I needed for one of my-current boxes. I have not tied this driver back up to the build sinceI don't want people to think it is ready for prime time. If anyoneelse has some cycles to work on this feel free to!Also add support for a 16 port PCI interface I have at work.Glanced at by: ed
Replace all calls to minor() with dev2unit().After I removed all the unit2minor()/minor2unit() calls from the kernelyesterday, I realised calling minor() everywhere is quite confusing.Character d
Replace all calls to minor() with dev2unit().After I removed all the unit2minor()/minor2unit() calls from the kernelyesterday, I realised calling minor() everywhere is quite confusing.Character devices now only have the ability to store a unit number, nota minor number. Remove the confusion by using dev2unit() everywhere.This commit could also be considered as a bug fix. A lot of drivers callminor(), while they should actually be calling dev2unit(). In -CURRENTthis isn't a problem, but it turns out we never had any problem reportsrelated to that issue in the past. I suspect not many people connectmore than 256 pieces of the same hardware.Reviewed by: kib
Initialize DWBuf[3].Approved by: re (rwatson, blanket)
Fix Rocketport so that it does not crash the system when a device pointerchanges for example:(From Craig Leres):tip to a rocketport linerun "/etc/rc.d/devfs restart"exit tip(wait for the syst
Fix Rocketport so that it does not crash the system when a device pointerchanges for example:(From Craig Leres):tip to a rocketport linerun "/etc/rc.d/devfs restart"exit tip(wait for the system to reboot)Thanks to Robert Watson for poking me to fix this.PR: kern/109152Approved by: imp (mentor)Approved by: re (kensmith)Reviewed by: jhbSubmitted by: Craig Leres <leres@ee dot lbl dot gov>
- Make rp(4) 64-bit- and endian-clean as well as work on strict alignment archs. [1]- Instead of bus_space_{read,write}*(rman_get_bustag(), rman_get_bushandle()) use bus_{read,write}*() for effi
- Make rp(4) 64-bit- and endian-clean as well as work on strict alignment archs. [1]- Instead of bus_space_{read,write}*(rman_get_bustag(), rman_get_bushandle()) use bus_{read,write}*() for efficiency.Reported by: Peter Losher [1]Tested on: i386, sparc64MFC after: 2 weeks
The UPCI 32 rp(4) card uses BAR 2 like the UPCI 80 card.Submitted by: Vitaliy Skakun vit dot ska at gmail dot comMFC after: 3 days
Fix -Wundef from compiling the amd64 LINT.
Fix support for multiple RocketPort cards in the same machine by includingthe RocketPort unit number in the name of the devices. This means thatunit 0 device names will change from ttyR0 .. ttyRf
Fix support for multiple RocketPort cards in the same machine by includingthe RocketPort unit number in the name of the devices. This means thatunit 0 device names will change from ttyR0 .. ttyRf to ttyR00 .. ttyR0f.Reviewed by: phk
we know it is called rpclose() so call it directly.
Eliminate two unused arguments to ttycreate().
- Use pci_get_device() and pci_get_vendor() when we only want one part of the device id.- Use BAR2 rather than BAR0 for the Rocketport UPCI 8O card. I suspect that other UPCI cards might need t
- Use pci_get_device() and pci_get_vendor() when we only want one part of the device id.- Use BAR2 rather than BAR0 for the Rocketport UPCI 8O card. I suspect that other UPCI cards might need to use BAR2 as well.Tested by: wsk at gddsn dot org dot cnMFC after: 1 week
Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY inpreference to some random negative number to allow other drivers abite at the apple.
Start each of the license/copyright comments with /*-, minor shuffle of lines
Use tty layer generic code instead of local copy.Device names {cua,tty}R%r[.init,.lock] clashes with pty(4) driverand allows for only 32 ports. This should probably be revisited.
1234