Commit Graph

59326 Commits

Author SHA1 Message Date
Max Laier
c0e9fdd321 Fix byteorder of syncpeer and make it actually work.
Submitted by:	glebius
MFC after:	1 week
2006-06-14 11:11:54 +00:00
David Xu
c2c1ab1858 Clear ke_runq before calling maybe_preempt, this avoids a
KASSERT(ke->ke_runq == NULL) panic when the sched_add is recursively
called by maybe_preempt.

Reported by: Wojciech A. Koszek < dunstan at freebsd dot czest dot pl >
2006-06-14 03:46:03 +00:00
Xin LI
6ad26d8376 Unexpand an instance of TAILQ_EMPTY() 2006-06-14 03:14:26 +00:00
Marcel Moolenaar
a04f78eacc Unbreak build on platforms that don't have uart_sab82532 and uart_z8530
for uart(4) by default, but have scc(4).
2006-06-14 03:03:08 +00:00
Marcel Moolenaar
e1684acf38 Unbreak 64-bit architectures. The 3rd argument to kern_kldload() is
a pointer to an integer and td->td_retval[0] is of type register_t.
On 64-bit architectures register_t is wider than an integer.
2006-06-14 03:01:06 +00:00
Christian S.J. Peron
7eae78a419 If bpf(4) has not been compiled into the kernel, initialize the bpf interface
pointer to a zeroed, statically allocated bpf_if structure. This way the
LIST_EMPTY() macro will always return true. This allows us to remove the
additional unconditional memory reference for each packet in the fast path.

Discussed with:	sam
2006-06-14 02:23:28 +00:00
David Xu
2c7cae8042 Fox a typo in sched_is_timeshare. 2006-06-13 23:45:59 +00:00
David Xu
e15abbf251 Pass boolean value to __predict_false. Try to keep KSE slot count
correct for migrating thread, the count is a bit mess.
2006-06-13 23:01:50 +00:00
John Baldwin
edd32c2da2 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.
2006-06-13 21:36:23 +00:00
John Baldwin
b21c9288ce A couple of minor style tweaks. 2006-06-13 21:34:12 +00:00
John Baldwin
d53885879d - 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.
2006-06-13 21:28:18 +00:00
John Baldwin
6b3d277ad4 - 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.
2006-06-13 21:11:12 +00:00
John Baldwin
b904477c68 Unexpand TAILQ_FOREACH() and TAILQ_FOREACH_SAFE(). 2006-06-13 20:49:07 +00:00
John Baldwin
3a600aeabc Remove some more pointless goto's and don't check to see if
malloc(M_WAITOK) returns NULL.
2006-06-13 20:27:23 +00:00
John Baldwin
2fa6cc80d7 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.
2006-06-13 19:45:08 +00:00
Marius Strobl
ab098c4184 - 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.
2006-06-13 19:18:09 +00:00
Alexander Leidinger
4946fe7c4d regen after MFP4 (soc2006/rdivacky_linuxolator) of syscalls.master
P4-Changes:	similar to 98673 and 98675 but regenerated locally
Sponsored by:	Google SoC 2006
Submitted by:	rdivacky
2006-06-13 18:48:30 +00:00
Alexander Leidinger
c8b579c182 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]

P4-Changes:	98672, 98674
Noticed by:	rwatson [1]
Sponsored by:	Google SoC 2006
Submitted by:	rdivacky
2006-06-13 18:43:55 +00:00
Marius Strobl
6010b27c33 Correct transposed digits in device names which were added in the
previous revision.
2006-06-13 18:40:39 +00:00
Maxim Konovalov
70df31f4de 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.

PR:		kern/90800
Submitted by:	Andrey Simonenko
Regres. tests:	tools/regression/sockets/unix_cmsg/
MFC after:	1 month
2006-06-13 14:33:35 +00:00
Doug Ambrisko
c3a252361a 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.
2006-06-13 14:27:52 +00:00
Andrew Gallatin
6d87a65da4 - 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.
2006-06-13 13:53:52 +00:00
David Xu
b41f1452d9 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.
2006-06-13 13:12:56 +00:00
Olivier Houchard
de5f056a10 Handle MFS_IMAGE in the ${FULLKERNEL} target, so that we can build kernel
with MFS root without debugging.
2006-06-13 00:57:10 +00:00
Olivier Houchard
ee8ecea34b 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.
2006-06-12 22:58:50 +00:00
Olivier Houchard
9464ffd0a4 MFp4: Increase the L1 pagetable needed for the kernel from 8 to 22, to be
able to boot fat kernels.
2006-06-12 22:57:24 +00:00
Andrew Thompson
80829fccd7 Use bit operations to get a locally administered address rather than using a
hardcoded OUI code.
2006-06-12 22:43:37 +00:00
John Baldwin
5c69ad8374 Use fget() in kqueue_register() instead of doing all the work by hand. 2006-06-12 21:46:23 +00:00
Marius Strobl
acb8c14985 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.

OK'ed by:	imp, peter
2006-06-12 21:07:13 +00:00
John Baldwin
e3d7caf487 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.
2006-06-12 20:38:17 +00:00
John Baldwin
a6e25132d4 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.
2006-06-12 20:35:59 +00:00
Marcel Moolenaar
ba86e75654 Some machines have an ESCC. Make sure we build uart(4) with support
for the z8530.
2006-06-12 20:10:46 +00:00
Alan Cox
b74a62d602 Don't invalidate the TLB in pmap_qenter() unless the old mapping was valid.
Most often, it isn't.

Reviewed by: tegge@
2006-06-12 20:05:27 +00:00
Warner Losh
ed0b0e826e Need machine/bus.h here too 2006-06-12 19:22:44 +00:00
Dag-Erling Smørgrav
5ef57544fc Add the model name, obtained from the hw.model sysctl variable.
MFC after:	3 weeks
2006-06-12 18:14:49 +00:00
Nate Lawson
4c452688a9 Check in file missed in last commit. It made it into the MFC properly
though.
2006-06-12 17:13:57 +00:00
Warner Losh
f58c578b36 MFp4: need machine/bus.h here since we use bus space macros. It used to
be brought in by name-space polluted sys/rman.h.

Pointy hat to: imp
2006-06-12 14:46:44 +00:00
Warner Losh
4710853aac 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.
2006-06-12 04:30:42 +00:00
Warner Losh
78878cef94 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.
2006-06-12 04:21:50 +00:00
Warner Losh
ccdc8d9bff Add a convenience function rman_init_from_resource for initializing
a rman from a resource.

Also, include _bus.h since the implementation of bus_space isn't
needed here, just the definitions of the types.
2006-06-12 04:06:21 +00:00
Warner Losh
d47f76464a Better printf 2006-06-12 04:00:33 +00:00
Warner Losh
1acd1e20a1 Minor cleanup of CIS parsing. 2006-06-12 03:28:42 +00:00
Warner Losh
9dfcc6624c Better error message when the CIS is a non-standards conforming '0'. 2006-06-12 03:20:44 +00:00
Warner Losh
a63eba960f 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.
2006-06-12 03:17:24 +00:00
Max Khon
5349526518 Make cm(4) driver MPSAFE. 2006-06-11 22:25:01 +00:00
Max Khon
affcaf7871 Fix KASSERT conditions in if_deregister_com_alloc(). 2006-06-11 22:09:28 +00:00
Nate Lawson
d85e6785c5 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.
2006-06-11 20:31:41 +00:00
Alan Cox
fd5cb69756 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.
2006-06-11 04:53:06 +00:00
Alan Cox
2087cafb70 Eliminate spl calls. 2006-06-11 04:14:36 +00:00
Craig Rodrigues
277815d5c2 Implement vnode operations for setting and removing extended attributes. 2006-06-11 03:32:50 +00:00