Commit Graph

1069 Commits

Author SHA1 Message Date
Gary Palmer
9986e07e1f Remove the code that renices +4 a process that has had 10 minutes of
CPU time. I find it slightly annoying on one of our servers here.

Also disliked by: David Greenman
1996-09-22 06:35:24 +00:00
Bruce Evans
253c0899b2 Don't include <sys/conf.h> for the kernel in disk-related headers.
It is needed for implementation details but very little of it is
needed for the interface.  Include it in the few places that didn't
already include it.

Include <sys/ioccom.h> in <sys/disklabel.h> (as already in
<sys/diskslice.h>) so that all the disk-related headers are almost
self-sufficient.
1996-09-20 17:39:44 +00:00
John Dyson
08c2c9ddf5 Fix an spl window, a page manipulation at interrupt time that was
incorrect, and correct the support for B_ORDERED.  The spl window
fix was from Peter Wemm, and his questions led me to find the problem with
the interrupt time page manipulation.
1996-09-20 02:26:35 +00:00
Poul-Henning Kamp
e6c4b9ba32 Add the utrace(caddr_t addr,size_t len) syscall, that will store the
data pointed at in a ktrace file, if this process is being ktrace'ed.
I'm using this to profile malloc usage.
The advantage is that there is no context around this call, ie, no
open file or socket, so it will work in any process, and you can
decide if you want it to collect data or not.
1996-09-19 19:49:13 +00:00
Nate Williams
030e2e9ebb In sys/time.h, struct timespec is defined as:
/*
         * Structure defined by POSIX.4 to be like a timeval.
         */
        struct timespec {
                time_t  ts_sec;         /* seconds */
                long    ts_nsec;        /* and nanoseconds */
        };

        The correct names of the fields are tv_sec and tv_nsec.

Reminded by:	James Drobina <jdrobina@infinet.com>
1996-09-19 18:21:32 +00:00
Paul Traina
0570e4476a Add a new sysctl variable kern.sominqueue to override the MINIMUM queue
specified in a listen(2) system call.
1996-09-19 00:54:36 +00:00
John Dyson
f9da2540d2 Add needed spl protection, and some minor cleanups in vfs_vmio_release.
Submitted by:	Peter Wemm <peter@spinner.dialix.com> and me.
1996-09-18 15:57:41 +00:00
Bruce Evans
831031ce00 Attached simple external ddb commands show rtc', show pgrpdump'
and `show cbstat'.  The pgrpdump code was previously controlled by
`#ifdef DEBUG'.
1996-09-14 10:53:48 +00:00
John Dyson
8fdfa820e4 Clean up some more problems with freeing busy or wired pages. The
vfs_bio code was not waiting properly for page state until manipulating
it.
1996-09-14 04:40:33 +00:00
Bruce Evans
a7f8f2ab55 Changed cncheckc() interface so that it is 8-bit clean - return -1
instead of 0 if there is no input.
1996-09-14 04:31:09 +00:00
Bruce Evans
40b55a34ae Changed cncheckc() interface so that it is 8-bit clean - return -1
instead of 0 if there is no input.
1996-09-14 04:25:32 +00:00
Bruce Evans
d966b8d1c4 Fixed Id. 1996-09-14 01:04:18 +00:00
Bruce Evans
fc0b1dbf68 Don't use __dead in the kernel. It was an obfuscation for gcc >= 2.5
and a no-op for gcc >= 2.6.
1996-09-13 09:20:15 +00:00
John Dyson
9fc1279b79 A modification that allows the driver strategy to modify the
B_ASYNC flag broke things pretty bad (freeing buffer already on
queue or other wierd buffer queue errors.)  The broken code is
left in commented out, but this makes the problem go away for
now.
1996-09-13 03:15:45 +00:00
John Dyson
0463028c37 Fix a problem with child inheritance of sysv shm. Problem brought
to my attention by Brad Lineberger <bil@mpgn.com> and Rob Miracle.
1996-09-10 22:35:25 +00:00
Bruce Evans
f313170d3c Updated #includes to 4.4Lite style. 1996-09-10 08:32:01 +00:00
John Dyson
ae9b8c3a66 Make sure that the pager is allocated before it is needed. Hangs
can occur if the pager is not allocated in time.
1996-09-10 01:42:34 +00:00
John Dyson
5070c7f8c5 Addition of page coloring support. Various levels of coloring are afforded.
The default level works with minimal overhead, but one can also enable
full, efficient use of a 512K cache.  (Parameters can be generated
to support arbitrary cache sizes also.)
1996-09-08 20:44:49 +00:00
Søren Schmidt
9191680051 Fixed two small leftovers form PHK's mega devconf removal commit.. 1996-09-07 19:13:09 +00:00
John Dyson
a51f711975 Corrected an error where precious kernel virtual space was being allocated
for entire SYS5 SHM segments.  This is totally unnecessary, and so the
correct allocation of VM objects has been substituted.  (The vm_mmap
was misused -- vm_object_allocate is more appropriate.)
1996-09-07 03:24:44 +00:00
Poul-Henning Kamp
9d616cb5db Remove these three devconf files entirely. 1996-09-06 23:11:42 +00:00
Poul-Henning Kamp
bfbb029d87 Remove devconf, it never grew up to be of any use. 1996-09-06 23:09:20 +00:00
Justin T. Gibbs
0b64164fca Add bowrite.
Bowrite guarantees that buffers queued after a call to bowrite will
be written after the specified buffer (on a particular device).
Bowrite does this either by taking advantage of hardware ordering support
(e.g. tagged queueing on SCSI devices) or resorting to a synchronous write.
1996-09-06 05:37:53 +00:00
Bruce Evans
e7fa2650cc `struct linker_set execsw_set' was declared as const and pointers in it
were declared as non-const.  This is backwards (_lkm_exec() changes the
pointers but all the target `struct execsw's are const).  Fixed this
and poisoned related declarations to match and removed the bogus casts
that hid the bug.
1996-09-03 22:52:27 +00:00
Bruce Evans
3f6a052a89 Fixed bogus casts (const on the wrong *' in **') in a qsort-comparision
function.
1996-09-03 22:26:31 +00:00
Bruce Evans
b71fec07db Eliminated nested include of <sys/unistd.h> in <sys/file.h> in the kernel.
Include it directly in the few places where it is used.

Reduced some #includes of <sys/file.h> to #includes of <sys/fcntl.h> or
nothing.
1996-09-03 14:25:27 +00:00
Bruce Evans
c957118ef9 Added #include of <unistd.h> so that there is some chance that
_POSIX_SAVED_IDS is defined.  This feature was broken for a day
or two.
1996-09-03 12:52:58 +00:00
Satoshi Asami
1225e2435d Second phase of merge, get rid of more machine-independent-dependencies.
Get rid of pc98/pc98/pc98_device.h.

Submitted by:	The FreeBSD(98) Development Team
1996-09-03 10:24:29 +00:00
David Greenman
9e04304259 Implemented kernel side of MNT_NOATIME mount option. This option disables
the file access time update on reads and can be useful in reducing
filesystem overhead in cases where the access time is not important (like
Usenet news spools).
1996-09-03 07:09:11 +00:00
Andrey A. Chernov
3f24666649 Conditionalize POSIX saved ids code on _POSIX_SAVED_IDS define 1996-09-01 22:15:54 +00:00
David Greenman
09c75661de Change an splstatclock that should be an splhigh into an splhigh.
Reviewed by:	bde
1996-09-01 10:30:33 +00:00
David Greenman
eaed89032e Change an splclock that needs to be an splhigh into an splhigh.
Reviewed by:	bde
1996-09-01 10:10:12 +00:00
Bruce Evans
e0c95ed947 Fixed the easy cases of const poisoning in the kernel. Cosmetic. 1996-08-31 16:52:44 +00:00
Satoshi Asami
b316c8b2a7 s/pc98/isa/g in struct *_device and *_driver. Resync along the way.
Submitted by:	The FreeBSD(98) Development Team
1996-08-31 15:07:42 +00:00
Bruce Evans
09a8dfa260 Don't depend in the kernel on the gcc feature of doing arithmetic on
pointers of type `void *'.  Warn about this in future.
1996-08-31 14:48:13 +00:00
Bruce Evans
14c0cc3d51 Fixed a wrong comment. Did tsleep() ever return the networking errno
ETIMEDOUT?
1996-08-28 18:45:09 +00:00
Bruce Evans
b7ccad0af0 Fixed a stale comment. 1996-08-28 18:36:30 +00:00
Bruce Evans
f680933e5e Removed a ton of unused #includes. The introduction of SYSINIT() and
possibly the cleaning up of extern declarations made them unnecessary.
1996-08-28 18:32:51 +00:00
Julian Elischer
18cb99e99f Remove the old cleanup code as it is no longer used..
also fix two cases of = instead of ==
(cut+paste bug duplication)
1996-08-26 21:47:56 +00:00
Peter Wemm
b12e5e82b6 The socketpair(0 syscall is bogusly returning the fd numbers through
the primary and secondary return codes, causing it to not behave as
documented.  This probably originates from the ancient BSD kernels that
had pipe(2) implemented by socketpair(2), there are no binaries left that
we can run that do this.

Pointed out by: Robert Withrow <witr@rwwa.com>, PR#731
1996-08-24 03:35:13 +00:00
Wolfram Schneider
1b133036d3 add FreeBSD Inc. to copyright string 1996-08-22 17:37:02 +00:00
Julian Elischer
e0d898b48e Some cleanups to the callout lists recently added.
note that at_shutdown has a new parameter to indicate When
during a shutdown the callout should be made. also
add a RB_POWEROFF flag to reboot "howto" parameter..
tells the reboot code in our at_shutdown module to turn off the UPS
and kill the power. bound to be useful eventually on laptops
1996-08-22 03:50:33 +00:00
John Dyson
6476c0d204 Even though this looks like it, this is not a complex code change.
The interface into the "VMIO" system has changed to be more consistant
and robust.  Essentially, it is now no longer necessary to call vn_open
to get merged VM/Buffer cache operation, and exceptional conditions
such as merged operation of VBLK devices is simpler and more correct.

This code corrects a potentially large set of problems including the
problems with ktrace output and loaded systems, file create/deletes,
etc.

Most of the changes to NFS are cosmetic and name changes, eliminating
a layer of subroutine calls.  The direct calls to vput/vrele have
been re-instituted for better cross platform compatibility.

Reviewed by: davidg
1996-08-21 21:56:23 +00:00
Sujal Patel
acbfbfeaf2 Fix a minor style error in my code. 1996-08-20 15:03:41 +00:00
Sujal Patel
c2bbab53f4 Reran makesyscalls.sh after changing select()'s first argument to 'int'. 1996-08-20 07:20:29 +00:00
Sujal Patel
b08f7993c3 Remove the kernel FD_SETSIZE limit for select().
Make select()'s first argument 'int' not 'u_int'.

Reviewed by:	bde
1996-08-20 07:18:10 +00:00
Julian Elischer
269fb9d764 Collect all the functioons concerned with rebooting into one place
also add the at_shutdown callout list, and change the one user of
the present (broken) method (the vn driver) to use the new scheme.
1996-08-19 20:07:07 +00:00
Julian Elischer
313861b896 for kern_conf.c, start allocating dynamic major numbers
half way through the range rather than possibly colliding with
fixed elements. Increase the size of the arrays to take this into account..
remember that each element in the array is now only 1 ponter  so this
isn't that much..

also note a possible bug in debugging code in uipc_socket2.c (add XXX)
1996-08-19 19:22:26 +00:00
Julian Elischer
0885c1d28c fix handling of external objects referenced by mbufs
somehow this got broken between 4.3 tahoe and here, though I've been using
these fixes for over a year here..
1996-08-19 03:32:10 +00:00
Julian Elischer
fed06968ba add callout lists for exit() and fork()
I've been meaning to do this for AGES as I keep having to patch those routines
whenever I write a proprietary package or similar..

any module that assigns resources to processes needs to know when
these events occur. there are existsing modules that should be modified
to take advantage of these.. e.g. SYSV IPC primatives
presently have #ifdef entries in exit()


this also helps with making LKMs out of such things..

(see the man pages at_exit(9) and at_fork(9))
1996-08-19 02:28:24 +00:00
Julian Elischer
ad4240fec4 move all functions related to shutting down to one file
called kern_shutdown.c

note: I couldn't see anything machine dependant in the
functions boot() and dumpsys() which were in machdep.c
I have left a prototype for cpu_boot() which would go in
machdep.c, but I have nothing to put in it. Iexpect others will
let me know in no uncertain ways that this or that  is machine dependant
and should be there, but I'll way for that to happen.. :)

I haven't actually taken the functions OUT of machdep
or anywhere else yet.. I'm checking in this file so others can have a look
at it and comment. SO PLEASE DO COMMENT!

I am also (in another checkin) addinf a man(9) page for the new
at_shotdown().. er freudian slip there.. at_shutdown() call
so have a look at that (and at_exit and at_fork as well)
and feed me comments..

I'll heck in the changes to make these (shutdown) changes active tomorrow
if no-one objects too strongly..
1996-08-19 02:19:23 +00:00
Sujal Patel
de71b88098 Fix fdavail() so that correctly pays attention to the rlimit.
Fixes unp_externalize panic which occurs when a process is at it's
ulimit for file descriptors and tries to receive a file descriptor from
another process.

Reviewed by:	wollman
1996-08-15 16:33:32 +00:00
John Dyson
619594e898 Certain vnode buffer list operations were not being spl protected,
and they needed to be.  Brelse for example can be called at interrupt
level, and the buffer list operations were not being protected from it.
1996-08-15 06:45:01 +00:00
David Greenman
11282a57ce Add support for i686 machine check trap. 1996-08-11 17:41:25 +00:00
Poul-Henning Kamp
d1c4c866f0 Add separate kmalloc classes for BIO buffers and Ktrace info. 1996-08-04 20:13:08 +00:00
Poul-Henning Kamp
ca67a4e456 The check for multiple freed items were bogus. fixed. 1996-08-04 20:08:48 +00:00
Bruce Evans
70e53371c4 Eliminated i586_ctr_rate. Use i586_ctr_freq instead. 1996-08-02 21:16:27 +00:00
Peter Wemm
614d1d0b5b dscheck() was returning without setting bp->b_error when given a negative
block number.. (assuming Debugger() returned).  The disk drivers assume
that dscheck() sets both error markers (bp->b_error and set B_ERROR in
bp->b_flags) if it fails.
1996-08-02 06:14:25 +00:00
Poul-Henning Kamp
5e9ed9c990 Write protect the text segment of gzip'ed programs.
Various other cleanups by phk.

Reviewed by:	phk
Submitted by:	Igor Khasilev <igor@jabber.paco.odessa.ua>
1996-08-01 22:00:14 +00:00
David Greenman
4f898e1524 Changed wakeup_one() to continue looping, possibly waking up additional
processes, until it finds one that is not swapped out.

Submitted by:	dyson
1996-07-31 10:35:47 +00:00
David Greenman
b1508c72f4 Converted timer/run queues to 4.4BSD queue style. Removed old and unused
sleep(). Implemented wakeup_one() which may be used in the future to combat
the "thundering herd" problem for some special cases.

Reviewed by:	dyson
1996-07-31 09:26:54 +00:00
Bruce Evans
8c2ff39670 Only use the special bdevvp() for DEVFS if DEVFS_ROOT is defined. This
makes option DEVFS safe to use again (although mounting devfs is unsafe).
1996-07-30 18:00:32 +00:00
Bruce Evans
f5e9e8ec43 Fixed resource usage integrals. They were too large by a factor of
of profhz/stathz when profiling was enabled.
1996-07-30 16:59:22 +00:00
John Dyson
67bf686897 Backed out the recent changes/enhancements to the VM code. The
problem with the 'shell scripts' was found, but there was a 'strange'
problem found with a 486 laptop that we could not find.  This commit
backs the code back to 25-jul, and will be re-entered after the snapshot
in smaller (more easily tested) chunks.
1996-07-30 03:08:57 +00:00
John Dyson
9ed7fc75ff Modification to vfs_cluster to allow clustering of NFS delayed writes.
Submitted by:	Doug Rabson <dfr@render.com>
1996-07-27 18:49:18 +00:00
John Dyson
4f4d35edf0 This commit is meant to solve a couple of VM system problems or
performance issues.

	1) The pmap module has had too many inlines, and so the
	   object file is simply bigger than it needs to be.
	   Some common code is also merged into subroutines.
	2) Removal of some *evil* PHYS_TO_VM_PAGE macro calls.
	   Unfortunately, a few have needed to be added also.
	   The removal caused the need for more vm_page_lookups.
	   I added lookup hints to minimize the need for the
	   page table lookup operations.
	3) Removal of some bogus performance improvements, that
	   mostly made the code more complex (tracking individual
	   page table page updates unnecessarily).  Those improvements
	   actually hurt 386 processors perf (not that people who
	   worry about perf use 386 processors anymore :-)).
	4) Changed pv queue manipulations/structures to be TAILQ's.
	5) The pv queue code has had some performance problems since
	   day one.  Some significant scalability issues are resolved
	   by threading the pv entries from the pmap AND the physical
	   address instead of just the physical address.  This makes
	   certain pmap operations run much faster.  This does
	   not affect most micro-benchmarks, but should help loaded system
	   performance *significantly*.  DG helped and came up with most
	   of the solution for this one.
	6) Most if not all pmap bit operations follow the pattern:
		pmap_test_bit();
		pmap_clear_bit();
	   That made for twice the necessary pv list traversal.   The
	   pmap interface now supports only pmap_tc_bit type operations:
	   pmap_[test/clear]_modified, pmap_[test/clear]_referenced.
	   Additionally, the modified routine now takes a vm_page_t arg
	   instead of a phys address.  This eliminates a PHYS_TO_VM_PAGE
	   operation.
	7) Several rewrites of routines that contain redundant code to
	   use common routines, so that there is a greater likelihood of
	   keeping the cache footprint smaller.
1996-07-27 03:24:10 +00:00
Garrett Wollman
949f380f38 Rename KERN_DOMAINNAME to KERN_NISDOMAINNAME so that it can't be confused
with a real Domain Name.

Suggested by: Keith Bostic
1996-07-25 18:02:40 +00:00
Poul-Henning Kamp
e83cf165d6 DEVFS needs a special bdevvp(). 1996-07-24 21:21:43 +00:00
Poul-Henning Kamp
cba8a5ddd3 Make a "DWIM" function for adding [bc]devsw entries for bdev drivers.
Saves about 280 butes of source per driver, 56 bytes in object size
and another 56 bytes moves from data to bss.

No functional change intended nor expected.

GENERIC should be about one k smaller now :-)
1996-07-23 21:52:43 +00:00
John Dyson
d1a5be1064 A few minor mods (improvements) to support more efficient pipe
operations for large transfers.  There are essentially no differences
for small transfers, but big transfers should perform about 20%
better.
1996-07-13 22:52:50 +00:00
Bruce Evans
3be8cc7800 Staticized some variables.
Fixed initialization of pipe_pgid - don't default to pid 0 (swapper) for
SIGIO.

Added comments about other implicit initializations, mostly for struct
stat.

Fixed initialization of st_mode.  S_IFSOCK was for when pipes were sockets.
It is probably safe to fix the bogus S_ISFIFO() now that pipes can be
distinguished from sockets in all cases.

Don't return ENOSYS for inappropriate ioctls.
1996-07-12 08:14:58 +00:00
Bruce Evans
0cd97b2034 Use a big delta in adjtime() for big negative adjustments as well as
for big positive adjustments.  The existence of big adjustments may
be a bug (it's not documented...) but there was no good reason for
the asymmetric behaviour.

Reviewed by:	wollman
1996-07-12 07:55:35 +00:00
Bruce Evans
cba2a7c614 Staticized a few variables.
Fixed warnings about unused variables.
1996-07-12 07:41:34 +00:00
Bruce Evans
f3460ead96 Fixed cloned comments about npx traps to match context. 1996-07-12 06:03:14 +00:00
Bruce Evans
6ab46d52a5 Don't use NULL in non-pointer contexts. 1996-07-12 04:12:25 +00:00
Garrett Wollman
2c37256e5a Modify the kernel to use the new pr_usrreqs interface rather than the old
pr_usrreq mechanism which was poorly designed and error-prone.  This
commit renames pr_usrreq to pr_ousrreq so that old code which depended on it
would break in an obvious manner.  This commit also implements the new
interface for TCP, although the old function is left as an example
(#ifdef'ed out).  This commit ALSO fixes a longstanding bug in the
TCP timer processing (introduced by davidg on 1995/04/12) which caused
timer processing on a TCB to always stop after a single timer had
expired (because it misinterpreted the return value from tcp_usrreq()
to indicate that the TCB had been deleted).  Finally, some code
related to polling has been deleted from if.c because it is not
relevant t -current and doesn't look at all like my current code.
1996-07-11 16:32:50 +00:00
Garrett Wollman
1e4ad9ce28 This is a proposal-in-code for a substantial modification of the way
the high kernel calls into a protocol stack to perform requests on the
user's behalf.  We replace the pr_usrreq() entry in struct protosw with a
pointer to a structure containing pointers to functions which implement
the various reuqests; each function is declared with the correct type and
number of arguments.  (This is unlike the current scheme in which a quarter
of the requests take arguments of type other than (struct mbuf *) and the
difference is papered over with casts.)  There are a few benefits to this
new scheme:

1) Arguments are passed with their correct types, and null-pointer dummies
   are no longer necessary.

2) There should be slightly better caching effects from eliminating
   the prximity to extraneous code and th switch in pr_usrreq().

3) It becomes much easier to change the types of the arguments to something
   other than `struct mbuf *' (e.g.,pushing the work of sosend() into
   the protocol as advocated by Van Jacobson).

There is one principal drawback: existing protocol stacks need to
be modified.  This is alleviated by compatibility code in
uipc_socket2.c and uipc_domain.c which emulates the new interface
in terms of the old and vice versa.

This idea is not original to me.  I  read about what Jacobson did
in one of his papers and have tried to implement  the first steps
towards something like that here.  Much work remains to be done.
1996-07-09 19:12:53 +00:00
Andrey A. Chernov
3d1b21c689 Log not exited signal only, but the fact that core dumped (or not) too 1996-07-09 18:12:37 +00:00
Garrett Wollman
5c17ec631e Quiet a couple of -Wunused warnings. 1996-07-09 16:51:18 +00:00
John Dyson
c44013cde6 Get rid of PIPE_NBIO, cleaning up the code a bit.
Reviewed by:	bde
1996-07-04 04:36:56 +00:00
David Greenman
7c818168d5 Fixed a major bug that caused various pmap related panics, hangs, and reboots.
The i386 pmap module uses a special area of kernel virtual memory for mapping
of page tables pages when it needs to modify another process's virtual
address space. It's called the 'alternate page table map'. There is only one
of them and it's expected that only one process will be using it at once and
that the operation is atomic.
When the merged VM/buffer cache was implemented over a year ago, it became
necessary to rundown VM pages at I/O completion. The unfortunate and
unforeseen side effect of this is that pmap functions are now called at bio
interrupt time. If there happend to be a process using the alternate page
table map when this I/O completion occurred, it was possible for a different
process's address space to be switched into the alternate page table map -
leaving the current pmap process with the wrong address space mapped when
the interrupt completed. This resulted in BAD things happening like pages
being mapped or removed from the wrong address space, etc.. Since a very
common case of a process modifying another process's address space is during
fork when the kernel stack is inserted, one of the most common manifestations
of this bug was the kernel stack not being mapped properly, resulting in a
silent hang or reboot. This made it VERY difficult to troubleshoot this bug
(I've been trying to figure out the cause of this for >6 months). Fortunately,
the set of conditions that must be true before this problem occurs is
sufficiently rare enough that most people never saw the bug occur. As I/O
rates increase, however, so does the frequency of the crashes. This problem
used to kill wcarchive about every 10 days, but in more recent times when
the traffic exceeded >100GB/day, the machine could barely manage 6 hours of
uptime.
The fix is to make certain that no process has the pages mapped that are
involved in the I/O, before the I/O is started. The pages are made busy, so
no process will be able to map them, either, until the I/O has finished.
This side-steps the issue by still allowing the pmap functions to be called
at interrupt time, but also assuring that the alternate page table map won't
be switched.
Unfortunately, this appears to not be the only cause of this problem. :-(

Reviewed by:	dyson
1996-06-30 05:17:08 +00:00
John Dyson
4b83b27fea Fix a problem that caused system crashes after physio. This problem
was due to non-aligned 64K transfers taking 17 pages.  We currently
do not support >16 page transfers.  The transfer is unfortunately truncated,
but since buffers are usually malloced, this is a problem only once in
a while.  Savecore is a culprit, but tar/cpio usually aren't.  This
is NOT the final fix (which is likely a bouncing scheme), but will at
least keep the system from crashing.
1996-06-26 05:52:15 +00:00
Bruce Evans
79df6d8597 trap.c:
Fixed profiling of system times.  It was pre-4.4Lite and didn't support
statclocks.  System times were too small by a factor of 8.

Handle deferred profiling ticks the 4.4Lite way: use addupc_task() instead
of addupc().  Call addupc_task() directly instead of using the ADDUPC()
macro.

Removed vestigial support for PROFTIMER.

switch.s:
Removed addupc().

resourcevar.h:
Removed ADDUPC() and declarations of addupc().

cpu.h:
Updated a comment.  i386's never were tahoe's, and the deferred profiling
tick became (possibly) multiple ticks in 4.4Lite.

Obtained from:	mostly from NetBSD
1996-06-25 20:02:16 +00:00
Bruce Evans
cc3d522683 Unstaticize psratio and staticize profprocs. psratio needs to be exported
to trap.c to fix user profiling.
1996-06-23 17:40:47 +00:00
John Dyson
6ead3edd9c Clean-up the new VM map procfs code, and also add support for executable
format file "etype".  It contains a description of the binary type for
a process.
1996-06-18 05:16:00 +00:00
Bill Paul
8a095c52ed Add a couple of #ifdef DEVFS/#endif clauses to slence the following
compiler warnings which occur if you don't have 'options DEVFS' in
your kernel config file:

../../kern/kern_descrip.c: In function `fildesc_drvinit':
../../kern/kern_descrip.c:1103: warning: unused variable `fd'
../../kern/kern_descrip.c: At top level:
../../kern/kern_descrip.c:1095: warning: `devfs_token_stdin' defined but not use
d
../../kern/kern_descrip.c:1096: warning: `devfs_token_stdout' defined but not us
ed
../../kern/kern_descrip.c:1097: warning: `devfs_token_stderr' defined but not us
ed
../../kern/kern_descrip.c:1098: warning: `devfs_token_fildesc' defined but not u
sed
1996-06-17 16:54:03 +00:00
Bruce Evans
f0ea07bffb Reduced nesting of #includes in random.h and adjusted isa/random_machdep.c
to match (pc98/random_machdep.c probably requires a similar change).  This
is a problem area for the PC98 merge - all PC98 ifdefs in <machine/*.h> are
kludges to work around incorrect layering.
1996-06-17 16:47:43 +00:00
Bruce Evans
43be698cb6 Moved initialization of defaults for the label for the whole disk from
disklabel(8) to the kernel (dsopen()).  Drivers should initialize the
hardware values (rpm, interleave, skews).  Drivers currently don't do
this, but it usually doesn't matter since rotational position stuff is
normally disabled.
1996-06-17 14:43:54 +00:00
John Dyson
23fd45be00 Disable direct writes for non-blocking output. 1996-06-17 05:15:01 +00:00
Satoshi Asami
ad63a118b2 The Great PC98 Merge.
All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.

Ok'd by:	core
Submitted by:	FreeBSD(98) development team
1996-06-14 11:02:28 +00:00
Satoshi Asami
d7629dff3b A fast memory copy for Pentiums using floating point registers.
It is called from copyin and copyout.

The new routine is conditioned on I586_CPU and I586_FAST_BCOPY, so you
need

options "I586_FAST_BCOPY"

(quotes essenstial) in your kernel config file.

Also, if you have other kernel types configured in your kernel, an
additional check to make sure it is running on a Pentium is inserted.
(It is not clear why it doesn't help on P6s, it may be just that the
 Orion chipset doesn't prefetch as efficiently as Tritons and friends.)

Bruce can now hack this away. :)
1996-06-13 07:17:21 +00:00
Joerg Wunsch
6b1d48f79c Externalize the declaration of dc_list. This is required in order to
get a ``generic'' kernel (``config kernel swap generic'') to compile.
1996-06-12 15:10:30 +00:00
Gary Palmer
c23670e294 Clean up -Wunused warnings.
Reviewed by:		bde
1996-06-12 05:11:41 +00:00
John Dyson
47dcd2e56c Change the symbol name used in the last commit from USRSTACK to
VM_MAXUSER_ADDRESS.  Even though they are the same, the new name
is more descriptive.
1996-06-11 23:50:48 +00:00
John Dyson
9a0a69469d Get rid of the unneeded upper address space. 1996-06-11 23:05:26 +00:00
Nate Williams
1c346c7092 Implemented 'kern_sysctl', which differs from 'userland_sysctl' in that
it assumes all of the data exists in the kernel.  Also, fix
sysctl_new-kernel (unused until now) which had reversed operands to
bcopy().

Reviewed by:	phk

Poul writes:
... actually the lock/sleep/wakeup cruft shouldn't be needed in the
kernel version I think, but just leave it there for now.
1996-06-10 16:23:42 +00:00
Bruce Evans
7a60d58aee Updated some comments in settimeofday(). 1996-06-08 11:55:32 +00:00
Bruce Evans
604396ff31 Fixed accumulation of run time for processes that don't accumulate
any statclock ticks.  Pretend that all the time up to the first
statclock tick is system time.  .  This makes a difference mainly for
benchmarks that test short-lived processes - the user and system
times for processes that each lived for about 1ms only added up to
about 10% of the real time even when there was very little interrupt
activity.

Break the printing of a quad_t variable correctly.
1996-06-08 11:48:28 +00:00
Bruce Evans
5e0fc49ea8 Replaced some memcpy()'s by bcopy()'s.
gcc only inlines memcpy()'s whose count is constant and didn't inline
these.  I want memcpy() in the kernel go away so that it's obvious that
it doesn't need to be optimized.  Now it is only used for one struct
copy in si.c.
1996-06-08 08:18:00 +00:00
Poul-Henning Kamp
3ce93e4e80 Fix the same problem that davidg fixed in -stable some days ago and
restructure sysctl stuff a bit.  KERN_PROC_PID now uses pfind().
1996-06-06 17:19:21 +00:00