jhb [Tue, 13 Jun 2006 21:36:23 +0000 (21:36 +0000)]
Use kern_kldload() and kern_kldunload() to load and unload modules when
we intend for the user to be able to unload them later via kldunload(2)
instead of calling linker_load_module() and then directly adjusting the
ref count on the linker file structure. This makes the resulting
consumer code simpler and cleaner and better hides the linker internals
making it possible to sanely lock the linker.
jhb [Tue, 13 Jun 2006 21:28:18 +0000 (21:28 +0000)]
- Add a kern_kldload() that is most of the previous kldload() and push
Giant down in it.
- Push Giant down in kern_kldunload() and reorganize it slightly to avoid
using gotos. Also, expose this function to the rest of the kernel.
jhb [Tue, 13 Jun 2006 21:11:12 +0000 (21:11 +0000)]
- Push down Giant some in kldstat().
- Use a 'struct kld_file_stat' on the stack to read data under the lock
and then do one copyout() w/o holding the lock at the end to push the
data out to userland.
jhb [Tue, 13 Jun 2006 19:45:08 +0000 (19:45 +0000)]
Handle the simple case of just dropping a reference near the start of
linker_file_unload() instead of in the middle of a bunch of code for
the case of dropping the last reference to improve readability and sanity.
While I'm here, remove pointless goto's that were just jumping to a
return statement.
marius [Tue, 13 Jun 2006 19:18:09 +0000 (19:18 +0000)]
- Complete breaking out the definition of bus_space_{tag,handle}_t by
moving the typedef of bus_space_tag_t from sys/sparc64/include/bus.h
to sys/sparc64/include/_bus.h. This brings sparc64 in sync with the
other platforms and fixes the compilation of drivers which include
<sys/rman.h> before <machine/bus.h> after sys/sys/rman.h rev. 1.34.
- Remove the definition of bus_type_t from sys/sparc64/include/_bus.h
as it's unused since sys/sparc64/include/bus.h rev. 1.6 and
sys/sparc64/sparc64/bus_machdep.c rev. 1.3.
- Remove some pointless comments.
netchild [Tue, 13 Jun 2006 18:43:55 +0000 (18:43 +0000)]
MFP4 (soc2006/rdivacky_linuxolator)
Update of syscall.master:
o Adding of several new dummy syscalls (268-310)
o Synchronization of amd64 syscall.master with i386 one
o Auditing added to amd64 syscall.master
o Change auditing type for lstat syscall (bugfix). [1]
dwmalone [Tue, 13 Jun 2006 14:59:07 +0000 (14:59 +0000)]
Make traceroute decode all the ICMP unreachable messages defined
in http://www.iana.org/assignments/icmp-parameters. Thankfully
IANA's list aggrees with <netinet/ip_icmp.h>.
I've tried to do this in a way which is mostly consistent with
tcptraceroute and Debian's version of traceroute. However, sometimes
a letter is used twice by these versions, so I've gone with:
maxim [Tue, 13 Jun 2006 14:33:35 +0000 (14:33 +0000)]
o There are two methods to get a process credentials over the unix
sockets:
1) A sender sends SCM_CREDS message to a reciever, struct cmsgcred;
2) A reciever sets LOCAL_CREDS socket option and gets sender
credentials in control message, struct sockcred.
Both methods use the same control message type SCM_CREDS with the
same control message level SOL_SOCKET, so they are indistinguishable
for the receiver. A difference in struct cmsgcred and struct sockcred
layouts may lead to unwanted effects.
Now for sockets with LOCAL_CREDS option remove all previous linked
SCM_CREDS control messages and then add a control message with
struct sockcred so the process specifically asked for the peer
credentials by LOCAL_CREDS option always gets struct sockcred.
ambrisko [Tue, 13 Jun 2006 14:27:52 +0000 (14:27 +0000)]
Fix missing \n and when there are no arg's that means just print out
the description so we don't have to do any more queries. Disable the
event query code until it figured out since but it is similar to the
AEN detail so we should be able to get that working.
gallatin [Tue, 13 Jun 2006 13:53:52 +0000 (13:53 +0000)]
- Complete the myri10ge -> mxge name change by doing a mechanical
s/myri10ge/mxge/g replacement in the myri10ge files. A few contuation
lines were joined because of the regained columns.
- Hook the mxge driver back to the build.
davidxu [Tue, 13 Jun 2006 13:12:56 +0000 (13:12 +0000)]
Add scheduler CORE, the work I have done half a year ago, recent,
I picked it up again. The scheduler is forked from ULE, but the
algorithm to detect an interactive process is almost completely
different with ULE, it comes from Linux paper "Understanding the
Linux 2.6.8.1 CPU Scheduler", although I still use same word
"score" as a priority boost in ULE scheduler.
Briefly, the scheduler has following characteristic:
1. Timesharing process's nice value is seriously respected,
timeslice and interaction detecting algorithm are based
on nice value.
2. per-cpu scheduling queue and load balancing.
3. O(1) scheduling.
4. Some cpu affinity code in wakeup path.
5. Support POSIX SCHED_FIFO and SCHED_RR.
Unlike scheduler 4BSD and ULE which using fuzzy RQ_PPQ, the scheduler
uses 256 priority queues. Unlike ULE which using pull and push, the
scheduelr uses pull method, the main reason is to let relative idle
cpu do the work, but current the whole scheduler is protected by the
big sched_lock, so the benefit is not visible, it really can be worse
than nothing because all other cpu are locked out when we are doing
balancing work, which the 4BSD scheduelr does not have this problem.
The scheduler does not support hyperthreading very well, in fact,
the scheduler does not make the difference between physical CPU and
logical CPU, this should be improved in feature. The scheduler has
priority inversion problem on MP machine, it is not good for
realtime scheduling, it can cause realtime process starving.
As a result, it seems the MySQL super-smack runs better on my
Pentium-D machine when using libthr, despite on UP or SMP kernel.
des [Tue, 13 Jun 2006 10:19:59 +0000 (10:19 +0000)]
Fix a bug introduced in rev 1.92, where, when changing from one directory
to another, the first CWD after a string of CDUPs would incorrectly include
a slash before the directory name.
cognet [Mon, 12 Jun 2006 22:58:50 +0000 (22:58 +0000)]
MFp4:
- Try hard to calculate a safe sp, so that the stack doesn't get smashed
while uncompressing or relocating the kernel.
- Bring in code needed to calculate the cacheline size etc, needed for
arm9_idcache_wbinv_all.
marius [Mon, 12 Jun 2006 21:07:13 +0000 (21:07 +0000)]
Make the ISAPNP code optional and only enable it on i386 and pc98 (used
for CBUS-PNP cards there) by default, as there are no amd64 and sparc64
machines with ISA slots and which therefore could make use of this code
known to exist. For sparc64 this additionally allows to get rid of the
compat shims for in{b,w,l}()/out{b,w,l}() etc and the associated hacks.
stefanf [Mon, 12 Jun 2006 21:06:00 +0000 (21:06 +0000)]
Don't strip a leading ./ from the path for the cd builtin to avoid interpreting
.//dir as /dir. Rather strip it only for the purpose of checking if the
directory path should be printed.
philip [Mon, 12 Jun 2006 21:02:19 +0000 (21:02 +0000)]
Add two little nuggets of wisdom I picked up at work today:
The three most dangerous things in the world are a programmer with a
soldering iron, a hardware type with a program patch and a user with
an idea. -- The Wizardry Compiled by Rick Cook
and
Debugging is anticipated with distaste, performed with reluctance, and
bragged about forever. -- Button at the Boston Computer Museum
jhb [Mon, 12 Jun 2006 20:38:17 +0000 (20:38 +0000)]
Enable a few more things in x86 NOTES to get broader LINT coverage:
- Turn on iwi(4), ipw(4), and ndis(4) on amd64 and i386.
- Turn on ral(4) and ural(4) on i386, pc98, and amd64.
jhb [Mon, 12 Jun 2006 20:35:59 +0000 (20:35 +0000)]
Forcefully turn off GPROF in this file if it is enabled as GPROF's
attempt to use a macro for 'ret' doesn't play well with the wrappers
trying to implement 'Pascal-style' calling conventions.
imp [Mon, 12 Jun 2006 04:30:42 +0000 (04:30 +0000)]
MFp4:
o Implement a bunch of sysctl's to report the information
that's now always reported. Mvoe reporting of that info
to bootverbose, but maybe it can go away entirely.
dev.ed.X.type: string name
dev.ed.X.TxMem: amount of memory used for tx side of the card
dev.ed.X.RxMem: amount of memory used for rx side of the card
dev.ed.X.Mem: Total amount of mem on card.
o Better comments about where NE-2000 (and clones) gets their MAC
address from.
imp [Mon, 12 Jun 2006 04:21:50 +0000 (04:21 +0000)]
Add the ability to subset the devices that UART pulls in. This allows
the arm to compile without all the extras that don't appear, at least
not in the flavors of ARM I deal with. This helps us save about 100k.
If I've botched the available devices on a platform, please let me
know and I'll correct ASAP.
imp [Mon, 12 Jun 2006 03:17:24 +0000 (03:17 +0000)]
When we can't parse the CIS, note with a warning that the bogus CIS
was ignored, rather than freaking out. In the past, it wasn't possible
to not parse the CIS, so this changes no behavior.
njl [Sun, 11 Jun 2006 20:31:41 +0000 (20:31 +0000)]
By default, don't disable ACPI during reboot. This appears to hang some
systems. Introduce a new sysctl "hw.acpi.disable_on_reboot" that allows
users to re-enable the old behavior in case it's needed for some systems.
We never disable in the power-off path.
Original approach submitted by Alexander Logvinov <abuse@akavia.ru> with
reworking by Jung-uk Kim and myself.
se [Sun, 11 Jun 2006 19:18:39 +0000 (19:18 +0000)]
Fix display of idle processes, which had been broken since rev. 1.56 of
machine.c. The traditional condition was (pctcpu > 0 || SRUN), but the
negation of the condition logic (from select to skip) made this come
out as (pctcpu > 0 && SRUN), leading to a very erratic display, except
for purely CPU bound processes.
This has been discussed in the mail lists some time ago and I have used
top with this patch on my systems for more than a year without problems
(just forgot to commit it earlier, since my systems were all fixed ...).
alc [Sun, 11 Jun 2006 04:53:06 +0000 (04:53 +0000)]
Remove pmap_pagedaemon_waken and update pmap_get_pv_entry() to match the
current interface with the machine-independent layer. Without this change,
the page daemon would only have been awakened the first time that the
number of pv entries went above the high water mark, not each time.
iedowse [Sat, 10 Jun 2006 17:29:40 +0000 (17:29 +0000)]
Hold on to firmware images until the interface detaches since
firmware_get() will not work while resuming. Note that we can't
simply drop the FIRMWARE_UNLOAD flag, because that will result in
a firmware image that can never be unloaded by the user since the
firmware subsystem will hold a linker reference to it (it's not
clear that firmware_put() without FIRMWARE_UNLOAD ever does quite
what you'd want).
iedowse [Sat, 10 Jun 2006 17:04:07 +0000 (17:04 +0000)]
Keep firmware images on the list until they have been unregistered
with firmware_unregister(). Previously when the last driver reference
had been dropped we would clear the list entry under the assumption
that the firmware module was about to be unloaded, but this was not
true if the firmware image had been loaded manually with kldload.
This makes it possible to manually kldload firmware images as a
workaround for drivers such as ipw that attempt to load firmware
while resuming after a suspend.
Reviewed by: mlaier (an earlier version of the patch)
rwatson [Sat, 10 Jun 2006 14:34:07 +0000 (14:34 +0000)]
Move some functions and definitions from uipc_socket2.c to uipc_socket.c:
- Move sonewconn(), which creates new sockets for incoming connections on
listen sockets, so that all socket allocate code is together in
uipc_socket.c.
- Move 'maxsockets' and associated sysctls to uipc_socket.c with the
socket allocation code.
- Move kern.ipc sysctl node to uipc_socket.c, add a SYSCTL_DECL() for it
to sysctl.h and remove lots of scattered implementations in various
IPC modules.
- Sort sodealloc() after soalloc() in uipc_socket.c for dependency order
reasons. Statisticize soalloc() and sodealloc() as they are now
required only in uipc_socket.c, and are internal to the socket
implementation.
After this change, socket allocation and deallocation is entirely
centralized in one file, and uipc_socket2.c consists entirely of socket
buffer manipulation and default protocol switch functions.
njl [Sat, 10 Jun 2006 08:20:17 +0000 (08:20 +0000)]
* Ask for a page-aligned page instead of an arbitrary address. This should
not be necessary but might be helpful and at least reduce fragmentation.
* Add an assert to detect if the wakecode ever grows too big. We include
1 KB for stack, which should be more than enough also.
* Remove unnecessary initialization of static variables.
* Add comments and a bootverbose print giving the page phys address.
njl [Sat, 10 Jun 2006 08:20:03 +0000 (08:20 +0000)]
Minor tweaks to the resume code. Previous commit reverted alignment back
to 4. There is no need to be more strict at assembly time since we copy
the code anyway to a private page.
* Clear the direction flag and eflags. Probably not necessary but it won't
hurt to be safe.
* Add prefixes to all instructions to prevent any assembler mistakes.
* Remove zeroing of eax - edi. We use those registers immediately after
to transfer values to protected mode so this was pointless.
* Update comments to reflect info found during code review.
jmallett [Sat, 10 Jun 2006 01:37:00 +0000 (01:37 +0000)]
Rather than using specified_ro to parse the options list an extra time, and
keeping a flag to check whether we actually wanted to mount the filesystem
readonly, setup the options list so that we start off by assuming rw is what's
desired and let later flags change that.
pjd [Fri, 9 Jun 2006 17:36:50 +0000 (17:36 +0000)]
Don't expect that 'device random' will compile in those files into the
kernel for us. If random is compiled as kernel module, geom_bde.ko cannot
be loaded.
kib [Fri, 9 Jun 2006 16:09:26 +0000 (16:09 +0000)]
Copy filename read from the stdin into the private buffer. Otherwise,
next read filename overwrite previous one, resulting in acl being
applied only to the last name in the list.
Submitted by: Oleg Lomaka <oleg.lomaka at gmail com>
MFC after: 1 week
Approved by: kan (mentor)
maxim [Fri, 9 Jun 2006 14:23:40 +0000 (14:23 +0000)]
o Remove a cruft prevented libpthread sigaction(2) wrapper to
do its work for SIGINFO. Always install libpthread signal handler
wrapper for SIGINFO even if user SIG_IGN's or SIG_DFL's it.
SIGINFO has a special meaning for libpthread: when LIBPTHREAD_DEBUG
enviroment variable defined it is used for dumping an information
about threads to /tmp/.
Reported by: mi
Reviewed by: deischen
MFC after: 2 weeks