tjr [Wed, 17 Mar 2004 01:43:08 +0000 (01:43 +0000)]
Re-add macro versions of getc(), getchar(), putc(), putchar(), feof(),
ferror(), fileno() and clearerr(), using the value of __isthreaded to
decide between the fast inline single-threaded code and the more
general function equivalent. This gives most of the performance
benefits of the old unsafe macros while preserving thread safety.
rwatson [Wed, 17 Mar 2004 01:12:09 +0000 (01:12 +0000)]
Remove tun_proc; replace with tun_pid. tun_proc pointer may be stale
as the process that opens tun_softc can exit before the file
descriptor is closed.
kan [Tue, 16 Mar 2004 22:06:32 +0000 (22:06 +0000)]
Avoid doing bawrite to initialize inode block while holding cylinder
group block locked. If filesystem has any active snapshots, bawrite
can come back trying to allocate new snapshot data block from the same
cylinder group and cause panic due to recursive lock attempt.
des [Tue, 16 Mar 2004 21:30:41 +0000 (21:30 +0000)]
Run through indent(1) so I can read the code without getting a headache.
The result isn't quite knf, but it's knfer than the original, and far
more consistent.
alc [Tue, 16 Mar 2004 19:04:28 +0000 (19:04 +0000)]
Refactor the existing machine-dependent sf_buf_free() into a machine-
dependent function by the same name and a machine-independent function,
sf_buf_mext(). Aside from the virtue of making more of the code machine-
independent, this change also makes the interface more logical. Before,
sf_buf_free() did more than simply undo an sf_buf_alloc(); it also
unwired and if necessary freed the page. That is now the purpose of
sf_buf_mext(). Thus, sf_buf_alloc() and sf_buf_free() can now be used
as a general-purpose emphemeral map cache.
jhb [Tue, 16 Mar 2004 18:56:22 +0000 (18:56 +0000)]
Remove a bogus assertion and readd it in a more correct location. A thread
might be enqueued on a sleep queue but not be asleep when the timeout fires
if it is blocked on a lock trying to check for pending signals before going
to sleep. In the case of fixing up the TDF_TIMEOUT race, however, the
thread must be marked asleep.
jhb [Tue, 16 Mar 2004 17:07:06 +0000 (17:07 +0000)]
Change libdisk and sysinstall to use d_addr_t rather than u_long for disk
addresses. For arch's with 64-bit longs, this is a nop, but for i386 this
allows sysinstall to properly handle disks and filesystems > 1 TB.
Changes from the original patch include:
- Use d_addr_t rather than inventing a blkcnt type based on int64_t.
- Use strtoimax() rather than strtoull() to parse d_addr_t's from config
files.
- Use intmax_t casts and %jd rather than %llu to printf d_addr_t values.
mtm [Tue, 16 Mar 2004 13:46:29 +0000 (13:46 +0000)]
o Add an -S option to not attempt to ascertain the validity of a shell.
o Add a -D option to not attempt to create the home directory.
o Treat the /nonexistent home directory specially. It means the user has
no home directory and it should not be created.
o Update Copyright year and my email.
grehan [Tue, 16 Mar 2004 13:34:50 +0000 (13:34 +0000)]
Add powerpc to temporary fix. The new cpu device claims all
'generic' OpenFirmware nexus nodes, since it uses bus_generic_probe.
Maybe the cpu device probe should be MD.
scottl [Tue, 16 Mar 2004 12:23:43 +0000 (12:23 +0000)]
Remove RAIDFrame. It hasn't worked since GEOM replaced the old disk
mini-layer. I don't have time to bing it forward into the GEOM world, and
no one else has stepped forward to claim it. It'll be in the Attic for safe
keeping for now.
dwmalone [Tue, 16 Mar 2004 10:46:42 +0000 (10:46 +0000)]
Nudge Giant as far as I can into kern_open(). Mark open() as MPSAFE.
Use kern_open() to implement creat() rather than taking the long route
through open(). Mark creat as MPSAFE.
While I'm at it, mark nosys() (syscall 0) as MPSAFE, for all the
difference it will make.
truckman [Tue, 16 Mar 2004 06:53:03 +0000 (06:53 +0000)]
Rename the wiredlen member of struct sysctl_req to validlen and always
set it to avoid the need for a bunch of code that tests whether or
not the lock member is set to REQ_WIRED in order to determine which
length member should be used.
Fix another bug in the oldlen return value code.
Fix a potential wired memory leak if a sysctl handler uses
sysctl_wire_old_buffer() and returns an EAGAIN error to trigger
a retry.
truckman [Tue, 16 Mar 2004 01:28:45 +0000 (01:28 +0000)]
Don't bother calling vslock() and vsunlock() if oldlen is zero.
If vslock() returns ENOMEM, sysctl_wire_old_buffer() should set
wiredlen to zero and return zero (success) so that the handler will
operate according to sysctl(3):
The size of the buffer is given by the location specified by
oldlenp before the call, and that location gives the amount
of data copied after a successful call and after a call that
returns with the error code ENOMEM.
The handler will return an ENOMEM error because the zero length
buffer will overflow.
jhb [Mon, 15 Mar 2004 23:10:34 +0000 (23:10 +0000)]
When installing boot blocks into an Alpha BSD label, setup the location,
length, and flags fields at the end of the SRM boot sector so that SRM can
find the bootstrap code. This fixes bsdlabel -m alpha to generate bootable
disklabels.
jhb [Mon, 15 Mar 2004 23:09:17 +0000 (23:09 +0000)]
Add a mixer script that saves the current settings of all mixers present
in the system on shutdown and restores the settings on boot. The settings
can also be reset to the saved values via 'mixer reload'.
jhb [Mon, 15 Mar 2004 22:43:49 +0000 (22:43 +0000)]
- Mark ABI syscalls that call wait4() MP safe as recent changes to
the kernel wait4() made these all panic() implementations otherwise.
- The i386 linux_ptrace() syscall is MP safe. Alpha was already marked
MP safe.
jhb [Mon, 15 Mar 2004 18:48:28 +0000 (18:48 +0000)]
Drop the proc lock around calls to the MD functions ptrace_single_step(),
ptrace_set_pc(), and cpu_ptrace() so that those functions are free to
acquire Giant, sleep, etc. We already do a PHOLD/PRELE around them so
that it is safe to sleep inside of these routines if necessary. This
allows ptrace() to be marked MP safe again as it no longer triggers lock
order reversals on Alpha.
des [Mon, 15 Mar 2004 17:08:28 +0000 (17:08 +0000)]
Don't try to pass off a struct sockaddr as a struct sockaddr_in when it
may in fact very well be a struct sockaddr_in6. Just use plain struct
sockaddr.
This brings us yet another step closer to a clean -O2 build.
wpaul [Mon, 15 Mar 2004 16:39:03 +0000 (16:39 +0000)]
Add vectors for _snprintf() and _vsnprintf() (redirected straight to
snprintf() and vsnprintf() in FreeBSD kernel land).
This is needed by the Intel Centrino 2200BG driver. Unfortunately, this
driver still doesn't work right with Project Evil even with this tweak,
but I'm unable to diagnose the problem since I don't have access to a
sample card.
mlaier [Mon, 15 Mar 2004 13:41:17 +0000 (13:41 +0000)]
Fix some style(9) related issues after discussion with/education from bde:
- Add <sys/param.h> and <limits.h> where required (do not depend on other
headers pulling it in).
- __dead -> __dead2
- #if defined() -> #ifdef
- Remove ugly PRIu64 macros and use %llu w/ (unsigned long long) cast.
All changes looped back to OpenBSD (where applicable) for easier sync in the
future.
pjd [Mon, 15 Mar 2004 12:10:34 +0000 (12:10 +0000)]
Remove sysctl security.jail.list_allowed.
This functionality was a misfeature, sysctl was added and turned off by
default just to check if nobody complains.
sos [Mon, 15 Mar 2004 12:03:48 +0000 (12:03 +0000)]
Add support for detaching PCI controllers.
This adds support for cardbus ATA/SATA controllers. I get roughly the
same transfer speeds as on true PCI controllers. Nice to be able to add
a couble of "real" disks to a laptop :)
des [Mon, 15 Mar 2004 08:14:35 +0000 (08:14 +0000)]
Make this compile with -O2. A proper fix would use a struct to represent
vectors, instead of requiring the caller to keep track of element size
and count and pass them in by reference.
rwatson [Mon, 15 Mar 2004 01:52:00 +0000 (01:52 +0000)]
Lock down global variables in if_tap (primarily, the tap softc list);
add tapmtx, which protects globale variables.
Notes:
- The EBUSY check in MOD_UNLOAD may be subject to a race. Moving the
event handler unregister inside the mutex grab may prevent that race.
- Locking of global variables safely is now possible because tapclones
is only modified when the module is loading or unloading, thanks to
phk's recent chang to clone_setup().