aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* New internal archive_string_concat utility function.Tim Kientzle2008-12-062-0/+18
| | | | Notes: svn path=/head/; revision=185667
* Minor portability: Declare 'r' only within the conditionalTim Kientzle2008-12-061-2/+2
| | | | | | | block where it's used; S_ISLNK is more portable than S_ISLINK. Notes: svn path=/head/; revision=185666
* Windows build now uses PLATFORM_CONFIG_H macro, so we can eliminate theTim Kientzle2008-12-061-4/+1
| | | | | | | special case for it. Notes: svn path=/head/; revision=185665
* 2 is more portable than STDERR_FILENOTim Kientzle2008-12-061-1/+1
| | | | Notes: svn path=/head/; revision=185664
* Bug fix to support N310 version of Chelsio cards (board ID 1088).George V. Neville-Neil2008-12-062-3/+12
| | | | | | | | Obtained from: Chelsio Inc. MFC after: 3 days Notes: svn path=/head/; revision=185662
* Forget current bus power settings on full reset. Chip must be reconfigured.Alexander Motin2008-12-061-3/+8
| | | | | | | | Do not issue command if there is no card, clock or power. Controller will not detect command timeout without clock active. Notes: svn path=/head/; revision=185661
* Correct a typo.Jens Schweikhardt2008-12-051-1/+1
| | | | Notes: svn path=/head/; revision=185656
* Re submit code to print the part and serial number for Chelsio cards.George V. Neville-Neil2008-12-051-0/+7
| | | | | | | | | The original code was accidentally removed in another commit. MFC after: 1 day Notes: svn path=/head/; revision=185655
* Add simple locking for the in-kernel iconv code. Translation operationsJohn Baldwin2008-12-051-5/+27
| | | | | | | | | | | | | do not need any locking. Opening and closing translators is serialized using an sx lock. Note: This depends on the earlier fix to kern_module.c to properly order MOD_UNLOAD events. MFC after: 2 months Notes: svn path=/head/; revision=185652
* Unconditionally use locked addition of zero to tip of the stack forKonstantin Belousov2008-12-051-14/+3
| | | | | | | | | | | | | | memory barriers on i386. It works as a serialization instruction on all IA32 CPUs. Alternative solution of using {s,l,}fence requires run-time checking of the presense of the corresponding SSE or SSE2 extensions, and possible boot-time patching of the kernel text. Suggested by: many Notes: svn path=/head/; revision=185651
* Several threads in a process may do vfork() simultaneously. Then, allKonstantin Belousov2008-12-055-2/+7
| | | | | | | | | | | | | | | | | | | | | | parent threads sleep on the parent' struct proc until corresponding child releases the vmspace. Each sleep is interlocked with proc mutex of the child, that triggers assertion in the sleepq_add(). The assertion requires that at any time, all simultaneous sleepers for the channel use the same interlock. Silent the assertion by using conditional variable allocated in the child. Broadcast the variable event on exec() and exit(). Since struct proc * sleep wait channel is overloaded for several unrelated events, I was unable to remove wakeups from the places where cv_broadcast() is added, except exec(). Reported and tested by: ganbold Suggested and reviewed by: jhb MFC after: 2 week Notes: svn path=/head/; revision=185647
* Some libstand/bootp.c extension (written by Danny Braniss, slightlyLuigi Rizzo2008-12-051-0/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | revised/modified by me) to store dhcp options into kenv variables, so the information is available to the boot loader and can be used to customize the boot process. The change is totally unintrusive, essentially made of a single function to be called while parsing a dhcp response, and a couple of tables to classify options. The values extracted from dhcp options are stored in the kenv environment in one of these forms: + options whose name and type is known are saved as dhcp.name = value (string, or number/ip addresses lists) + unknown options are assumed to be strings and saved as dhcp.option-NNN = "value" + options listed as '__INDIR' and sent on the wire as e.g. option unknown-252 "some.name=the actual value" are saved as some.name = "the actual value" + options listed as '__ILIST' and sent on the wire as e.g. option unknown-249 "a.b=foo bar; c.d= 123; e.f=done" are saved as multiple values a.b="foo bar" c.d="123" e.f="done" As you can see there is quite a bit of flexibility on what can be passed to the loader or the kernel. For the time being the vendor-specific table is mostly disabled, because there is no standard set of options for FreeBSD, and I don't know all the pxe-specific vendor options. Also, applications using libstand may live in memory-constrained environments, so it makes sense to keep these tables as small as possible, especially considering that one can generate arbitrary name=value pairs using site-specific options of type __INDIR or __ILIST (there are 4 __ILIST and 5 __INDIR in the table, numbered 246..249 and 250..254). Actually, considering that probably 75% of the standard dhcp options are totally useless, it might make sense to remove them as well. Submitted by: Danny Braniss MFC after: 4 weeks Notes: svn path=/head/; revision=185643
* When the SYSINIT() to load a module invokes the MOD_LOAD event successfully,John Baldwin2008-12-051-0/+15
| | | | | | | | | | | | | | | | move that module to the head of the associated linker file's list of modules. The end result is that once all the modules are loaded, they are sorted in the reverse of their load order. This causes the kernel linker to invoke the MOD_QUIESCE and MOD_UNLOAD events in the reverse of the order that MOD_LOAD was invoked. This means that the ordering of MOD_LOAD events that is set by the SI_* paramters to DECLARE_MODULE() are now honored in the same order they would be for SYSUNINIT() for the MOD_QUIESCE and MOD_UNLOAD events. MFC after: 1 month Notes: svn path=/head/; revision=185642
* Add an easier example.Pawel Jakub Dawidek2008-12-051-1/+16
| | | | | | | Reviewed by: trasz Notes: svn path=/head/; revision=185641
* Avoid confusion and adjust link address range of Marvell Orion kernel so it isRafal Jaworowski2008-12-051-4/+4
| | | | | | | the same as for Kirkwood and Discovery. Notes: svn path=/head/; revision=185640
* Fix configuration of the PCI bridge. This got omitted in the initial import ofRafal Jaworowski2008-12-051-0/+4
| | | | | | | this code. Notes: svn path=/head/; revision=185639
* In a case of CARP status change run through the if_link_state_change()Gleb Smirnoff2008-12-051-4/+5
| | | | | | | routine, so that devd(8) and others are notified about link state change. Notes: svn path=/head/; revision=185636
* - Invoke MOD_QUIESCE on all modules in a linker file (kld) beforeJohn Baldwin2008-12-053-10/+50
| | | | | | | | | | | | | | | | | unloading any modules. As a result, if any module veto's an unload request via MOD_QUIESCE, the entire set of modules for that linker file will remain loaded and active now rather than leaving the kld in a weird state where some modules are loaded and some are unloaded. - This also moves the logic for handling the "forced" unload flag out of kern_module.c and into kern_linker.c which is a bit cleaner. - Add a module_name() routine that returns the name of a module and use that instead of printing pointer values in debug messages when a module fails MOD_QUIESCE or MOD_UNLOAD. MFC after: 1 month Notes: svn path=/head/; revision=185635
* Improve db_backtrace() for compat ia32 on amd64. 32bit image entersKonstantin Belousov2008-12-051-0/+6
| | | | | | | | | | the kernel via Xint0x80_syscall(). Submitted by: dchagin MFC after: 1 week Notes: svn path=/head/; revision=185634
* Move to using filter for the change interrupts. Also rework the powerWarner Losh2008-12-053-37/+24
| | | | | | | | | interrupt code to be more robust. I've been running these changes for over a year... With these changes, I don't see the ath card going into reset like the code in the tree. Notes: svn path=/head/; revision=185625
* Minor style nit.Warner Losh2008-12-051-2/+2
| | | | Notes: svn path=/head/; revision=185624
* Augment comments, and move things around a smidge.Warner Losh2008-12-051-17/+17
| | | | Notes: svn path=/head/; revision=185623
* Implement a method described in NetBSD PR 36652 for coping with theWarner Losh2008-12-051-1/+12
| | | | | | | BAD VCC bit. Notes: svn path=/head/; revision=185622
* Fix a bug with the ael1006 PHY. The bug shows up as persistent but incompleteGeorge V. Neville-Neil2008-12-041-0/+10
| | | | | | | | | | | packet loss, of between 10-30%. The fix is to put the PHY into and take it out of local loopback mode when resetting the interface. Obtained from: Chelsio Inc. MFC after: 3 days Notes: svn path=/head/; revision=185620
* Put the MIPS support back in after it was removed in r185029.Warner Losh2008-12-041-0/+43
| | | | Notes: svn path=/head/; revision=185614
* Integrate 185578 from dfrKip Macy2008-12-0416-1343/+754
| | | | | | | Use newbus to managed devices Notes: svn path=/head/; revision=185605
* fix initialization for case of normal kernbaseKip Macy2008-12-041-215/+33
| | | | | | | remove unused shutdown code Notes: svn path=/head/; revision=185604
* Add HW MAC counter support for newer JMC250/JMC260 revisions.Pyun YongHyeon2008-12-043-24/+197
| | | | Notes: svn path=/head/; revision=185597
* Add support for newer JMC250/JMC260 revisions.Pyun YongHyeon2008-12-043-22/+76
| | | | | | | | | | | | | | | | | | | | | | | | | o Chip full mask revision 2 or later controllers have to set correct Tx MAC and Tx offload clock depending on negotiated link speed. o JMC260 chip full mask revision 2 has a silicon bug that can't handle 64bit DMA addressing. Add workaround to the bug by limiting DMA address space to be within 32bit. o Valid FIFO space of receive control and status register was changed on chip full mask revision 2 or later controllers. For these controllers, use default 16QW as it's supposed to be the safest value for maximum PCIe compatibility. JMicron confirmed performance will not be reduced even if the FIFO space is set to 16QW. o When interface is put into suspend/shutdown state, remove Tx MAC and Tx offload clock to save more power. We don't need Tx clock at all in this state. o Added new register definition for chip full mask revision 2 or later controllers. Thanks to JMicron for their continuous support of FreeBSD. Notes: svn path=/head/; revision=185596
* Fix build - cast off_t to (intmax_t) for printing.Max Laier2008-12-031-2/+3
| | | | Notes: svn path=/head/; revision=185594
* Don't attempt to clear status updates if we did not do a link stateXin LI2008-12-031-5/+6
| | | | | | | | | | | change. As a side effect, this makes the excessive interrupts to disappear which has been observed as a regression in recent stable/7. Reported by: many (on -stable@) Reviewed by: davidch Notes: svn path=/head/; revision=185593
* When unloading a 32-bit system call module, restore the sysent vector inJohn Baldwin2008-12-031-1/+1
| | | | | | | the 32-bit system call table instead of the main system call table. Notes: svn path=/head/; revision=185589
* Enable operation of newfs on plain files, which is useful when youLuigi Rizzo2008-12-035-16/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | want to prepare disk images for emulators (though 'makefs' in port can do something similar). This relies on: + minor changes to pass the consistency checks even when working on a file; + an additional option, '-p partition' , to specify the disk partition to initialize; + some changes on the I/O routines to deal with partition offsets. The latter was a bit tricky to implement, see the details in newfs.h: in newfs, I/O is done through libufs which assumes that the file descriptor refers to the whole partition. Introducing support for the offset in libufs would require a non-backward compatible change in the library, to be dealt with a version bump or with symbol versioning. I felt both approaches to be overkill for this specific application, especially because there might be other changes to libufs that might become necessary in the near future. So I used the following trick: - read access is always done by calling bread() directly, so we just add the offset in the (few) places that call bread(); - write access is done through bwrite() and sbwrite(), which in turn calls bwrite(). To avoid rewriting sbwrite(), we supply our own version of bwrite() here, which takes precedence over the version in libufs. MFC after: 4 weeks Notes: svn path=/head/; revision=185588
* Some useful operational extensions to newfs_msdos, especiallyLuigi Rizzo2008-12-032-16/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | when preparing images for emulators or flash devices: + option '-C size' to create the underlying image file with given size. Saves doing a 'dd' before, and especially it creates a sparse file + option '-@ offset' to build the FAT image at the specified offset in the image file or device; + make the cluster size adaptive on the filesystem size. Previously the default was 4k which is really unconvenient with large media; now it goes from 512 bytes to 32k depending on filesystem size (i still need to check whether it makes sense to go further up, to 64k or above); + fix default geometry when not specified on the command line, use 63 sectors/255 heads by default. Also trim the size so it exactly a multiple of a track, to avoid complaints in some filesystem code. + document all the above, plus some manual page clarifications. MFC after: 4 weeks Notes: svn path=/head/; revision=185587
* Change nfsserver slightly so that it does not trip over the timestampAlexander Kabaev2008-12-031-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | validation code on ZFS. Problem: when opening file with O_CREAT|O_EXCL NFS has to jump through extra hoops to ensure O_EXCL semantics. Namely, client supplies of 8 bytes (NFSX_V3CREATEVERF) bytes of verification data to uniquely identify this create request. Server then creates a new file with access mode 0, copies received 8 bytes into va_atime member of struct vattr and attempt to set the atime on file using VOP_SETATTR. If that succeeds, it fetches file attributes with VOP_GETATTR and verifies that atime timestamps match. If timestamps do not match, NFS server concludes it has probbaly lost the race to another process creating the file with the same name and bails with EEXIST. This scheme works OK when exported FS is FFS, but if underlying filesystem is ZFS _and_ server is running 64bit kernel, it breaks down due to sanity checking in zfs_setattr function, which refuses to accept any timestamps which have tv_sec that cannot be represented as 32bit int. Since struct timespec fields are 64 bit integers on 64bit platforms and server just copies NFSX_V3CREATEVERF bytes info va_atime, all eight bytes supplied by client end up in va_atime.tv_sec, forcing it out of valid 32bit range. The solution this change implements is simple: it treats NFSX_V3CREATEVERF as two 32bit integers and unpacks them separately into va_atime.tv_sec and va_atime.tv_nsec respectively, thus guaranteeing that tv_sec remains in 32 bit range and ZFS remains happy. Reviewed by: kib Notes: svn path=/head/; revision=185586
* Fixes for Core2 Extreme support.Joseph Koshy2008-12-033-4/+10
| | | | | | | Submitted by: "Artem Belevich" <artemb at gmail dot com> Notes: svn path=/head/; revision=185585
* Change new card identification names.Doug Ambrisko2008-12-031-4/+4
| | | | | | | | Submitted by: LSI MFC after: 3 days Notes: svn path=/head/; revision=185584
* Fix a credential reference leak. [1]Bjoern A. Zeeb2008-12-031-9/+16
| | | | | | | | | | | | | | | Close subtle but relatively unlikely race conditions when propagating the vnode write error to other active sessions tracing to the same vnode, without holding a reference on the vnode anymore. [2] PR: kern/126368 [1] Submitted by: rwatson [2] Reviewed by: kib, rwatson MFC after: 4 weeks Notes: svn path=/head/; revision=185583
* Add aliases that map architectural event names to fixed function counters.Joseph Koshy2008-12-031-0/+5
| | | | Notes: svn path=/head/; revision=185582
* Another, hopefully final set of changes to boot0 and boot0cfg.Luigi Rizzo2008-12-034-87/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | boot0.S changes: + import a patch from Christoph Mallon to rearrange the various print functions and save another couple of bytes; + implement the suggestion in PR 70531 to enable booting from any valid partition because even the extended partitions that were previously in our kill list may contain a valid boot loader. This simplifies the code and saves some bytes; + followwing up PR 127764, implement conditional code to preserve the 'Volume ID' which might be used by other OS (NT, XP, Vista) and is located at offset 0x1b8. This requires a relocation of the parameter block within the boot sector -- there is no other possible workaround. To address this, boot0cfg has been updated to handle both versions of the boot code; + slightly rearrange the strings printed in the menus to make the code buildable with all options. Given the tight memory budget, this means that with certain options we need to shrink or remove certain labels. and especially: make -DVOLUME_LABEL -DPXE the default options. This means that the newly built boot0 block will preserve the Volume ID, and has the (hidden) option F6 to boot from INT18/PXE. I think the extra functionality is well worth the change. The most visible difference here is that the 'Default: ' string now becomes 'Boot: ' (it can be reverted to the old value but then we need to nuke 1/2 partition name or entries to make up for the extra room). boot0cfg changes: + modify the code to recognise the new boot0 structure (with the relocated options block to make room for the Volume id). + add two options, '-i xxxx-xxxx' to set the volume ID, -e c to modify the character printed in case of bad input PR: 127764 70531 Submitted by: Christoph Mallon (portions) MFC after: 4 weeks Notes: svn path=/head/; revision=185579
* AR8113 also need to set DMA read burst value. This should fixPyun YongHyeon2008-12-031-4/+2
| | | | | | | | | occasional DMA read error seen on AR8113. Submitted by: Jie Yang < Jie.Yang <> Atheros com > Notes: svn path=/head/; revision=185577
* Add some PHY magic to enable PHY hibernation and 1000baseT/10baseTPyun YongHyeon2008-12-031-0/+33
| | | | | | | | | | power adjustment. This change is required to guarantee correct operation on certain switches. Submitted by: Jie Yang < Jie.Yang <> Atheros com > Notes: svn path=/head/; revision=185576
* Update if_iqdrops instead of if_ierrors when m_devget(9) fails.Pyun YongHyeon2008-12-031-7/+4
| | | | Notes: svn path=/head/; revision=185575
* Update bce(4)'s hardware list to reflect the recent update to driver.Xin LI2008-12-031-3/+20
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=185574
* Merge OpenBSM 1.1 alpha 2 from the OpenBSM vendor branch to head, bothRobert Watson2008-12-02102-769/+4848
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | contrib/openbsm (svn merge) and sys/{bsm,security/audit} (manual merge). - Add OpenBSM contrib tree to include paths for audit(8) and auditd(8). - Merge support for new tokens, fixes to existing token generation to audit_bsm_token.c. - Synchronize bsm includes and definitions. OpenBSM history for imported revisions below for reference. MFC after: 1 month Sponsored by: Apple Inc. Obtained from: TrustedBSD Project -- OpenBSM 1.1 alpha 2 - Include files in OpenBSM are now broken out into two parts: library builds required solely for user space, and system includes, which may also be required for use in the kernels of systems integrating OpenBSM. Submitted by Stacey Son. - Configure option --with-native-includes allows forcing the use of native include for system includes, rather than the versions bundled with OpenBSM. This is intended specifically for platforms that ship OpenBSM, have adapted versions of the system includes in a kernel source tree, and will use the OpenBSM build infrastructure with an unmodified OpenBSM distribution, allowing the customized system includes to be used with the OpenBSM build. Submitted by Stacey Son. - Various strcpy()'s/strcat()'s have been changed to strlcpy()'s/strlcat()'s or asprintf(). Added compat/strlcpy.h for Linux. - Remove compatibility defines for old Darwin token constant names; now only BSM token names are provided and used. - Add support for extended header tokens, which contain space for information on the host generating the record. - Add support for setting extended host information in the kernel, which is used for setting host information in extended header tokens. The audit_control file now supports a "host" parameter which can be used by auditd to set the information; if not present, the kernel parameters won't be set and auditd uses unextended headers for records that it generates. OpenBSM 1.1 alpha 1 - Add option to auditreduce(1) which allows users to invert sense of matching, such that BSM records that do not match, are selected. - Fix bug in audit_write() where we commit an incomplete record in the event there is an error writing the subject token. This was submitted by Diego Giagio. - Build support for Mac OS X 10.5.1 submitted by Eric Hall. - Fix a bug which resulted in host XML attributes not being arguments so that const strings can be passed as arguments to tokens. This patch was submitted by Xin LI. - Modify the -m option so users can select more then one audit event. - For Mac OS X, added Mach IPC support for audit trigger messages. - Fixed a bug in getacna() which resulted in a locking problem on Mac OS X. - Added LOG_PERROR flag to openlog when -d option is used with auditd. - AUE events added for Mac OS X Leopard system calls. Notes: svn path=/head/; revision=185573
| * Vendor import of OpenBSM 1.1 alpha2, which incorporates the followingvendor/openbsm/1.1-ALPHA-2Robert Watson2008-11-13107-1046/+3293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes since the last imported OpenBSM release: OpenBSM 1.1 alpha 2 - Include files in OpenBSM are now broken out into two parts: library builds required solely for user space, and system includes, which may also be required for use in the kernels of systems integrating OpenBSM. Submitted by Stacey Son. - Configure option --with-native-includes allows forcing the use of native include for system includes, rather than the versions bundled with OpenBSM. This is intended specifically for platforms that ship OpenBSM, have adapted versions of the system includes in a kernel source tree, and will use the OpenBSM build infrastructure with an unmodified OpenBSM distribution, allowing the customized system includes to be used with the OpenBSM build. Submitted by Stacey Son. - Various strcpy()'s/strcat()'s have been changed to strlcpy()'s/strlcat()'s or asprintf(). Added compat/strlcpy.h for Linux. - Remove compatibility defines for old Darwin token constant names; now only BSM token names are provided and used. - Add support for extended header tokens, which contain space for information on the host generating the record. - Add support for setting extended host information in the kernel, which is used for setting host information in extended header tokens. The audit_control file now supports a "host" parameter which can be used by auditd to set the information; if not present, the kernel parameters won't be set and auditd uses unextended headers for records that it generates. OpenBSM 1.1 alpha 1 - Add option to auditreduce(1) which allows users to invert sense of matching, such that BSM records that do not match, are selected. - Fix bug in audit_write() where we commit an incomplete record in the event there is an error writing the subject token. This was submitted by Diego Giagio. - Build support for Mac OS X 10.5.1 submitted by Eric Hall. - Fix a bug which resulted in host XML attributes not beingguments so that const strings can be passed as arguments to tokens. This patch was submitted by Xin LI. - Modify the -m option so users can select more then one audit event. - For Mac OS X, added Mach IPC support for audit trigger messages. - Fixed a bug in getacna() which resulted in a locking problem on Mac OS X. - Added LOG_PERROR flag to openlog when -d option is used with auditd. - AUE events added for Mac OS X Leopard system calls. Obtained from: TrustedBSD Project Sponsored by: Apple Inc. Notes: svn path=/vendor/openbsm/dist/; revision=184902 svn path=/vendor/openbsm/1.1-ALPHA-2/; revision=184903; tag=vendor/openbsm/1.1-ALPHA-2
| * Disable keyword exansion in OpenBSM vendor branch.Robert Watson2008-11-120-0/+0
| | | | | | | | Notes: svn path=/vendor/openbsm/dist/; revision=184900
| * Flatten OpenBSM vendor tree in preparation for new OpenBSM vendorRobert Watson2008-11-12175-0/+0
| | | | | | | | | | | | | | import. Notes: svn path=/vendor/openbsm/dist/; revision=184899
* | Improve grammar.Christian Brueffer2008-12-021-1/+1
| | | | | | | | | | | | | | Submitted by: Ben Kaduk Notes: svn path=/head/; revision=185572
* | Rather than using hidden includes (with cicular dependencies),Bjoern A. Zeeb2008-12-02125-56/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | directly include only the header files needed. This reduces the unneeded spamming of various headers into lots of files. For now, this leaves us with very few modules including vnet.h and thus needing to depend on opt_route.h. Reviewed by: brooks, gnn, des, zec, imp Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=185571