Commit graph

30565 commits

Author SHA1 Message Date
Andrew Gallatin 030cb46918 recover from namespace collision caused by un-static'ing pci_alloc_resource()
in rev  1.187 of sys/dev/pci/pci.c
2002-02-28 18:18:41 +00:00
Mark Murray 6df66172e3 Adjust the includes a bit.
Requested by:	bde
2002-02-28 17:41:42 +00:00
Hajimu UMEMOTO b7d6d9526c - Set inc_isipv6 in tcp6_usr_connect().
- When making a pcb from a sync cache, do not forget to copy inc_isipv6.

Obtained from:	KAME
MFC After:	1 week
2002-02-28 17:11:10 +00:00
Hajimu UMEMOTO c3cf07a14a - In nd6_rtrequest(), ignored a route when it is created by cloning and
is not a neighbor.  see comments for the detailed reason.

- Rejected the process of nd6_rtrequest() when the request is RESOLVE and
the interface does not need neighbor caches.

Obtained from:	KAME
MFC After:	1 week
2002-02-28 17:05:46 +00:00
Benno Rice 677bcc872c cpu_switch now works, for kthreads at least. 2002-02-28 12:06:49 +00:00
Benno Rice 0e1338662a Various cleanups. 2002-02-28 12:00:24 +00:00
Benno Rice b8160b5af4 - Prevent the decrementer interrupt handler from nesting.
- Catch some more cases of PSL_EE and PSL_RI getting out of sync.
2002-02-28 11:57:47 +00:00
Benno Rice ac6ba8bd4a - Modify pmap_activate so it only marks the pmap as active.
- Add a pmap_deactivate function.
2002-02-28 11:55:44 +00:00
Ian Dowse 167b8d0334 In sosend(), enforce the socket buffer limits regardless of whether
the data was supplied as a uio or an mbuf. Previously the limit was
ignored for mbuf data, and NFS could run the kernel out of mbufs
when an ipfw rule blocked retransmissions.
2002-02-28 11:22:40 +00:00
Yoshihiro Takahashi 28a90658c4 Add -D_KERNEL to CFLAGS for ntohl(). 2002-02-28 10:08:23 +00:00
Mike Barcroft 0497c9b478 Remove the now unused NTOHL() family of macros. 2002-02-28 09:59:00 +00:00
Mike Barcroft 27aba6a42a Change two occurrences of HTONS() to use htons(). 2002-02-28 09:56:31 +00:00
Benno Rice 3301d20ad9 GC an unused variable in cpu_fork(). 2002-02-28 08:48:58 +00:00
Mark Murray 6764eb8e7b Warning fix. (Very basic - add the right include so that rdtsc() gets
a prototype).
2002-02-28 08:37:18 +00:00
Andrew R. Reiter 216ae18217 - Fix panic() message and a couple style nits that snuck in from the
recent diagnostics commit (rev. 1.84).
2002-02-28 08:28:14 +00:00
Andrew R. Reiter d330a9760f - trap -> trap() in panic() string.
- Translate the message into some sort of understandable english.
- Fix a couple near-by style nits.

Submitted by: bde
2002-02-28 08:13:55 +00:00
Andrew R. Reiter 279efddedd - Style(9) makeover.
Reviewed by: chris, mike
2002-02-28 08:01:49 +00:00
Mike Silbersack f4e18c9afd Fix a minor swap leak.
Previously, the UPAGES/KSTACK area of processes/threads would leak memory
at the time that a previously swapped process was terminated.  Lukcily, the
leak was only 12K/proc, so it was unlikely to be a major problem unless you
had an undersized swap partition.

Submitted by:	dillon
Reviewed by:	silby
MFC after:	1 week
2002-02-28 07:41:12 +00:00
Bosko Milekic 71acb2477f Make MPLOCKED work again in asm files and stringify it explicitly
where necessary.

Reviewed by: jake
2002-02-28 06:17:05 +00:00
Benno Rice 4eed0cf1be Make fork work, at least for kthreads. Switching still has some issues. 2002-02-28 03:24:07 +00:00
Peter Wemm 183439a14a Quiet bogus gcc warning 2002-02-28 03:15:53 +00:00
Benno Rice b7ac845009 - Rearrange the sequence of events in powerpc_init() somewhat.
- Catch another instance of PSL_EE being cleared without PSL_RI.
2002-02-28 03:15:49 +00:00
Peter Wemm 9d69d7b867 Tag istallion.c with nowerror (third party) 2002-02-28 03:14:37 +00:00
Peter Wemm 4945f5ec47 Fix warning (const lost in assignment), harmless in this case. 2002-02-28 03:13:47 +00:00
Peter Wemm f24d9c32a0 Fix warnings (prototype for nonexisting static function) 2002-02-28 03:12:00 +00:00
Benno Rice 3c854532b0 - When enabling/disabling interrupts, set/clear both PSL_EE and PSL_RI, not
just PSL_EE.
- Make cpu_critical_enter/exit independant of save_intr/restore_intr.
2002-02-28 03:07:48 +00:00
Peter Wemm 85a745c15e Fix warnings.. bootpc_init() and related. 2002-02-28 03:07:35 +00:00
Benno Rice 9a7fefa51e Add a missing (. 2002-02-28 03:04:33 +00:00
Peter Wemm 1dec39afe0 Fix warnings 2002-02-28 03:02:20 +00:00
Peter Wemm d5362546cf Fix warnings 2002-02-28 02:56:29 +00:00
Benno Rice 88afb2a31b Implement the following functions:
- pmap_remove
	- pmap_kremove
	- pmap_qremove
2002-02-28 02:54:16 +00:00
Benno Rice 54eb8bbc14 Remove most of the usage of critical_enter/exit.
I put these in to match the use of spl*() in the NetBSD code I was basing this
on, but it appears to cause problems.

I'm doing this in a separate commit so as to be able to refer back if locking
becomes an issue at a later stage.
2002-02-28 02:45:10 +00:00
Peter Wemm 71e166afe3 Fix another boatload of warnings (missing include) and a cosmetic
-Wuninitialized warning.
2002-02-28 00:14:04 +00:00
Peter Wemm 777b9faaa4 Fix warnings. 2002-02-28 00:09:17 +00:00
Peter Wemm e51c24920f Fix debug printf formats 2002-02-28 00:06:59 +00:00
Peter Wemm d62e201b7b Fix some unused warnings. One function is only used if
TWE_SHUTDOWN_NOTIFICATION is defined, the other two are never used.
2002-02-27 23:59:35 +00:00
Peter Wemm 98d0a7f844 Fix warnings (comment out unused tables that are taking space in the
kernel)
2002-02-27 23:57:18 +00:00
Peter Wemm 654694bf54 Tag if_ie.c, isp.c and isp_pci.c as nowerror (qualifier problems, and third
party code)
2002-02-27 23:55:42 +00:00
Peter Wemm e542f1d7b7 Fix warnings 2002-02-27 23:53:02 +00:00
Peter Wemm f7afd87572 Fix warnings. The driver would be more useful with a DRIVER_MODULE()
entry so that it actually can do something.
2002-02-27 23:47:45 +00:00
Peter Wemm 10d3660bd2 Repair some warnings. These are accessing idle portions of shared memory
buffers.
2002-02-27 23:43:19 +00:00
Warner Losh e84e28dee1 Remove support for FreeBSD 2.x from this driver. 2002-02-27 23:34:02 +00:00
Peter Wemm b4925b6514 Fix warning (unused variable)
Submitted by:	LINT, -Werror
2002-02-27 23:32:45 +00:00
Peter Wemm c538dbe04d Mark a few more broken pci drivers as nowerror. 2002-02-27 23:30:33 +00:00
Peter Wemm cd23fe0f58 Fix warning (passing wrong arg to arp_ifinit())
Submitted by:	LINT, -Werror
2002-02-27 23:28:57 +00:00
Peter Wemm da0d93cfc3 Mark stallion.c as nowerror (known broken, this is a #warning) 2002-02-27 23:23:54 +00:00
Peter Wemm 6aea67779a Fix format warning.
Submitted by:	LINT, -Werror
2002-02-27 23:21:46 +00:00
John Baldwin 62da23f1e2 Back out part of KSE/M2 that snuck in under the radar: changing the
prototype of bzero() on the i386 to have a volatile first argument.

Requested by:	bde, jake
2002-02-27 22:12:29 +00:00
Julian Elischer 497a90b418 Unbreak fore adapters from POV of warnings.
Define the atm_dev_free() routine so that its OK to free stuff that is defined
as volatile. Note this doesn't FORCE the arguemnts to be volatile,
just says that it's not an error if it is..
2002-02-27 21:12:44 +00:00
Warner Losh 0cf3c909d8 Remove now unused struct proc *p.
Approved by: jhb
2002-02-27 20:57:57 +00:00
Andrew R. Reiter 4d59dcc5b6 - Insert a space in the panic() string in order more clearly show the
message.
2002-02-27 20:20:42 +00:00
Julian Elischer ca9d2dbac9 Add a comment explaining a code change.. 2002-02-27 19:24:55 +00:00
John Baldwin fdcc1cc09f Use thread0.td_ucred instead of proc0.p_ucred. This change is cosmetic
and isn't strictly required.  However, it lowers the number of false
positives found when grep'ing the kernel sources for p_ucred to ensure
proper locking.
2002-02-27 19:18:10 +00:00
John Baldwin bdd67d483c - Change namei() to use td_ucred instead of p_ucred.
- Change the hack in access() that uses a temporary credential to set
  td_ucred to the temp cred instead of p_ucred.
2002-02-27 19:15:29 +00:00
John Baldwin 6f105b3444 - Change unp_listen() to accept a thread rather than a proc as its second
argument.
- Use td_ucred in unp_listen() instead of p_ucred.
2002-02-27 19:14:01 +00:00
John Baldwin 4a7d6cd251 Fix Giant leakage in several error cases in __semctl(). 2002-02-27 19:12:14 +00:00
John Baldwin 6bd7ad69a1 Add a comment about an unlocked access to p_ucred that will go away in
the near future.
2002-02-27 19:10:50 +00:00
John Baldwin 7807397242 Use td_ucred and thus remove now unneeded proc lock acquire and release. 2002-02-27 19:09:30 +00:00
Alfred Perlstein 9f01374de5 kill __P. 2002-02-27 18:51:53 +00:00
Alfred Perlstein 566c1313a3 add assertions in the places where giant is required to catch when
the pipe is locked and shouldn't be.

initialize pipe->pipe_mtxp to NULL when creating pipes in order not
to trip the above assertions.

swap pipe lock with giant around calls to pipe_destroy_write_buffer()

pipe_destroy_write_buffer issue noticed by: jhb
2002-02-27 18:49:58 +00:00
John Baldwin a854ed9893 Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
2002-02-27 18:32:23 +00:00
John Baldwin 65e3406d28 Temporarily lock Giant while we update td_ucred. The proc lock doesn't
fully protect p_ucred yet so Giant is needed until all the p_ucred
locking is done.  This is the original reason td_ucred was not used
immediately after its addition.  Unfortunately, not using td_ucred is
not enough to avoid problems.  Since p_ucred could be stale, we could
actually be dereferencing a stale pointer to dink with the refcount, so
we really need Giant to avoid foot-shooting.  This allows td_ucred to
be safely used as well.
2002-02-27 18:30:01 +00:00
Mike Silbersack 7f3a40933b Fix a horribly suboptimal algorithm in the vm_daemon.
In order to determine what to page out, the vm_daemon checks
reference bits on all pages belonging to all processes.  Unfortunately,
the algorithm used reacted badly with shared pages; each shared page
would be checked once per process sharing it; this caused an O(N^2)
growth of tlb invalidations.  The algorithm has been changed so that
each page will be checked only 16 times.

Prior to this change, a fork/sleepbomb of 1300 processes could cause
the vm_daemon to take over 60 seconds to complete, effectively
freezing the system for that time period.  With this change
in place, the vm_daemon completes in less than a second.  Any system
with hundreds of processes sharing pages should benefit from this change.

Note that the vm_daemon is only run when the system is under extreme
memory pressure.  It is likely that many people with loaded systems saw
no symptoms of this problem until they reached the point where swapping
began.

Special thanks go to dillon, peter, and Chuck Cranor, who helped me
get up to speed with vm internals.

PR:		33542, 20393
Reviewed by:	dillon
MFC after:	1 week
2002-02-27 18:03:02 +00:00
Thomas Moestl 2081ddd6d9 Add gem and hme. 2002-02-27 17:46:04 +00:00
Thomas Moestl 42c1b001f7 Add a driver for the Sun GEM (Gigabit) and ERI (100 Mb/s) PCI ethernet
adaptors, ported from NetBSD.
2002-02-27 17:41:06 +00:00
Thomas Moestl 52381bfae4 Add a driver for the Sun HME PCI/SBus ethernet adaptor, which is onboard
in most machines of the Sun Ultra series. This is a port of the NetBSD
driver which I enhanced to make use of the gather functionality and the
configurable RX buffer offset to avoid copying all received/sent packet
(instead, packets will be directly DMAd from mbuf chains and into mbuf
clusters now).
2002-02-27 17:35:48 +00:00
Alfred Perlstein 21dbcfd500 Fix a NULL deref panic in pipe_write, we can't blindly lock
pipe->pipe_peer->pipe_mtxp because it may be NULL, so lock the
passed in pipe's mutex instead.
2002-02-27 17:23:16 +00:00
Thomas Moestl 90ce56c287 Add the following functions/macros to support byte order conversions and
device drivers for bus system with other endinesses than the CPU (using
interfaces compatible to NetBSD):

- bwap16() and bswap32(). These have optimized implementations on some
  architectures; for those that don't, there exist generic implementations.
- macros to convert from a certain byte order to host byte order and vice
  versa, using a naming scheme like le16toh(), htole16().
  These are implemented using the bswap functions.
- stream bus space access functions, which do not perform a byte order
  conversion (while the normal access functions would if the bus endianess
  differs from the CPU endianess).

htons(), htonl(), ntohs() and ntohl() are implemented using the new
functions above for kernel usage. None of the above interfaces is currently
exported to user land.

Make use of the new functions in a few places where local implementations
of the same functionality existed.

Reviewed by:	mike, bde
Tested on alpha by:	mike
2002-02-27 17:16:18 +00:00
Robert Drehmel 51aa959f05 Use the updated getcredhostname() function. 2002-02-27 16:55:30 +00:00
Robert Drehmel 668ae58863 Use the updated getcredhostname() function. 2002-02-27 16:47:27 +00:00
Robert Drehmel ad1ff0997e Make getcredhostname() take a buffer and the buffer's size
as arguments.  The correct hostname is copied into the buffer
while having the prison's lock acquired in a jailed process'
case.

Reviewed by:	jhb, rwatson
2002-02-27 16:43:20 +00:00
Robert Drehmel 9fdb8219fa - Use the new getcredhostname function in xenix_utsname(),
ibcs2_getipdomainname(), and ibcs2_utssys().

Reviewed by:	phk
2002-02-27 15:23:01 +00:00
Robert Drehmel cb83438de4 - Use the new getcredhostname function in the SVR4 uname system call.
- Remove spurious empty line.

Reviewed by:	phk
2002-02-27 15:12:56 +00:00
Robert Drehmel 5597f0ccf2 Use the getcredhostname function to fill the hostname into
the linux_newuname_args structure.  This should fix the case
of jailed linux processes not using the jail's hostname.

PR:		35336
Reviewed by:	phk
2002-02-27 15:06:33 +00:00
Robert Drehmel 9484d0c0e8 Add a function which returns the correct hostname for a given
credential.

Reviewed by:	phk
2002-02-27 14:58:32 +00:00
Crist J. Clark 93ec91ba6d Change the wording of the inline comments from the previous commit.
Objection from:	ru
2002-02-27 13:52:06 +00:00
Alfred Perlstein ffddaaeeeb MPsafe fixes:
use SYSINIT to initialize pipe_zone.
use PIPE_LOCK to protect kevent ops.
2002-02-27 11:27:48 +00:00
Seigo Tanimura 2f9325870d Return ESRCH if the target process is not inferior to the curproc.
Spotted by:	HIROSHI OOTA <oota@LSi.nec.co.jp>
2002-02-27 10:38:14 +00:00
Alfred Perlstein e6be967434 Don't hardcode /sys when making tags, instead use ${.CURDIR}/.. this
fixes a problem where one tries to make tags when the source isn't in
/sys.

Submitted by: Jihui Yang <yangjihui@yahoo.com>
2002-02-27 10:07:15 +00:00
Peter Wemm 30d1ca27fe Re-fix a pointer/integer warning. 2002-02-27 09:58:06 +00:00
Peter Wemm d1693e1701 Back out all the pmap related stuff I've touched over the last few days.
There is some unresolved badness that has been eluding me, particularly
affecting uniprocessor kernels.  Turning off PG_G helped (which is a bad
sign) but didn't solve it entirely.  Userland programs still crashed.
2002-02-27 09:51:33 +00:00
Julian Elischer 13b33111fe Fix warnings that have become fatal
1/ conditionalise (#if 0) function that is not used.
 Unused code left in place for netBSD compatibility.
2/ Recode loop to convince gcc that it does initialise a variable
 (use do-while instead of for() so gcc knows that we always go through
 at least once.  Feel free to check my logic.
2002-02-27 09:16:00 +00:00
Julian Elischer 561dac2175 turn on the ethertype filter module 2002-02-27 08:54:13 +00:00
Gary Jennejohn ffa4ab673b Remove a redundant decalaration of call_desc[] since it's now a
fatal error.
2002-02-27 08:33:08 +00:00
Alfred Perlstein f81b04d96c First rev at making pipe(2) pipe's MPsafe.
Both ends of the pipe share a pool_mutex, this makes allocation
and deadlock avoidance easy.

Remove some un-needed FILE_LOCK ops while I'm here.

There are some issues wrt to select and the f{s,g}etown code that
we'll have to deal with, I think we may also need to move the calls
to vfs_timestamp outside of the sections covered by PIPE_LOCK.
2002-02-27 07:35:59 +00:00
Jake Burkholder df38f87be1 Minimal testing has shown that a 4 page tsb is a nice sweet spot for current
work loads.  It tapers off after that as gcc's working set generally just fits.

compiling bin/csh:

TSB_PAGES = 2
	213.33 real        77.59 user       110.01 sys
TSB_PAGES = 4
	116.43 real        75.78 user        19.16 sys
TSB_PAGES = 8
	119.27 real        76.38 user        18.12 sys

Testing by:	tmm
2002-02-27 06:18:02 +00:00
Jake Burkholder 95a44511f3 Parameterize the number of pages to allocate for the per-cpu area on
PCPU_PAGES.
2002-02-27 06:08:13 +00:00
Jake Burkholder 62ad058292 Make cpu_identify take the value of the ver register and cpuid as arguments
so we can print nice things about non-current cpus.
2002-02-27 06:05:50 +00:00
Peter Wemm 5c004dc68e Bandaid for the Uniprocessor kernel exploding. This makes a UP kernel
boot and run (and indeed I am committing from it) instead of exploding
during the int 0x15 call from inside the atkbd driver to get the keyboard
repeat rates.
2002-02-27 06:05:24 +00:00
Alfred Perlstein 60d9b32e44 More IPV6 const fixes. 2002-02-27 05:11:50 +00:00
Warner Losh 7ba175ac23 Use the pci.c code wherever possible, rather than copying all the pci
code into cardbus and s/pci/cardbus.  This exposes a few pci_*
functions that are now static.

This work is similar to work Justin posted to the mobile list about a
year or two ago, which I have neglected since then.

This is a subset of his current work with the multiple inheritance
newbus architecutre.  When completed, that will eliminate the need for
pci/pci_private.h.

Similar work is needed for the cardbus_cis and pccard_cis code as well.
2002-02-27 05:09:14 +00:00
Dima Dorfman 76183f3453 Introduce a version field to `struct xucred' in place of one of the
spares (the size of the field was changed from u_short to u_int to
reflect what it really ends up being).  Accordingly, change users of
xucred to set and check this field as appropriate.  In the kernel,
this is being done inside the new cru2x() routine which takes a
`struct ucred' and fills out a `struct xucred' according to the
former.  This also has the pleasant sideaffect of removing some
duplicate code.

Reviewed by:	rwatson
2002-02-27 04:45:37 +00:00
Alfred Perlstein b7eeb587f6 clarify panic message 2002-02-27 04:27:36 +00:00
Alfred Perlstein c4c0c592f0 Fix warnings caused by discarding const.
Hairy Eyeball At: peter
2002-02-27 02:44:45 +00:00
Julian Elischer 3ffc8ab1ac Remove errors in LINT (now that they are fatal) 2002-02-27 02:21:43 +00:00
Peter Wemm bd1e3a0f89 Jake further reduced IPI shootdowns on sparc64 in loops by using ranged
shootdowns in a couple of key places.  Do the same for i386.  This also
hides some physical addresses from higher levels and has it use the
generic vm_page_t's instead.  This will help for PAE down the road.

Obtained from:	jake (MI code, suggestions for MD part)
2002-02-27 02:14:58 +00:00
Daniel O'Callaghan 3c3c45471c Remove problematic PHY_WRITE so that autoneg to 10 Mbps
actually works.

Submitted by: Dennis <TD790@aol.com>
Reviewed by:	Bill Paul <wpaul@freebsd.org>
MFC after:	7 days
2002-02-27 02:11:34 +00:00
Alfred Perlstein 012b7109b9 remove trailing semi-colons from macro definitions. 2002-02-27 02:02:13 +00:00
Matthew Dillon 9f34c41601 didn't quite undo the last reversion. This gets it. 2002-02-27 01:48:17 +00:00
Jake Burkholder ad414cb452 Minor cleanup. 2002-02-27 00:31:31 +00:00