Commit Graph

87955 Commits

Author SHA1 Message Date
christos
3ce718d4da Add compat 4.0 2007-05-29 23:21:52 +00:00
xtraeme
967c5e0168 Initialize oifr to fix build with COMPAT_40. 2007-05-29 22:05:01 +00:00
christos
cb17d4ac11 Add COMPAT_40 for struct ifreq changes. 2007-05-29 21:37:07 +00:00
christos
20bfd9898e Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.
2007-05-29 21:32:27 +00:00
alc
36457ddc20 fix typo in comment 2007-05-29 21:23:30 +00:00
dyoung
57e4ee7cd0 Fix rtw(4) on NetBSD/macppc: use bus_space_write_region_stream_4()
instead of bus_space_write_region_4() to write WEP Rx keys to the
NIC.  Thanks macallan@ for detecting the bug and testing the fix.
2007-05-29 18:38:20 +00:00
dyoung
58c85a01d2 Cosmetic: simplify a memset() statement, use __arraycount(), and
remove a gratuitous return statement at the end of a void subroutine.
2007-05-29 18:33:38 +00:00
dyoung
85c572c7f9 Simplify multicast filter programming, and take care to avoid
gratuitous device resets when the kernel adds/deletes a multicast
address.
2007-05-29 18:32:07 +00:00
macallan
b0698fecd5 cpu_info.ci_idle_pcb is gone so don't try to set it
probably needs more work but it works fine like that at least on my PB3400c
2007-05-29 13:26:39 +00:00
tsutsui
82e46da13f Use the kernel symbol table to see the beginning of the current
subroutine to get more proper backtrace on ddb(4).

In the previous code it scans backwards from the current PC
for the end of the previous subroutine and checks "jr ra" or
"jr k0" instructions, but it often fails because gcc is
so aggressive nowadays as to reorder instruction blocks
to create efficient code path by branch predict etc. and
"jr ra" is not always located at the end of subroutines.

No objection on port-mips.
2007-05-29 12:03:45 +00:00
tsutsui
cd07663368 Fix inconsistent changes in rev 1.153 and 1.154:
Adjust fs->fs_maxfilesize instead of ump->um_maxfilesize
in ffs_oldfscompat_read() because the latter is overrided
by the former after ffs_oldfscompat_read() returned.

Fixes EFBIG errors on read(2) and "exec /sbin/init: error 8"
problem on mac68k after mountroot() on old 4.3BSD UFS created
by the Mkfs tool for MacOS (reported and confirmed on port-mac68k).
2007-05-29 11:30:17 +00:00
simonb
9dc083f73e Fix a tyop. 2007-05-29 07:17:23 +00:00
ad
1ae6657a7b Fix lock order inversion between vnode locks and ufs_hashlock. Addresses
kern/36331 (MP deadlock between ufs_ihashget() and VOP_LOOKUP()) for ffs,
other file systems to follow. Reported by perseant@, debugged by Sverre
Froyen, patch posted/tested by Blair Sadewitz.
2007-05-28 23:42:56 +00:00
mrg
565d4d6ca6 disable mutex_spin_enter() & mutex_spin_exit() as they are currently
broken and cause MULTIPROCESSOR kernels to hang while entering
userland boot up.
2007-05-28 22:56:19 +00:00
mhitch
82970a259f Got rid of too much - need to allocate virtual space for msgbuf. 2007-05-28 22:36:15 +00:00
pavel
c9cec95fb7 Move ixpide from INSTALL to INSTALL_LARGE. This controller is apparently
found only in southbridges of relatively recent motherboards.
2007-05-28 21:54:38 +00:00
mrg
b4ff11c2dd fix some NOTDEF_DEBUG code. 2007-05-28 21:52:49 +00:00
pavel
e09c8c416e Move puc, ahcisata, nfe, svwsata from INSTALL to INSTALL_LARGE to help fit
INSTALL to a 2.88 MB floppy image. Suggested by Manuel Bouyer.
2007-05-28 21:45:29 +00:00
mrg
839b86dc5e cpu_attach(): in the MP case, fix up idle lwp info as well as lwp0.l_cpu.
for LOCKDEBUG, mutex_destroy() the cpu0 spc_lwplock with the global
cpuinfo VA, and re-mutex_init() it with the per-cpu address that is only
now available.  for non-boot cpus, be sure to also initialise curlwp to
the idle lwp.

xcall(), pmap_quiet_check(), pmap_pmap_pool_ctor(), pmap_pmap_pool_dtor(),
and pmap_enu4m(): don't care about cpus that have not been attached yet.
2007-05-28 21:24:17 +00:00
mrg
8f8cea5c68 clean up cpu_switchto() a little - no need to flushw or membar
excessively.  optimise an rdpr.  tested by tnn.
2007-05-28 20:09:50 +00:00
yamt
febe85111f - remove nfs_exit exit hook. ok'ed by christos@.
- as far as i understand the code, it shouldn't be necessary
	  because nfs_request can't return without removing its request
	  and r->r_lwp is either curlwp or NULL.
	- even if it's necessary, leaking requests is not the correct way
	  to recover from the condition.
- nfs_request: add a related assertion.
2007-05-28 16:47:38 +00:00
tls
4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
mrg
8c454927d9 regenerate. 2007-05-28 05:55:10 +00:00
mrg
f08e949808 add ALi M5261 ethernet (tulip clone) 2007-05-28 05:54:07 +00:00
mhitch
5a0ae3b2c5 Oops. I thought I had caught this before commiting the CMAP[12] removal,
but obviously I didn't.  Non-DEBUG kernels were unbootable because I left
some code inside an #ifdef DEBUG group.
2007-05-27 21:33:55 +00:00
uwe
19eb8fc1bc Need to use atop() when adjusting kernend for ksyms.
XXX: This code has obviously bit-rotted.

Pointed out by Anders Gavare on port-sh3.
2007-05-27 18:30:01 +00:00
cube
8b523203e0 Tyop. 2007-05-27 16:58:17 +00:00
tsutsui
2fc470a315 Reorder IPL_SOFTSERIAL and IPL_SOFTCLOCK properly. 2007-05-27 14:22:36 +00:00
tsutsui
cd02a491e7 - Don't clear BSS in mach_init() if a kernel is loaded
by our native bootloader.
- Restore lwp0.l_cpu (which is required for curcpu()) and
  cpu_info_store.ci_curlwp after clearing BSS in case
  a kernel is loaded by the firmware directly since these
  values are in BSS and initilized before mach_init() is called.
  (actually they are restored in mips_machdep.c:mips_vector_init()
   but we use curcpu() earlier than that point)

Fixes silent hang right after boot on cobalt.
2007-05-27 14:10:49 +00:00
tsutsui
5964c0cd2d Pass correct args to lwp_startup() in lwp_trampoline().
Should fix "panic: TLB out of universe" on MIPS3 machines.
2007-05-27 13:57:30 +00:00
uwe
269ff6629e In sh3_tlb_update we need to ensure we are not interrupted while
meesing with the TLB.  That would usually show up as misterious kernel
crashes under heavy load.

Prettify the code while here so that traversal of the memory mapped
TLB arrays looks congruent in all functions.

Fixes PR 34706
2007-05-27 12:21:24 +00:00
he
e0ce1262e3 Bump SYMTAB_SPACE so that it fits again. 2007-05-27 11:47:11 +00:00
skrll
f27ffb061f Fix up the frame sanity checking to not bitch when taking interrupts in
the sti ROM code.

Fixes PR/34715.

Thanks to David H. Gutteridge.
2007-05-27 09:41:25 +00:00
briggs
f5462cf43d Clear interrupt status at once instead of piecemeal.
Enable a few more bits in the I/O requested by ld and check for the fast
response bit when reading back from the queue.
Both changes come from reading the FreeBSD driver and testing on a Dell
CERC SATA controller.
2007-05-26 18:10:46 +00:00
agc
f1a5908695 In /proc/<pid>/statm, avoid leaking buffer space if the attempt to get
vmspace information fails.

Return the nice value properly to userland via the /proc/<pid>/stat entry.

Use vm sizes from vmspace, rather than rusage structs, for the same
reasons as mentioned previously - see the comment in
kvm_proc.c::kvm_getproc2() about rusage values and zombie processes.
2007-05-26 16:21:04 +00:00
briggs
a21419937e Import code from FreeBSD to tell the controller how much physical RAM the
system has.  This has the (scary-because-we've-been-running-so-long-
without-it) commit message (for the first version of the change):
        Tell the controller how much physical memory we have.  Without this
        there was a chance that our DMA regions would collide with the
        memory window used by the cache on the controller.  The result would
        be massive data corruption.  This seemed to mainly affect systems with
        >2GB of memory.
2007-05-26 12:45:02 +00:00
dyoung
8c4b63fb77 Do not run ctags on sys/dev/usb/usb_port.h. Its #defines shadow
NetBSD symbols, such as clalloc(), that one might one to tag to.
2007-05-26 05:34:04 +00:00
tsutsui
19c950bfd5 Fix a typo in RFACT of the second 3.3Vcc of W83627EHF. From OpenBSD. 2007-05-26 04:19:29 +00:00
tsutsui
2ae2a9ae1e Update function names in comments. 2007-05-26 03:26:49 +00:00
briggs
98fa060bce Enable aac(4) and ld at aac. 2007-05-26 03:02:02 +00:00
briggs
ffe5a7921a Don't use pointers in device structures.
Bring in some newer stuff for the init structure from FreeBSD.
2007-05-26 02:09:40 +00:00
tsutsui
2c07c8ddd5 Use consistent cast. 2007-05-26 00:08:32 +00:00
tsutsui
ba1003bc61 Remove an obsolete file after yamt-idlelwp merge. 2007-05-26 00:02:28 +00:00
tsutsui
aee64784f3 proc_trampoline -> lwp_trampoline in comment. 2007-05-25 23:58:43 +00:00
uwe
6a75919c1e Clarify comments in pmap_enter. 2007-05-25 23:55:13 +00:00
agc
12003e8756 Use a bit more common code for the MULTIPROCESSOR and !MULTIPROCESSOR
cases.

Use the lwp's priority when returning the priority value, rather than
returning the nice value.
2007-05-25 22:26:14 +00:00
agc
15a3a67ede Various changes for better Linux emulation:
+ in /proc/<pid>/statm emulation, use the memory values from vmspace,
rather than struct rusage, since the rusage values appear to be 0 for
all processes except zombies.  cf dsl's comment in
kvm_proc.c::kvm_getproc2()

+ in /proc/<pid>/stat, instead of returning the tv_sec value, return the
number of ticks we've had (roughly equivalent to the Linux jiffies).
Calculate these values from the tv_usec values.

Also:

+ enclose CPU_INFO_ITERATOR and CPU_INFO_FOREACH usage in #ifdef
MULTIPROCESSOR, at the request of Nick Hudson

Together, these changes allow htop to work on NetBSD.
2007-05-25 19:20:06 +00:00
yamt
8e69ce0726 dumpsys: build a fake switchframe for postmortem debugging.
reviewed by Frank van der Linden.
2007-05-25 15:09:50 +00:00
martin
95f43235b7 remove some debugging printfs for the MULTIPROCESSOR case 2007-05-25 12:42:07 +00:00
skrll
178869e145 Fix typo in comment. 2007-05-25 12:11:28 +00:00
tsutsui
0f31f5cb6c Preserve local symbols on linking a kernel so that
we can get more useful trace on ddb(4).
2007-05-25 10:44:27 +00:00
skrll
71c04700f6 No need to check if oldl == newl in cpu_switchto. All the callers ensure
this is never the case.

Fixup a few comments while I'm here.
2007-05-25 10:40:04 +00:00
martti
6b17040b66 Fix problems with stateful filtering. Patch received from darrenr@. 2007-05-25 06:44:20 +00:00
macallan
8add5b3a22 defflag SPARCBOOK_CMD 2007-05-25 02:01:41 +00:00
mjacob
3470b7cb13 Whoops- I almost forgot. Thank MetrumRG Associates for material
support in making 4Gb NetBSD support possible.
2007-05-25 01:59:24 +00:00
mjacob
8e237f7550 Major update to isp(4) driver to bring it in line with external sources.
The major changes are:

 + 4Gb (24XX) card support
 + Rewritten fabric and loop evaluation code
 + New f/w sets

The 4Gb changes required major rototilling, which caused a rewrite of
fabric and loop eval code. The latter can now be set up to tune for
dynamic device arrival/departure if the framework is set up for it,
or to be firm about waiting for devices.

Testing has been principally on amd64, i386 and sparc64 and seems to
not have broken things for me.
2007-05-24 22:12:02 +00:00
mjacob
f0b57d5f54 Major update to isp(4) driver to bring it in line with external sources.
The major changes are:

 + 4Gb (24XX) card support
 + Rewritten fabric and loop evaluation code
 + New f/w sets

The 4Gb changes required major rototilling, which caused a rewrite of
fabric and loop eval code. The latter can now be set up to tune for
dynamic device arrival/departure if the framework is set up for it,
or to be firm about waiting for devices.

Testing has been principally on amd64, i386 and sparc64 and seems to
not have broken things for me.
2007-05-24 21:30:41 +00:00
briggs
9e95a6e477 The number of max_lat units in 1 sec is 4000000 instead of 40000000 (an
extra 0 snuck into the code).
Found when looking at this with dyoung.
2007-05-24 15:57:58 +00:00
briggs
4208391f45 Some changes from the FreeBSD driver:
* Include definitions of adapter-initiated fibs.
* Send aifs back to the adapter after we receive them.
* Use indexes instead of pointers in 32-bit hardware registers.
* If we get a message that there's a printf from the adapter, but we have
  a NUL in the first character of the printf string, change the NUL to a
  space.
2007-05-24 15:07:47 +00:00
xtraeme
8f6f7665fa Indentation. 2007-05-24 13:36:57 +00:00
njoly
f70cd37804 Fix restart of interrupted system calls.
- Make linux_sys_rt_sigreturn() return EJUSTRETURN on success.
- Add missing rax to linux_sigcontext structure; and save/restore
  its value like other members in linux_sendsig()/linux_sys_rt_sigreturn().

With valuable help from manu.
2007-05-24 11:21:52 +00:00
dogcow
905b715a4b use PRIu64, not llu, to unbork on 64-bit platforms. 2007-05-24 05:33:08 +00:00
agc
4dbe5ed7e7 Extend the Linux emulation of /proc to include
/proc/stat
	/proc/loadavg and
	/proc/<pid>/statm.

These are only present when -o linux is specified as a mount option
to procfs.

Factor out some common code so that it can be used by a number of
functions.

XXX The values returned in the statm emulation need to be verified.
2007-05-24 00:37:40 +00:00
christos
68a6db0f0b fix typos in previous 2007-05-23 17:32:46 +00:00
christos
72cfe7327b Ansify + add a few comments, from Karl Sjödahl 2007-05-23 17:14:59 +00:00
he
410727fbc5 Remove MUNGE(NOP_ON_4M_15), that label no longer exists. 2007-05-23 14:51:16 +00:00
martin
dad9937fa5 In pmap_kenter_pa honour VM_PROT_EXECUTE - otherwise LKMs are not mapped
executable.
Fixes PR port-sparc64/36376.
2007-05-23 09:36:22 +00:00
martin
48290fcae6 Fix a stupid bug in the save_fpstate ipi, which caused overwriting of
struct lwp of the lwp owning the fpu. Fix clearing the fplwp - %o0 will
not survive the call to savefpstate - duh!
2007-05-23 08:16:43 +00:00
mhitch
058579391c Rework pmap_zero_page() and pmap_copy_page() so it doesn't need the pte
pointers from pmap_bootstrap(), and make pmap_bootstrap() more compatible
with the common m68k pmap_motorola.c.
cVS: ----------------------------------------------------------------------
2007-05-23 00:47:03 +00:00
mhitch
786f6950fd Get rid of pcb_cmap2 - it hasn't been used for a long, long time. 2007-05-22 20:29:31 +00:00
rjs
9b21104e57 Fix for yamt-idlelwp merge. 2007-05-22 20:06:33 +00:00
mrg
b9baf4bfef cpu_switchto(): if oldlwp is NULL, don't bother saving it. 2007-05-22 18:15:58 +00:00
martin
6b07dc2e73 In cpu_hatch() set curlwp to the idlelwp.
While here, remove a few debug printfs we no longer need.
2007-05-22 15:44:06 +00:00
xtraeme
f8dd8c3128 Do not print twice features2. This was added with yamt-idlelwp. 2007-05-22 13:56:54 +00:00
tnn
6380d93405 When renaming, copy the new name into the designated memory area.
Tested by martti@
2007-05-22 10:39:10 +00:00
mhitch
719ec3a2b9 From pmap_motorols,c:
Allow pmap_enter_ptpage to fail, sometimes. Pass WAIT/NOWAIT flags and
fix some obvious locking problems. This allows us to run a LOCKDEBUG
ernel now.
2007-05-22 05:05:32 +00:00
cube
03744d91f8 Rename si_sigval -> si_value to match POSIX RTS. [hi christos!] 2007-05-22 03:51:54 +00:00
rjs
4bf1455184 Remove two unused global variables. 2007-05-22 00:23:57 +00:00
martin
3f7dee7700 Fix cpu_idle() for machines that have a idlespin function - use a
sibling call to invoke it (cpu_idle pretends to be a leaf function).
Pointed out by uwe.
2007-05-21 22:16:35 +00:00
tron
91c4e746d1 Regen for PR kern/36360. 2007-05-21 19:40:49 +00:00
tron
c82109688f Add entries to recognize the Farallon Etherwave ISA card via ep(4).
Based on a patch submitted by Randy Beaudreault in PR kern/36360,
reviewed by Christos Zoulas.
2007-05-21 19:40:28 +00:00
rumble
b1a93d335f Fix comments about the cf_flags layout and use macros to test whether
tags, sync, and disconnect/reconnect are to be disabled or not.
2007-05-21 19:25:54 +00:00
rumble
305139637d Check in a workaround before I lose or forget about it:
My SGI issued IBM DORS-32160 will respond to every message with a sync
negotiation (even IDENTIFY) until it gets a response it likes (and it
definitely doesn't like async). Unfortunately, this locks us into an endless
loop after sending IDENTIFY, since the device responds with a SYNC
negotiation that we refuse to accept. This refusal results in a new
target-initiated sync negotiation, and so on...

To work around this, permit negotiating sync mode on an unexpected
target-initiated sync negotiation.
2007-05-21 18:56:32 +00:00
dsl
b113bdbde9 Fix logic inversion - probably PR kern/36284 2007-05-21 18:30:35 +00:00
tsutsui
c57c46580b Wrap sanity checks with #ifdef DIAGNOSTIC. 2007-05-21 17:00:32 +00:00
tsutsui
1a72ef0dec Wrap a sanity check with #ifdef DIAGNOSTIC. 2007-05-21 16:57:18 +00:00
tsutsui
835288d097 Remove unused m68k/bcopy.s.
(src/common/lib/libc/arch/m68k/string/bcopy.S in libkern is enough)
2007-05-21 16:54:00 +00:00
tsutsui
f8eda28885 Remove netns stuff. 2007-05-21 16:51:13 +00:00
tsutsui
069bd07685 Remove a local declaration of lwp_trampoline(). 2007-05-21 16:39:52 +00:00
tsutsui
32b0b73c06 Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
2007-05-21 16:37:03 +00:00
tsutsui
9e69c7d7d9 Make netintr() static since it's referred only in sun68k/isr.c. 2007-05-21 16:25:14 +00:00
tsutsui
92163ee53d Remove obsolete "extern int want_resched" decls. 2007-05-21 15:55:43 +00:00
tsutsui
85b0c3a013 Remove an obsolete "extern int want_resched" decl. 2007-05-21 15:54:58 +00:00
cube
e5c9a61e5e Add support for BCM5715. Works seemingly well on hardware provided by
pavel@.  Thanks, Pavel!
2007-05-21 15:36:26 +00:00
christos
c61eed39a8 rename si_sigval -> si_value to match POSIX RTS. 2007-05-21 15:35:47 +00:00
tsutsui
c6262d2d8d Remove obsolete decralations of switch_exit() and switch_lwp_ext(). 2007-05-21 15:34:22 +00:00
tsutsui
f06d68f845 curlwp can't be NULL so no need to check it. 2007-05-21 15:22:21 +00:00
tsutsui
7d0fcadf39 Initialize curlwp as well as lwp0.l_addr right after MMU is enabled. 2007-05-21 15:19:17 +00:00
tsutsui
79dff7e882 Add a comment. 2007-05-21 15:09:12 +00:00
tsutsui
4713f4a32c Adapt rest of m68k ports to yamt-idlelwp. Compile tested only. 2007-05-21 15:06:16 +00:00