]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoTests for wcscasecmp(), wcsnlen(), and stpncpy().
David Schultz [Sat, 28 Feb 2009 06:34:04 +0000 (06:34 +0000)]
Tests for wcscasecmp(), wcsnlen(), and stpncpy().

15 years agoMake `less -R' not crash all the time.
David Schultz [Sat, 28 Feb 2009 06:27:23 +0000 (06:27 +0000)]
Make `less -R' not crash all the time.

15 years agoReplace a dozen lines of code with a call to strnlen() / wcsnlen().
David Schultz [Sat, 28 Feb 2009 06:06:57 +0000 (06:06 +0000)]
Replace a dozen lines of code with a call to strnlen() / wcsnlen().

15 years agoAdd restrict qualifiers.
David Schultz [Sat, 28 Feb 2009 06:05:37 +0000 (06:05 +0000)]
Add restrict qualifiers.
I missed this file in my previous commit.

15 years ago- Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),
David Schultz [Sat, 28 Feb 2009 06:00:58 +0000 (06:00 +0000)]
- Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),
  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@

15 years agoDefine a macro for POSIX.1-2008 here until a future groff import
David Schultz [Sat, 28 Feb 2009 05:47:41 +0000 (05:47 +0000)]
Define a macro for POSIX.1-2008 here until a future groff import
includes one.

15 years agoAdd visibility constants for POSIX.1-2008.
David Schultz [Sat, 28 Feb 2009 05:24:05 +0000 (05:24 +0000)]
Add visibility constants for POSIX.1-2008.

15 years agoAdd restrict qualifiers to the parameters to strlcpy() and strlcat().
David Schultz [Sat, 28 Feb 2009 05:15:02 +0000 (05:15 +0000)]
Add restrict qualifiers to the parameters to strlcpy() and strlcat().
The annotation mainly just serves as a hint that they're not intended
for use with overlapping strings.

15 years agoMark memmem() __pure.
David Schultz [Sat, 28 Feb 2009 05:08:35 +0000 (05:08 +0000)]
Mark memmem() __pure.

15 years agoMake sure %zd treats negative arguments properly on 32-bit platforms.
David Schultz [Sat, 28 Feb 2009 04:58:18 +0000 (04:58 +0000)]
Make sure %zd treats negative arguments properly on 32-bit platforms.
Fix harmless but related bugs in %_$zd and %_$tu.

PR: 131880
MFC after: 1 week

15 years agoInitialize the vblank structures at load time. Previously we did this
Robert Noland [Sat, 28 Feb 2009 02:37:55 +0000 (02:37 +0000)]
Initialize the vblank structures at load time.  Previously we did this
at irq install/uninstall time, but when we vt switch, we uninstall the
irq handler.  When the irq handler is reinstalled, the modeset ioctl
happens first.  The modeset ioctl is supposed to tell us that we can
disable vblank interrupts if there are no active consumers.  This will
fail after a vt switch until another modeset ioctl is called via dpms
or xrandr.  Leading to cases where either interrupts are on and can't
be disabled, or worse, no interrupts at all.

MFC after: 2 weeks

15 years agoAdd a tuneable to allow disabling msi on drm at runtime.
Robert Noland [Fri, 27 Feb 2009 23:50:55 +0000 (23:50 +0000)]
Add a tuneable to allow disabling msi on drm at runtime.

Suggested by: jhb@

MFC after: 2 weeks

15 years agoCopy/paste bug fix for previos commit.
Alexander Motin [Fri, 27 Feb 2009 23:49:26 +0000 (23:49 +0000)]
Copy/paste bug fix for previos commit.

15 years agoMove to new usb stack that puts the front-end bus attachments with the
Warner Losh [Fri, 27 Feb 2009 23:12:28 +0000 (23:12 +0000)]
Move to new usb stack that puts the front-end bus attachments with the
usb stack rather than with the rest of the processor support code.
Not sure that's a good idea, as we were moving away from it, but this
fixes the build in the mean time so we can have that discussion.

15 years agoChange the last references to PRIV_ROOT. /dev/usb used to be world writable so
Andrew Thompson [Fri, 27 Feb 2009 22:12:15 +0000 (22:12 +0000)]
Change the last references to PRIV_ROOT. /dev/usb used to be world writable so
further root checks were needed, this isnt the case anymore but just change it
to PRIV_DRIVER until it can be investigated later.

Spotted by: rwatson

15 years agoRemove ic_update_mcast calls that are not implemented.
Andrew Thompson [Fri, 27 Feb 2009 21:50:15 +0000 (21:50 +0000)]
Remove ic_update_mcast calls that are not implemented.

Spotted by: sam
Pointy hat: me

15 years agoPartial sync to //depot/projects/usb
Andrew Thompson [Fri, 27 Feb 2009 21:14:29 +0000 (21:14 +0000)]
Partial sync to //depot/projects/usb

- Reissue the ctrl request on failure
- Ensure Tx and ctrl requests are not interleaved
- Add promisc callbacks

Obtained from: Hans Petter Selasky

15 years agoFix the add stream feature of strm-reset to really work:
Randall Stewart [Fri, 27 Feb 2009 20:54:45 +0000 (20:54 +0000)]
Fix the add stream feature of strm-reset to really work:
 - Fix the copy, we can't do a blind copy but must transfer
   the data from the old to the new.
 - Fix the ACK processing so we properly stop retransmitting
   the thing.
 - Fix it so if we get a retran we will properly reply with
   the saved response without doing anything.

MFC after: 1 month

15 years ago- Hold a reference on the cdev a filesystem is mounted from in the mount.
John Baldwin [Fri, 27 Feb 2009 20:00:15 +0000 (20:00 +0000)]
- Hold a reference on the cdev a filesystem is mounted from in the mount.
- Remove the cdev pointers from the denode and instead use the mountpoint's
  reference to call dev2udev() in getattr().

Reviewed by: kib, julian

15 years agoMerge rev. 188615, 188812 changes from old-USB to USB2 driver.
Alexander Motin [Fri, 27 Feb 2009 19:27:33 +0000 (19:27 +0000)]
Merge rev. 188615, 188812 changes from old-USB to USB2 driver.

15 years agoreally enable usb1
Sam Leffler [Fri, 27 Feb 2009 19:26:23 +0000 (19:26 +0000)]
really enable usb1

15 years ago- Update copyright to 2009.
David Christensen [Fri, 27 Feb 2009 19:25:06 +0000 (19:25 +0000)]
- Update copyright to 2009.
- Only enable split header operation when ZERO_COPY_SOCKETS is enabled in
  the kernel.

Submitted by: davidch
MFC after: 1 week

15 years agoo enable PREEMPTION
Sam Leffler [Fri, 27 Feb 2009 19:23:55 +0000 (19:23 +0000)]
o enable PREEMPTION
o turn off a bunch of stuff that's unlikely to be used
o add flash support
o use mii instead of miibus to save space
o enable tdma support
o configure legacy usb as usb2 works only on 2348 w/ 64M configs

15 years agoo add -HEAD to avoid build conflicts
Sam Leffler [Fri, 27 Feb 2009 19:21:35 +0000 (19:21 +0000)]
o add -HEAD to avoid build conflicts
o switch to a more common flash config

15 years agoadd -HEAD to avoid build conflicts
Sam Leffler [Fri, 27 Feb 2009 19:20:57 +0000 (19:20 +0000)]
add -HEAD to avoid build conflicts

15 years agoMake a note about USB /dev changes.
Andrew Thompson [Fri, 27 Feb 2009 17:32:49 +0000 (17:32 +0000)]
Make a note about USB /dev changes.

15 years agonewfs_msdos: allow to work with media that doesn't have any CHS params
Andriy Gapon [Fri, 27 Feb 2009 17:29:48 +0000 (17:29 +0000)]
newfs_msdos: allow to work with media that doesn't have any CHS params

Either use parameters provided by user or make them up.
The code for faking CHS params is borrowed from disklabel code.
The logic for using user-provided and auto-guessed parameters is not
perfect, so to speak.

PR: bin/121182
Approved by: jhb (mentor)

15 years agoudf_readatoffset: return correct size and data pointer for data in fentry
Andriy Gapon [Fri, 27 Feb 2009 17:29:31 +0000 (17:29 +0000)]
udf_readatoffset: return correct size and data pointer for data in fentry

This should help correct reading of directories with data located
in fentry.

Submitted by: bde
Approved by: jhb (mentor)

15 years agoChange USB over to make_dev() for all device nodes, previously it hooked into
Andrew Thompson [Fri, 27 Feb 2009 17:27:16 +0000 (17:27 +0000)]
Change USB over to make_dev() for all device nodes, previously it hooked into
the devfs clone handler to open the (invisible) devices on the fly.

The /dev entries are layed out as follows,

 /dev/usbctl      = master device
 /dev/usb/0.1.0.5 = usb device, (<bus>.<dev>.<iface>.<endpoint>)
 /dev/ugen0.1 -> usb/0.1.0.0 = ugen link to ctrl endpoint

This also removes the custom permissions model from USB.  Bump
__FreeBSD_version to 800066.

Submitted by: rink (earlier version)

15 years agoRemove empty directory structure.
Ed Schouten [Fri, 27 Feb 2009 16:01:40 +0000 (16:01 +0000)]
Remove empty directory structure.

Submitted by: Pawel Worach <pawel worach gmail com>

15 years agoFix HID_COMPAT7 handling around the USB_GET_REPORT_DESC ioctl.
Andrew Thompson [Fri, 27 Feb 2009 15:30:42 +0000 (15:30 +0000)]
Fix HID_COMPAT7 handling around the USB_GET_REPORT_DESC ioctl.

Submitted by: daichi
Pointy hat: me

15 years agoFor all files including net/vnet.h directly include opt_route.h and
Bjoern A. Zeeb [Fri, 27 Feb 2009 14:12:05 +0000 (14:12 +0000)]
For all files including net/vnet.h directly include opt_route.h and
net/route.h.

Remove the hidden include of opt_route.h and net/route.h from net/vnet.h.

We need to make sure that both opt_route.h and net/route.h are included
before net/vnet.h because of the way MRT figures out the number of FIBs
from the kernel option. If we do not, we end up with the default number
of 1 when including net/vnet.h and array sizes are wrong.

This does not change the list of files which depend on opt_route.h
but we can identify them now more easily.

15 years agoMove the include of vinet.h further up before the ipfilter includes.
Bjoern A. Zeeb [Fri, 27 Feb 2009 13:29:18 +0000 (13:29 +0000)]
Move the include of vinet.h further up before the ipfilter includes.

15 years agoRemove redundant code in printf() and vprintf().
Ed Schouten [Fri, 27 Feb 2009 13:28:54 +0000 (13:28 +0000)]
Remove redundant code in printf() and vprintf().

printf() and vprintf() are exactly the same, except the way arguments
are passed. Just like we see in other pieces of code (i.e. libc's
printf()), implement printf() using vprintf().

Submitted by: Christoph Mallon <christoph mallon gmx de>

15 years agoShuffle the vimage.h includes or add where missing.
Bjoern A. Zeeb [Fri, 27 Feb 2009 13:22:26 +0000 (13:22 +0000)]
Shuffle the vimage.h includes or add where missing.

15 years agoRevert previous commit to subr_prf.c and make it more tidy.
Ed Schouten [Fri, 27 Feb 2009 12:50:25 +0000 (12:50 +0000)]
Revert previous commit to subr_prf.c and make it more tidy.

As mentioned by bz and bde, the change I made wasn't the proper way to
fix. Inspired by bde's patch, perform some small cleanups to uprintf().

Reviewed by: bz

15 years agoPrefer register usage style to be more consistent with the rest of the
Rafal Jaworowski [Fri, 27 Feb 2009 12:18:17 +0000 (12:18 +0000)]
Prefer register usage style to be more consistent with the rest of the
trap_subr.S code.

15 years agoMake Book-E debug register state part of the PCB context.
Rafal Jaworowski [Fri, 27 Feb 2009 12:08:24 +0000 (12:08 +0000)]
Make Book-E debug register state part of the PCB context.

Previously, DBCR0 flags were set "globally", but this leads to problems
because Book-E fine grained debug settings work only in conjuction with the
debug master enable bit in MSR: in scenarios when the DBCR0 was set with
intention to debug one process, but another one with MSR[DE] set got
scheduled, the latter would immediately cause debug exceptions to occur upon
execution of its own code instructions (and not the one intended for
debugging).

To avoid such problems and properly handle debugging context, DBCR0 state
should be managed individually per process.

Submitted by: Grzegorz Bernacki gjb ! semihalf dot com
Reviewed by: marcel

15 years agoFix up some ioctl permissions issues long overlooked.
Robert Noland [Fri, 27 Feb 2009 06:01:42 +0000 (06:01 +0000)]
Fix up some ioctl permissions issues long overlooked.

Submitted by: jkim@
MFC after: 2 weeks

15 years agofix build
Sam Leffler [Fri, 27 Feb 2009 05:22:11 +0000 (05:22 +0000)]
fix build

15 years agofix build
Sam Leffler [Fri, 27 Feb 2009 05:22:00 +0000 (05:22 +0000)]
fix build

15 years agoReplace clone_setcallback() with a new function clone_setdefcallback()
Rui Paulo [Fri, 27 Feb 2009 00:31:34 +0000 (00:31 +0000)]
Replace clone_setcallback() with a new function clone_setdefcallback()
that selects a callback from an interface prefix name. This allows us to
report a meaningful error when the user types 'ifconfig wlan0 create',
for example, and also kills some redundant code.

Reviewed by:    sam (earlier version)

15 years agoRollback rev. 189093.
Alexander Motin [Thu, 26 Feb 2009 23:21:32 +0000 (23:21 +0000)]
Rollback rev. 189093.

mtx_lock() is not needed there as callout initialized with callout_init_mtx().
Sorry.

Submitted by: Ian Dowse

15 years agoUnhide IDENTIFY command timeouts when verbose messages enabled.
Alexander Motin [Thu, 26 Feb 2009 23:07:40 +0000 (23:07 +0000)]
Unhide IDENTIFY command timeouts when verbose messages enabled.
I think it should be suitable for debugging.

15 years agoRestore mtx_lock() call on ata_timeout(), dropped (I think accidentally)
Alexander Motin [Thu, 26 Feb 2009 22:26:07 +0000 (22:26 +0000)]
Restore mtx_lock() call on ata_timeout(), dropped (I think accidentally)
during commit 3 years ago.

15 years agoRename all symbols in libmp(3) to mp_*, just like Solaris.
Ed Schouten [Thu, 26 Feb 2009 21:43:15 +0000 (21:43 +0000)]
Rename all symbols in libmp(3) to mp_*, just like Solaris.

The function pow() in libmp(3) clashes with pow(3) in libm. We could
rename this single function, but we can just take the same approach as
the Solaris folks did, which is to prefix all function names with mp_.

libmp(3) isn't really popular nowadays. I suspect not a single
application in ports depends on it. There's still a chance, so I've
increased the SHLIB_MAJOR and __FreeBSD_version.

Reviewed by: deischen, rdivacky

15 years agoRemove direct ata_completed() call options from ata_finish(), except for the
Alexander Motin [Thu, 26 Feb 2009 21:33:48 +0000 (21:33 +0000)]
Remove direct ata_completed() call options from ata_finish(), except for the
kernel dumping case.

ata_completed() may initiate ata_reinit() on error, that may lead to drives
attach or detach. Attach and detach are sending requests to drives and sleep
waiting for results. But ata_finish() can be called directly from
interrupt handler where sleeping is prohibited, so we must break this chain
somewhere. This place seems to fit best.

15 years agoFix LLVM compiler errors related to K&R declarations with ANSI prototypes.
Ed Schouten [Thu, 26 Feb 2009 20:59:05 +0000 (20:59 +0000)]
Fix LLVM compiler errors related to K&R declarations with ANSI prototypes.

Submitted by: Pawel Worach <pawel.worach@gmail.com>

15 years agoAllow the old usb stack to compile by adding the appropriate -I foo, this must
Andrew Thompson [Thu, 26 Feb 2009 20:54:43 +0000 (20:54 +0000)]
Allow the old usb stack to compile by adding the appropriate -I foo, this must
go before the standard -I$S to have the search happen before /sys/.

Make this conditional on 'makeoptions WITH_LEGACY=1' in the kernel config.

Prodded by: sam

15 years agoUse ANSI function declarations in librpcsvc.
Ed Schouten [Thu, 26 Feb 2009 20:32:11 +0000 (20:32 +0000)]
Use ANSI function declarations in librpcsvc.

When compiling librpcsvc with LLVM, we get a compiler error, because
hexval() uses an ANSI prototype, but a K&R declaration. I could have
just changed hexval(), but I'd rather keep this consistent. It's not
that much code.

Submitted by: Pawel Worach <pawel worach gmail com>

15 years agoAdd MSI blacklisting support.
Alexander Motin [Thu, 26 Feb 2009 20:00:14 +0000 (20:00 +0000)]
Add MSI blacklisting support.

Disable MSI for nVidia MCP51 controller. Enabling MSI there leads to
unexpected errors and timeouts, that should not happen even if interrupts
are not working completely.

15 years agouse mii instead of miibus to not pull in useless phy code
Sam Leffler [Thu, 26 Feb 2009 19:47:11 +0000 (19:47 +0000)]
use mii instead of miibus to not pull in useless phy code

15 years agoadd updatep[12] that grok the partitioning we use and use gpart
Sam Leffler [Thu, 26 Feb 2009 19:44:52 +0000 (19:44 +0000)]
add updatep[12] that grok the partitioning we use and use gpart
instead of boot0cfg to switch the active partition

15 years agoudf_readatoffset: read through directory vnode, do not read > MAXBSIZE
Andriy Gapon [Thu, 26 Feb 2009 18:58:41 +0000 (18:58 +0000)]
udf_readatoffset: read through directory vnode, do not read > MAXBSIZE

Currently bread()-ing through device vnode with
(1) VMIO enabled,
(2) bo_bsize != DEV_BSIZE
(3) more than 1 block
results in data being incorrectly cached.
So instead a more common approach of using a vnode belonging to fs is now
employed.
Also, prevent attempt to bread more than MAXBSIZE bytes because of
adjustments made to account for offset that doesn't start on block
boundary.
Add expanded comments to explain the calculations.
Also drop unused inline function while here.

PR: kern/120967
PR: kern/129084

Reviewed by: scottl, kib
Approved by: jhb (mentor)

15 years ago[1] When showing threads, the thread name just appears if the comm
Attilio Rao [Thu, 26 Feb 2009 18:01:07 +0000 (18:01 +0000)]
[1] When showing threads, the thread name just appears if the comm
label is choosen as last printout (ucomm suffers of this such bug
too).  That bug is caused by the fact that the fixed size of
printout doesn't leave enough space for them to be printed out.
Implement ucomm and comm commands with a dynamic size lenght for
buffers.

[2] On AMD64 architecture pointers don't have enough chars space to
be shown (8 chars while they need 16).  Fix them by providing
a variadic space so that it fits well on both 64 and 32 bits
architectures.

[3] Check a return value of malloc() that wasn't checked before.

PR: bin/128841, bin/128842
Reviewed by: jhb, emaste
Sponsored by: Sandvine Incorporated

15 years agoAdd a missing parameter to ruserpass(). According to C99 6.9.1p7
Roman Divacky [Thu, 26 Feb 2009 17:46:54 +0000 (17:46 +0000)]
Add a missing parameter to ruserpass(). According to C99 6.9.1p7
K&R function is not a prototype but this is a bad style. GCC accepts
this other compilers warn or reject this.

Approved by: kib (mentor)

15 years agoRemove unneeded pointer `ndp'.
Ed Schouten [Thu, 26 Feb 2009 16:32:48 +0000 (16:32 +0000)]
Remove unneeded pointer `ndp'.

Inside do_execve(), we have a pointer `ndp', which always points to
`&nd'. I can imagine a primitive (non-optimizing) compiler to really
reserve space for such a pointer, so just remove the variable and use
`&nd' directly.

15 years agoRemove even more unneeded variable assignments.
Ed Schouten [Thu, 26 Feb 2009 15:51:54 +0000 (15:51 +0000)]
Remove even more unneeded variable assignments.

kern_time.c:
- Unused variable `p'.

kern_thr.c:
- Variable `error' is always caught immediately, so no reason to
  initialize it. There is no way that error != 0 at the end of
  create_thread().

kern_sig.c:
- Unused variable `code'.

kern_synch.c:
- `rval' is always assigned in all different cases.

kern_rwlock.c:
- `v' is always overwritten with RW_UNLOCKED further on.

kern_malloc.c:
- `size' is always initialized with the proper value before being used.

kern_exit.c:
- `error' is always caught and returned immediately. abort2() never
  returns a non-zero value.

kern_exec.c:
- `len' is always assigned inside the if-statement right below it.

tty_info.c:
- `td' is always overwritten by FOREACH_THREAD_IN_PROC().

Found by: LLVM's scan-build

15 years agoDon't throw away upper 32-bits of the HT MSI address window. In practice
John Baldwin [Thu, 26 Feb 2009 14:32:14 +0000 (14:32 +0000)]
Don't throw away upper 32-bits of the HT MSI address window.  In practice
this is harmless since the address window for MSI on x86 is in the lower
4 GB.

Submitted by: mav
MFC after: 1 week

15 years agoRemove unneeded variable `ocn_mute'.
Ed Schouten [Thu, 26 Feb 2009 13:01:45 +0000 (13:01 +0000)]
Remove unneeded variable `ocn_mute'.

Found by: LLVM's scan-build

15 years agoRemove unused variables `p' and unneeded assignments of `rval'.
Ed Schouten [Thu, 26 Feb 2009 13:00:13 +0000 (13:00 +0000)]
Remove unused variables `p' and unneeded assignments of `rval'.

Found by: LLVM's scan-build

15 years agoudf: add read-ahead support modeled after cd9660
Andriy Gapon [Thu, 26 Feb 2009 12:33:22 +0000 (12:33 +0000)]
udf: add read-ahead support modeled after cd9660

Reviewed by: scottl
Approved by: jhb (mentor)

15 years agoudf_map: return proper error code instead of leaking an internal one
Andriy Gapon [Thu, 26 Feb 2009 12:33:17 +0000 (12:33 +0000)]
udf_map: return proper error code instead of leaking an internal one

Incidentally this also allows for small files with data embedded into
fentry to be mmap-ed.

Approved by: jhb (mentor)

15 years agoudf_read: correctly read data from files with data embedded into fentry,
Andriy Gapon [Thu, 26 Feb 2009 12:33:12 +0000 (12:33 +0000)]
udf_read: correctly read data from files with data embedded into fentry,

... as opposed to files with data in extents.
Some UDF authoring tools produce this type of file for sufficiently small
data files.

Approved by: jhb (mentor)

15 years agoudf_strategy: tiny optimization of logic, calculations; extra diagnostics
Andriy Gapon [Thu, 26 Feb 2009 12:33:02 +0000 (12:33 +0000)]
udf_strategy: tiny optimization of logic, calculations; extra diagnostics

Use bit-shift instead of division/multiplication.
Act on error as soon as it is detected.
Report attempt to read data embedded in file entry via regular way.
While there, fix lblktosize macro and make use of it.

No functionality should change as a result.

Approved by: jhb (mentor)

15 years agoRemove redundant assignment of `p'.
Ed Schouten [Thu, 26 Feb 2009 12:12:34 +0000 (12:12 +0000)]
Remove redundant assignment of `p'.

`p' is already initialized with `td->td_proc'. Because td is always
curthread, it is safe to initialize it without any locks.

Found by: LLVM's scan-build

15 years agoRemove redundant assignment of `s'.
Ed Schouten [Thu, 26 Feb 2009 12:06:46 +0000 (12:06 +0000)]
Remove redundant assignment of `s'.

The variable is already initialized to `nptr'.

Found by: LLVM's scan-build

15 years agoRemove unneeded variable assignment.
Ed Schouten [Thu, 26 Feb 2009 12:02:38 +0000 (12:02 +0000)]
Remove unneeded variable assignment.

The ts variable is always initialized a few lines below.

Found by: LLVM scan-build

15 years agoAdd static tracing for privilege checking:
Robert Watson [Thu, 26 Feb 2009 10:56:13 +0000 (10:56 +0000)]
Add static tracing for privilege checking:

  priv:kernel:priv_check:priv_ok fires for granted privileges
  priv:kernel:priv_check:priv_errr fires for denied privileges

The first argument is the requested privilege number.  The naming
convention is a little different from the OpenSolaris equivilent
because we can't have '-' in probefunc names, and our privilege
namespace is different.

MFC after: 1 week

15 years agoSilence compiler warning inside our ^T handler.
Ed Schouten [Thu, 26 Feb 2009 10:38:19 +0000 (10:38 +0000)]
Silence compiler warning inside our ^T handler.

It turns out we're casting fixpt_t* to int*.

Spotted by: clang

15 years agoUse unsigned longs for the TTY's sysctl stats.
Ed Schouten [Thu, 26 Feb 2009 10:28:32 +0000 (10:28 +0000)]
Use unsigned longs for the TTY's sysctl stats.

Spotted by: clang

15 years agoDon't use PTY name as format string, even though it isn't insecure here.
Ed Schouten [Thu, 26 Feb 2009 10:14:10 +0000 (10:14 +0000)]
Don't use PTY name as format string, even though it isn't insecure here.

It's guaranteed that the `name' variable always contains a string of the
form pty[l‐sL‐S][0‐9a‐v], but I'd rather keep the compiler happy (LLVM).

15 years agoadd more gpio registers
Sam Leffler [Thu, 26 Feb 2009 06:16:15 +0000 (06:16 +0000)]
add more gpio registers

15 years agoFix typo in comments in r189023.
Maxim Sobolev [Wed, 25 Feb 2009 22:24:56 +0000 (22:24 +0000)]
Fix typo in comments in r189023.

15 years agoEnable support for PAT_WRITE_PROTECTED and PAT_UNCACHED cache modes
Jung-uk Kim [Wed, 25 Feb 2009 20:26:48 +0000 (20:26 +0000)]
Enable support for PAT_WRITE_PROTECTED and PAT_UNCACHED cache modes
unconditionally on amd64.  On i386, we assume PAT is usable if the CPU
vendor is not Intel or CPU model is newer than Pentium IV.

Reviewed by: alc, jhb

15 years agoThe GM45 handles vblank differently. Pull the changes from Intel in.
Robert Noland [Wed, 25 Feb 2009 20:24:13 +0000 (20:24 +0000)]
The GM45 handles vblank differently.  Pull the changes from Intel in.

MFC after: 2 Weeks

15 years agoRemove D_NEEDGIANT.
Robert Noland [Wed, 25 Feb 2009 18:56:49 +0000 (18:56 +0000)]
Remove D_NEEDGIANT.

MFC after: 2 weeks

15 years agoTurn on MSI if the card supports it. There is a blacklist for chips
Robert Noland [Wed, 25 Feb 2009 18:54:35 +0000 (18:54 +0000)]
Turn on MSI if the card supports it.  There is a blacklist for chips
which report that they are capable of MSI, but don't work correctly.

MFC after: 2 weeks

15 years agoPrepare the radeon driver for MSI support.
Robert Noland [Wed, 25 Feb 2009 18:50:35 +0000 (18:50 +0000)]
Prepare the radeon driver for MSI support.

MFC after: 2 weeks

15 years agoAdd some vblank related debugging and replace the DRM_WAIT_ON macro
Robert Noland [Wed, 25 Feb 2009 18:48:33 +0000 (18:48 +0000)]
Add some vblank related debugging and replace the DRM_WAIT_ON macro
with a localized version.

MFC after: 2 weeks

15 years agoThis was part of a sync to the code that Intel is shipping in linux.
Robert Noland [Wed, 25 Feb 2009 18:44:50 +0000 (18:44 +0000)]
This was part of a sync to the code that Intel is shipping in linux.

- Remove the old TTM interface
- Move register definitions to i915_reg.h
- Overhaul the irq handler

MFC after: 2 weeks

15 years agoThe i915 driver was the only consumer of locked task support.
Robert Noland [Wed, 25 Feb 2009 18:25:47 +0000 (18:25 +0000)]
The i915 driver was the only consumer of locked task support.

Now that it doesn't use it anymore, get right of the taskqueue
and locked task support.

MFC after: 2 weeks

15 years agoThe vblank_swap ioctl was fundamentally race prone. Get rid of it.
Robert Noland [Wed, 25 Feb 2009 18:22:57 +0000 (18:22 +0000)]
The vblank_swap ioctl was fundamentally race prone.  Get rid of it.

MFC after: 2 weeks

15 years agoThere is no reason to hold the lock here.
Robert Noland [Wed, 25 Feb 2009 18:19:16 +0000 (18:19 +0000)]
There is no reason to hold the lock here.

When I was LOCK_PROFILING this was pretty high up and there is no
reason for it.

MFC after: 2 weeks

15 years agoRemove the PZERO priority from mtx_sleep.
Robert Noland [Wed, 25 Feb 2009 18:16:50 +0000 (18:16 +0000)]
Remove the PZERO priority from mtx_sleep.

MFC after: 2 weeks

15 years agoPrior to r188331 a map entry's last read offset was only updated by a hard
Alan Cox [Wed, 25 Feb 2009 07:52:53 +0000 (07:52 +0000)]
Prior to r188331 a map entry's last read offset was only updated by a hard
fault.  In r188331 this update was relocated because of synchronization
changes to a place where it would occur on both hard and soft faults.  This
change again restricts the update to hard faults.

15 years agoMake machdep.hyperthreading_enabled tunable working with the SCHED_ULE.
Maxim Sobolev [Wed, 25 Feb 2009 01:49:01 +0000 (01:49 +0000)]
Make machdep.hyperthreading_enabled tunable working with the SCHED_ULE.
Unlike with SCHED_BSD, however, it can only be set to 0 at boot time,
it's not possible to change it at runtime.

Reviewed by: jhb
MFC after: 1 month

15 years agoUpdate to latest 3Com firmware image. The latest fimware is
Pyun YongHyeon [Wed, 25 Feb 2009 01:12:56 +0000 (01:12 +0000)]
Update to latest 3Com firmware image. The latest fimware is
required to make 3CR990 familiy controllers run on NV flash
firmware version 03.001.008.
The latest firmware added HMAC digest information so teach txp(4)
to pass them to sleep image before downloading is started.

While I'm here restore previous IMR/IER register if firmware
downloading have failed.

PR: kern/89876, kern/132047

15 years agoUpdate paths for ehci_ixp4xx.c in the old and new stacks.
Andrew Thompson [Tue, 24 Feb 2009 23:34:02 +0000 (23:34 +0000)]
Update paths for ehci_ixp4xx.c in the old and new stacks.

15 years agoFix path and config name for ehci_mbus.c
Andrew Thompson [Tue, 24 Feb 2009 23:30:52 +0000 (23:30 +0000)]
Fix path and config name for ehci_mbus.c

15 years agoThese are no longer needed.
Andrew Thompson [Tue, 24 Feb 2009 23:27:59 +0000 (23:27 +0000)]
These are no longer needed.

15 years agoFix some more issues with the real mode BTX.
John Baldwin [Tue, 24 Feb 2009 23:11:15 +0000 (23:11 +0000)]
Fix some more issues with the real mode BTX.

The old BTX passed the general purpose registers from the 32-bit client to
the routines called via virtual 86 mode.  The new BTX did the same thing.
However, it turns out that some instructions behave differently in virtual 86
mode and real mode (even though this is under-documented).  For example, the
LEAVE instruction will cause an exception in real mode if any of the upper
16-bits of %ebp are non-zero after it executes.  In virtual 8086 mode the
upper 16-bits are simply ignored.  This could cause faults in hardware
interrupt handlers that inherited an %ebp larger than 0xffff from the 32-bit
client (loader, boot2, etc.) while running in real mode.

To fix, when executing hardware interrupt handlers provide an explicit clean
state where all the general purpose and segment registers are zero upon
entry to the interrupt handler.  While here, I attempted to simplify the
control flow in the 'intusr' code that sets up the various stack frames
and exits protected mode to invoke the requested routine via real mode.

A huge thanks to Tor Egge (tegge@) for debugging this issue.

Submitted by: tegge
Reviewed by: tegge
Tested by: bz
MFC after: 1 week

15 years agoRevert the addition of the freelist argument for the vm_map_delete()
Konstantin Belousov [Tue, 24 Feb 2009 20:57:43 +0000 (20:57 +0000)]
Revert the addition of the freelist argument for the vm_map_delete()
function, done in r188334. Instead, collect the entries that shall be
freed, in the deferred_freelist member of the map. Automatically purge
the deferred freelist when map is unlocked.

Tested by: pho
Reviewed by: alc

15 years agoAdd the assertion macros for the map locks. Use them in several map
Konstantin Belousov [Tue, 24 Feb 2009 20:43:29 +0000 (20:43 +0000)]
Add the assertion macros for the map locks. Use them in several map
manipulation functions.

Tested by: pho
Reviewed by: alc

15 years agoUse vm_map_entry_t instead of explicit struct vm_map_entry *.
Konstantin Belousov [Tue, 24 Feb 2009 20:27:48 +0000 (20:27 +0000)]
Use vm_map_entry_t instead of explicit struct vm_map_entry *.

Reviewed by: alc

15 years agoUpdate the comment after the r188334.
Konstantin Belousov [Tue, 24 Feb 2009 20:23:16 +0000 (20:23 +0000)]
Update the comment after the r188334.

Reviewed by: alc

15 years agoChange the functions to ANSI in those cases where it breaks promotion
Roman Divacky [Tue, 24 Feb 2009 18:09:31 +0000 (18:09 +0000)]
Change the functions to ANSI in those cases where it breaks promotion
to int rule. See ISO C Standard: SS6.7.5.3:15.

Approved by: kib (mentor)
Reviewed by: warner
Tested by: silence on -current

15 years agoThis copy of usbdevs is unused.
Andrew Thompson [Tue, 24 Feb 2009 17:26:37 +0000 (17:26 +0000)]
This copy of usbdevs is unused.

15 years agoAlso use proper capitalisation of FreeBSD in other source files.
Ed Schouten [Tue, 24 Feb 2009 17:15:29 +0000 (17:15 +0000)]
Also use proper capitalisation of FreeBSD in other source files.

Approved by: thompsa

15 years agoUse my address of the FreeBSD project in the copyright statement in USB2.
Ed Schouten [Tue, 24 Feb 2009 17:10:43 +0000 (17:10 +0000)]
Use my address of the FreeBSD project in the copyright statement in USB2.

If I remember correctly, our policy was to use FreeBSD with proper
capitalisation in our email addresses. Fix this in Nick Hibma's address
as well.