summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* - Updated firmware to latest 4.6.X release.davidch2009-03-043-13581/+13987
| | | | | | | | - Added missing firmware for 5709 A1 controllers. - Changed some debug statistic variable names to be more consistent. Submitted by: davidch MFC after: Two weeks
* For the moment disable the VIMAGE_CTASSERTs as people have troublebz2009-03-031-0/+4
| | | | | | | | | | | | | | while developing and compiling with kernel options that change the size of at least one structure. The current kernel build framework does not allow us to pass -Dxxx to module builds so we would possibly need a kernel option to disable the checks and that might not work for people just building modules alone. For now they helped to identify possibly API problems and bring those back into minds of developers seeking for better solutions. Problems reported by: kib, warner Reviewed by: warner
* make loop clearer that it isn't a mistake...imp2009-03-031-1/+2
|
* Add in parsing of the disk FUNCE tuples.imp2009-03-033-16/+27
|
* The callback takes a void *, not a caddr_t * (sic).imp2009-03-031-2/+2
| | | | Except for the bb callback, which takes a caddr_t and not a caddr_t *.
* Bump down the inline limit on MIPS.imp2009-03-031-1/+1
|
* Make Netgraph compile with Clang.ed2009-03-033-14/+12
| | | | | | | | | | | | | | | | Clang disallows structs with variable length arrays to be nested inside other structs, because this is in violation with ISO C99. Even though we can keep bugging the LLVM folks about this issue, we'd better just fix our code to not do this. This code seems to be the only code in the entire source tree that does this. I haven't tested this patch by using the kernel modules in question, but Diane Bruce and I have compared disassembled versions of these kernel modules. We would have expected them to be exactly the same, but due to randomness in the register allocator and reordering of instructions, there were some minor differences. Approved by: julian
* Adding missing ";"'s required by some SDT_PROBE_DEFINEx() macros.rwatson2009-03-031-10/+10
| | | | MFC after: 1 week
* as suggested by jhb@, panic in case the ncpus == 0.dchagin2009-03-031-1/+1
| | | | | | | it helps to catch bugs in the callers. Approved by: kib (mentor) MFC after: 5 days
* Reduce the verbosity of SDT trace points for DTrace by defining severalrwatson2009-03-033-18/+41
| | | | | | | | | | | wrapper macros that allow trace points and arguments to be declared using a single macro rather than several. This means a lot less repetition and vertical space for each trace point. Use these macros when defining privilege and MAC Framework trace points. Reviewed by: jb MFC after: 1 week
* Further refine the handling of resources for BARs in the PCI bus driver.jhb2009-03-032-82/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A while back, Warner changed the PCI bus code to reserve resources when enumerating devices and simply give devices the previously allocated resources when they call bus_alloc_resource(). This ensures that address ranges being decoded by a BAR are always allocated in the nexus0 device (or whatever device the PCI bus gets its address space from) even if a device driver is not attached to the device. This patch extends this behavior further: - To let the PCI bus distinguish between a resource being allocated by a device driver vs. merely being allocated by the bus, use rman_set_device() to assign the device to the bus when it is owned by the bus and to the child device when it is allocated by the child device's driver. We can now prevent a device driver from allocating the same device twice. Doing so could result in odd things like allocating duplicate virtual memory to map the resource on some archs and leaking the original mapping. - When a PCI device driver releases a resource, don't pass the request all the way up the tree and release it in the nexus (or similar device) since the BAR is still active and decoding. Otherwise, another device could later allocate the same range even though it is still in use. Instead, deactivate the resource and assign it back to the PCI bus using rman_set_device(). - pci_delete_resource() will actually completely free a BAR including attemping to disable it. - Disable BAR decoding via the command register when sizing a BAR in pci_alloc_map() which is used to allocate resources for a BAR when the BIOS/firmware did not assign a usable resource range during boot. This mirrors an earlier fix to pci_add_map() which is used when to size BARs during boot. - Move the activation of I/O decoding in the PCI command register into pci_activate_resource() instead of doing it in pci_alloc_resource(). Previously we could actually enable decoding before a BAR was initialized via pci_alloc_map(). Glanced at by: bsdimp
* ichwd: correct range check for timeout valueavg2009-03-031-2/+2
| | | | Approved by: jhb (mentor)
* Start removing IPv6 Type 0 Routing header code.bz2009-03-033-168/+26
| | | | | | | | | | RH0 was deprecated by RFC 5095. While most of the code had been disabled by #if 0 already, leave a bit of infrastructure for possible RH2 code and a log message under BURN_BRIDGES in case a user still tries to send RH0 packets. Reviewed by: gnn (a bit back, earlier version)
* udf_readdir: do not advance offset if entry can not be uio-edavg2009-03-031-1/+1
| | | | | | | | | | Previosly readdir missed some directory entries because there was no space for them in current uio but directory stream offset was advanced nevertheless. jhb has discoved the issue and provided a test-case. Reviewed by: bde Approved by: jhb (mentor)
* Set PortMultiplier port only for SATA2 channels, where it is applicable.mav2009-03-031-2/+5
| | | | | | | Doing it on old SATA controllers like Promise PDC20375 SATA150 breaks their operation. Tested by: marcus on PDC20375
* Extend the "vfsopt" mount options for more general use. Make structjamie2009-03-024-83/+145
| | | | | | | | | | | | | | | | vfsopt and the vfs_buildopts function public, and add some new fields to struct vfsopt (pos and seen), and new functions vfs_getopt_pos and vfs_opterror. Further extend the interface to allow reading options from the kernel in addition to sending them to the kernel, with vfs_setopt and related functions. While this allows the "name=value" option interface to be used for more than just FS mounts (planned use is for jails), it retains the current "vfsopt" name and <sys/mount.h> requirement. Approved by: bz (mentor)
* curr_time is a 64 bit variable so SYSCTL_LONG is not appropriateluigi2009-03-021-0/+2
| | | | | | | | as a handler. The variable was exported only for debugging, but there is little reason to do it now that the timekeeping is supported by various other variables. For the time being just comment out the sysctl, but I think this should go away.
* fw_debug has been unused for ages, so remove it from the listluigi2009-03-022-5/+1
| | | | | | | | | | of sysctl_variables. I would also remove it from the VNET record but I am unsure if there is any ABI issue -- so for the time being just mark it as unused in ip_fw.h, and then we will collect the garbage at some appropriate time in the future. MFC after: 3 days
* Change vfs_busy to wait until an outcome of pending unmountkan2009-03-021-5/+13
| | | | | | | | | | | | operation is known and to retry or fail accordingly to that outcome. This fixes the problem with namespace traversing programs failing with random ENOENT errors if someone just happened to try to unmount that same filesystem at the same time. Reported by: dhw Reviewed by: kib, attilio Sponsored by: Juniper Networks, Inc.
* Switch the default buffer mode in bpf(4) to zero-copy buffers.csjp2009-03-021-1/+1
| | | | Discussed with: rwatson
* Disable INTx when enabling MSI/MSIXrnoland2009-03-022-0/+5
| | | | | | | | | | | | | | | This addresses interrupt storms that were noticed after enabling MSI in drm. I think this is due to a loose interpretation of the PCI 2.3 spec, which states that a function using MSI is prohibitted from using INTx. It appears that some vendors interpretted that to mean that they should handle it in hardware, while others felt it was the drivers responsibility. This fix will also likely resolve interrupt storm related issues with devices other than drm. Reviewed by: jhb@ MFC after: 3 days
* Correct types of variables used to track amount of allocated SysV sharedkib2009-03-022-7/+12
| | | | | | | | | | | | | | memory from int to size_t. Implement a workaround for current ABI not allowing to properly save size for and report more then 2Gb sized segment of shared memory. This makes it possible to use > 2 Gb shared memory segments on 64bit architectures. Please note the new BUGS section in shmctl(2) and UPDATING note for limitations of this temporal solution. Reviewed by: csjp Tested by: Nikolay Dzham <i levsha org ua> MFC after: 2 weeks
* Use the p_sysent->sv_flags flag SV_ILP32 to detect 32bit processkib2009-03-025-22/+16
| | | | | | executing on 64bit kernel. This eliminates the direct comparisions of p_sysent with &ia32_freebsd_sysvec, that were left intact after r185169.
* Some Apple I2C buses give the device's I2C address in a property with thenwhitehorn2009-03-021-2/+9
| | | | | | | | name i2c-address instead of reg. Change the OFW I2C probe to check both locations for the address. Submitted by: Marco Trillo Reported by: Justin Hibbits
* Merge OpenBSM 1.1 beta 1 from OpenBSM vendor branch to head, bothrwatson2009-03-024-28/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | contrib/openbsm (svn merge) and src/sys/{bsm,security/audit} (manual merge). OpenBSM history for imported revision below for reference. MFC after: 1 month Sponsored by: Apple, Inc. Obtained from: TrustedBSD Project OpenBSM 1.1 beta 1 - The filesz parameter in audit_control(5) now accepts suffixes: 'B' for Bytes, 'K' for Kilobytes, 'M' for Megabytes, and 'G' for Gigabytes. For legacy support no suffix defaults to bytes. - Audit trail log expiration support added. It is configured in audit_control(5) with the expire-after parameter. If there is no expire-after parameter in audit_control(5), the default, then the audit trail files are not expired and removed. See audit_control(5) for more information. - Change defaults in audit_control: warn at 5% rather than 20% free for audit partitions, rotate automatically at 2mb, and set the default policy to cnt,argv rather than cnt so that execve(2) arguments are captured if AUE_EXECVE events are audited. These may provide more usable defaults for many users. - Use au_domain_to_bsm(3) and au_socket_type_to_bsm(3) to convert au_to_socket_ex(3) arguments to BSM format. - Fix error encoding AUT_IPC_PERM tokens.
* Bump __FreeBSD_version for the ushub to uhub rename.thompsa2009-03-021-1/+1
| | | | Requested by: marcus
* Rename the ushub device class back to uhub as it was in the old usb stack,thompsa2009-03-0243-45/+45
| | | | | | moused(8) looks for "uhub/ums" to decide if needs to load the module. Reported by: Garrett Cooper
* Move the serial drivers from Giant to using their own mutexs.thompsa2009-03-0218-65/+119
| | | | Tested with: u3g, ubser, uplcom
* Give controller a chance to issue Soft Reset clear command before checkingmav2009-03-011-2/+1
| | | | | | | | | | | ready status. Most of controllers managed to issue coommand and set BUSY bit almost simultaneously, before we will read it, but at least JMicron JMB363 don't. Ignore timeout errors to keep old behavior when error there was impossible. For me this fixes timeout errors on the first command after channel attach or reinit. Boot in my case is not affected, as there is much time passing between reset and next command giving reset time to complete.
* Hide __restrict from lint, just like we do with other keywords.ed2009-03-011-1/+1
| | | | | | | | | Unlike GCC, LLVM defines __STDC_VERSION__ to 199901L by default. This means `restrict' keywords in files end up being given to lint, which results in errors during compilation of usr.bin/xlint. Other keywords are also expanded to nothing when using lint, so do the same with restrict.
* Comment out enabling FIS Based Switching inside ata_ahci_issue_cmd() as itmav2009-03-011-1/+1
| | | | | | | | done in other places. Until we have no support for command queueing we have no any benefit from FBS, while enabling it only here somehow leads to "port not ready" errors on Intel 63XXESB2 controller. Tested by: Larry Rosenman <ler AT lerctr.org>
* Fix range-check error introduced in r182292. Also do not do anythingdchagin2009-03-011-1/+3
| | | | | | | if all processors in the map are not available, simply return. Approved by: kib (mentor) MFC after: 1 week
* Do a bit of struct ifnet cleanup in preparation for 8.0: group functionrwatson2009-03-011-7/+12
| | | | | | | | | | | pointers together, move padding to the bottom of the structure, and add two new integer spares due to attrition over time. Remove unused spare "flags" field, we can use one of the spare ints if we need it later. This change requires a rebuild of device driver modules that depend on the layout of ifnet for binary compatibility reasons. Discussed with: kmacy
* Add size-guards evaluated at compile-time to the main struct vnet_*bz2009-03-014-0/+12
| | | | | | | | | | which are not in a module of their own like gif. Single kernel compiles and universe will fail if the size of the struct changes. Th expected values are given in sys/vimage.h. See the comments where how to handle this. Requested by: peter
* Add the infrastructure and expected sizeof() values for each supportedbz2009-03-011-0/+99
| | | | | | | | | | | | | architecture to implement size-guards on the vimage vnet_* structures. As CTASSERT_EQUAL() needs special compile time options we back it by CTASSERT() in the default case. Unfortunately CTASSERT() triggers first, thus add an option to allow compilation with CTASSERT_EQUAL() only. See the comments how to get new values if you trigger the assert and what to do in that case. Reviewed by: rwatson, zec (earlier versions)
* Improve my previous changes to the TTY code: also remove memcpy().ed2009-03-012-6/+6
| | | | | | | | It's better to just use internal language constructs, because it is likely the compiler has a better opinion on whether to perform inlining, which is very likely to happen to struct winsize. Submitted by: Christoph Mallon <christoph mallon gmx de>
* Add the new compile-time assertion macro CTASSERT_EQUAL().bz2009-03-011-0/+24
| | | | | | | | | | | | | | | | | | | | | It takes a positive integer constant (the expected value) and another positive integer, usually compile-time evaluated, e.g. CTASSERT_EQUAL(FOO_EXPECTED_SIZE, sizeof (struct foo)); While the classic CTASSERT() gives: error: size of array '__assert60' is negative this gives you: In function '__ctassert_equal_at_line_60': warning: '__expected_42_but_got[464ul]' is used uninitialized in this function and you can directly see the difference in the expected and the real value. CTASSERT_EQUAL() needs special compile time options to trigger thus keep it locally to this header. If it proves to be of general interest it can be moved to systm.h. Submitted by: jmallett Reviewed by: sam, warner, rwatson, jmallett (earlier versions)
* Fix a typo in the previous commit.das2009-03-011-1/+1
| | | | Submitted by: Mel <mel@rachie.is-a-geek.net>
* In sys/tree.h:bms2009-03-011-1/+16
| | | | | | | | | | | | | | | | * Add RB_FOREACH_FROM() which continues traversal *at* the y-node provided. There is no pre-increment. * Nuke RB_FOREACH_SAFE as it was buggy; it would omit the final node. * Replace RB_FOREACH_SAFE() with a working implementation derived from RB_FOREACH_FROM(). The key observation is that we now only check the loop-control variable, but still cache the next member pointer. * Add RB_FOREACH_REVERSE_FROM() which continues backwards traversal *at* the y-node provided. There is no pre-increment. Typically this is used to back out of allocations made whilst walking an RB-tree. * Add RB_FOREACH_REVERSE_SAFE() which performs insertion and deletion safe backwards traversal.
* Remove unreachable code for generating RST segments from tcp_twcheck();rwatson2009-02-281-45/+0
| | | | | | | this code became stale when T/TCP support was removed. Discussed with: bz, sam MFC after: 1 month
* Revert my ata_identify()/ata_reinit() related changes: r189166, r189091mav2009-02-289-120/+69
| | | | | | | | | | | | | | and partially r188903. Revert breaks new drives detection on reinit to the state as it was before me, but fixes series of new bugs reported by some people. Unconditional queueing of ata_completed() calls can lead to deadlock if due to timeout ata_reinit() was called at the same thread by previous ata_completed(). Calling of ata_identify() on ata_reinit() in current implementation opens numerous races and deadlocks. Problems I was touching here are still exist and should be addresed, but probably in different way.
* Move the NORELEASE check to after the recurse count decrement and bailout, thisthompsa2009-02-281-6/+6
| | | | is not counted as actually releasing the lock.
* A couple of style nits in the last committhompsa2009-02-282-9/+6
| | | | | - unwrap short lines - move variable initialisation out of the declaration.
* - Remove the usb interface number from the device nodes as it is not needed.thompsa2009-02-284-89/+55
| | | | | | | - Do not recreate the device nodes in set_alt_interface as the endpoints do not change. Submitted by: Hans Petter Selasky
* Add memmove() to the kernel, making the kernel compile with Clang.ed2009-02-2817-18/+47
| | | | | | | | | | | | When copying big structures, LLVM generates calls to memmove(), because it may not be able to figure out whether structures overlap. This caused linker errors to occur. memmove() is now implemented using bcopy(). Ideally it would be the other way around, but that can be solved in the future. On ARM we don't do add anything, because it already has memmove(). Discussed on: arch@ Reviewed by: rdivacky
* Replace bcopy() calls inside the TTY layer with memcpy()/strlcpy().ed2009-02-283-9/+9
| | | | | In all these cases the buffers never overlap. Program names are also likely to be shorter, so use a regular strlcpy() to copy p_comm.
* Rework device probing by moving ata_getparam() call from ata_identify() tomav2009-02-287-51/+109
| | | | | | | | | | | drivers' probe routines. It allows not to sleep and so not drop Giant inside ata_identify() critical section and so avoid crash if it reentered on request timeout. Reentering of probe call checked inside of it. Give device own knowledge about it's type (ata/atapi/atapicam). It is not a good idea to ask channel status for device type inside ata_getparam(). Add softc memory deallocation on device destruction.
* Remove PRIV_ROOT -- all system privileges must now be explicitly namedrwatson2009-02-281-7/+2
| | | | | | in support of forthcoming work on a fine-grained privilege mechanism. Facilitated by: bz, thompsa, rink
* Add missing POSIX 1003.1-2008 open(2) flag; O_TTY_INIT.ed2009-02-281-0/+5
| | | | | | | On FreeBSD, this is the default behaviour. According to the spec, we may give this flag a value of zero, but I'd rather not do this. If we define it to a non-zero value, we can always change default behaviour without changing the ABI. This is very unlikely to happen, though.
* - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),das2009-02-281-1/+1
| | | | | | | | | | | | wcscasecmp(), and wcsncasecmp(). - Make some previously non-standard extensions visible if POSIX_VISIBLE >= 200809. - Use restrict qualifiers in stpcpy(). - Declare off_t and size_t in stdio.h. - Bump __FreeBSD_version in case the new symbols (particularly getline()) cause issues with ports. Reviewed by: standards@
OpenPOWER on IntegriCloud