Commit Graph

2060 Commits

Author SHA1 Message Date
Justin T. Gibbs
c135d93bbf aic7xxx.c:
Print out the length of the compiled sequencer program.

aic7xxx.seq:
	More optimizations.  Replace generic bcopy routine with bcopy_3
and bcopy_4 (ie unroll the loops) since these are the only two cases used.
Initialize SIMODE1 and SXFRCTL1 from the kernel in ahc_init instead of
at each selection/reselection since this is expensive and only needs to
be done once.  Condense function returns into previous instruction if possible.
Reorder some sections to kill superflous jumps.  These optimizations kill
the ~150k/s penalty adding support for Twin/Wide cards was costing since
the last place in the commaon path of execution where we had to do ugly,
convoluted testing for the type of card in the sequencer has gone away.
Next stop tagged queuing and target mode.
1995-01-22 00:46:53 +00:00
Bruce Evans
1a0518966d Don't use mi_switch() to terminate cpu_exit(). Calling it just happened to
work (mi_switch() counted the last timeslice again but this didn't affect
the exiting process' rusage because the rusage has already been finalized).

Remove stale comment.
1995-01-21 15:34:03 +00:00
Bruce Evans
cee6d3700d Remove unused definitions of vm statistics counters. Most of the
counting is now done in C.  There are still about 100 unused
definitions for other things.
1995-01-21 15:22:28 +00:00
Bruce Evans
e6891db8c5 Don't count context switches here, they are already counted in mi_switch(). 1995-01-21 15:20:23 +00:00
Bruce Evans
d7e3a89f1f Don't count the parent's previous timeslice in the child's resource usage
(it was counted twice).

Set the start time more accurately.
1995-01-21 15:08:57 +00:00
Bruce Evans
54c2af254d #Include <sys/types.h> so that <sys/resource.h> can be #included without
explicitly #including <sys/types.h>.  Some gnu software (?gdb) depends on
this and broke when I fixed <stdio.h> to not include <sys/types.h>.

Bruce
1995-01-21 14:58:25 +00:00
Bruce Evans
a2562ad917 Keep track of open devices better to avoid closing the console device when
the physical device is closed.  Previously only the reverse case was handled.
Abuse the cdevsw interface instead of the vfs interface to do this.

Remove unnecessary #includes.
1995-01-21 14:12:15 +00:00
Andrey A. Chernov
60efec1dab Restore original fix from ohki, not check m for NULL it is already done
in the code above.
Submitted by: ohki@gssm.otsuka.tsukuba.ac.jp
1995-01-21 06:32:26 +00:00
Andrey A. Chernov
f76c8e8cc3 Change if (m->valid == 0) to if (m && m->valid == 0) 1995-01-20 23:30:42 +00:00
Bill Paul
fc042b6935 Submitted by: ohki@gssm.otsuka.tsukuba.ac.jp
When using cp to copy a file under the following circumstanes:

- original file in on an NFS filesystem
- destination file is on the same NFS filesystem
- the file is less than 8Mbytes in size
- the file is larger than 65536 bytes in size

the cp process can get frozen in device-wait and never wake up (cp uses
mmap() in this case).
A small change to allocbuf() fixes this.
1995-01-20 20:11:31 +00:00
Søren Schmidt
02fb646de1 Second round in syscons update:
Support for pseudo graphic mouse cursor (not complete yet)
Some cheap speed fixes.
More cleanups.
Call ourselves scxxxx finally.
1995-01-20 08:35:32 +00:00
Bill Paul
f06a45ddd7 Removed hardcoded definition for RB_SERIAL that I left in my accident
(had it there for testing purposes). RB_SERIAL should be found in
<sys/reboot.h>.
1995-01-20 07:52:42 +00:00
Bill Paul
f778c9da00 Submitted by: Bill Paul (wpaul@ctr.columbia.edu)
Obtained from:
bios boot block changed to allow booting from both the attached graphics
display and from a serial port. (A specially compiled serial boot block
is no longer necessary.) The boot block should detect the presence or
absence of a keyboard: if there is no keyboard, COM1 is turned into the
console. This simulates the behavior of the Sun boot PROMs. Unplug your
keyboard, attach a terminal to COM1 and you should be ready to go. :)
1995-01-20 07:48:27 +00:00
Bill Paul
2b237b4058 Submitted by: Bill Paul (wpaul@ctr.columbia.edu)
Obtained from:
sio.c and sioreg.c changed to allow autodetecting the RB_SERIAL flag
passed by the boot blocks so that the kernel can switch to 'serial
console' mode automagically. 'options COMCONSOLE' can still be specified
to force the kernel to always use the serial port as a console.
CONUNIT and CONADDR can also be specified in the kernel config file
if the user wants to shift the console to a different port.
1995-01-20 07:34:18 +00:00
Bill Paul
c665f1dabd Submitted by: Bill Paul (wpaul@ctr.columbia.edu)
Obtained from:
Added a new flag (RB_SERIAL) which is passed by the boot block to tell
the kernel that it should use a serial port as a console. (The kernel
can still be forced to boot in serial console mode if 'options COMCONSOLE'
is used.)
1995-01-20 07:28:47 +00:00
Andreas Schulz
c82762a9c3 Submitted by: Bruce Evans
Put in the much shorter and cleaner version for the calibrate_cycle_counter
for the Pentium that Bruce suggested. Tested here on my Pentium  and
it works okay.
1995-01-19 22:05:27 +00:00
Andreas Schulz
a4ef0a998a Add the missing forward declaration of chopen. Reported in the
mailinglists some time ago.
1995-01-19 21:02:54 +00:00
Peter Dufault
c3280a6d1a Remove dup biodone and no more SCSIUSER option. 1995-01-19 12:41:36 +00:00
Peter Dufault
8d38e0afd0 Print out exactly what we think the board is, and for the latest
rev Adaptec boards enable data transfer length detection instead
of assuming requested amount of data is transferred.
1995-01-19 12:33:10 +00:00
Jordan K. Hubbard
0b3782714e Enable floppy-tape controller by default again. Flags no longer has any
special meaning.
1995-01-17 17:32:33 +00:00
Bruce Evans
2d2fb1bf6b The %eflags checking introduced in the previous commit was too zealous.
sigreturn() sometimes failed for ordinary returns from signal handlers.
Failures of ordinary returns "can't happen" and are badly handled.
"Temporary" fix: allow users to corrupt PSL_RF.  This is fairly
harmless.  A correct fix would involve saving the old %eflags (and
perhaps the old segment registers) where the user can't get at them.
1995-01-17 01:15:12 +00:00
Joerg Wunsch
988fa8efe3 Roll in my changes to make the cd9660 code understand the older
(original "High Sierra") CD format.  I've already implemented this for
1.1.5.1 (and posted to -hackers), but didn't get any response to it.
Perhaps i'm the only one who has such an old CD lying around...

Everything is done empirically, but i had three of them around (from
different vendors), so there's a high probability that i've got it
right. :)
1995-01-16 17:03:29 +00:00
Justin T. Gibbs
87cf6d44c7 Add $Ids. Use DMA for downloading SCBs to the sequencer. Implement SDTR,
WDTR, and message reject handlers so they don't need to exist in the
sequencer.  All three of these cases are not on the critical path, so it
makes little sense to use up precious sequencer ram for them.
1995-01-16 16:33:47 +00:00
Justin T. Gibbs
344e176820 Add $Id. Recognize motherboard aic7870 based controllers. 1995-01-16 16:31:57 +00:00
Justin T. Gibbs
f61afda9a4 Add $Id 1995-01-16 16:31:34 +00:00
Justin T. Gibbs
0d56403998 At $Ids to all files. Have the sequencer use DMA to tranfer its SCB
(SCSI control block) instead of having the host PIO it down.  Also
reimplement WDTR and SDTR optimization to remove code in the sequencer
and place the responsibility of knowing when to initiate SDTR or WDTR
on the kernel driver.  This vastly shortens the sequencer program yet
yeilds the same performance.
1995-01-16 16:31:21 +00:00
David Greenman
761dd66739 Attempt to close a hole using splhigh/splx. There still appears to be a
serious one in the same area that I don't have time to fix.
1995-01-15 09:35:58 +00:00
David Greenman
7082ec8aa5 Fixed some page table reference count problems; these changes may not be
complete, but should be closer to correct than before.
1995-01-15 09:06:23 +00:00
David Greenman
edfab85b1a Moved some splx's down a few lines in vm_page_insert and vm_page_remove
to make the locking a bit more clear - this change is currently a NOP
as the calls to those routines are already at splhigh().
1995-01-15 07:31:34 +00:00
Garrett Wollman
b60e6e6e9f Some fixes to device configuration, now that I've had a chance to do it
properly from the beginning:

	1) The `kern_devconf' struct should be a part of the driver's
	   `softc' structure (now it is).
	2) The `description' should say what the device actually is,
	   rather than just giving a model number (now it does).
	3) The device should be registered even if the probe fails, so
	   that it can be reconfigured later.
	4) For netifs, the device state should follow the IFF_UP flag.

Other network interfaces should follow this example.  (Please?)  Eventually
there should be a rundown routine doing the equivalent of setting IFF_UP
off, and perhaps more if warranted.
1995-01-15 00:18:17 +00:00
Bruce Evans
20415301cd Fix security holes in sigreturn(), ptrace() and procfs. sigreturn()
attempted to check for insecure and fatal eflags and segment
selectors, but missed many cases and got the IOPL check back to
front.  The other syscalls didn't check at all.

sys_process.c, machdep.c:
Only allow PT_WRITE_U to write to the registers (ordinary and FP).

psl.h, locore.s, machdep.c:
Eliminate PSL_MBZ, PSL_MBO and PSL_USERCLR.  We are not supposed
to assume anything about the reserved bits.  Use PSL_USERCHANGE
and PSL_KERNEL instead.  Rename PSL_USERSET to PSL_USER.

exception.s:
Define a private label for use by doreti when returning to user
mode fails.

machdep.c:
In syscalls, allow changing only the eflags that can be changed on
486's in user mode (no longer attempt to allow benign IOPL changes;
allow changing the nasty PSL_NT; don't allow changing the i586
bits).

Don't attempt to check all the cases involving invalid selectors
and %eip's.  Just check for privilege violations and let the invalid
things cause a trap.

procfs_machdep.c:
Call the ptrace register functions to do all the work for reading
and writing ordinary registers and for single stepping.

trap.c:
Ignore traps caused by PSL_NT being set.  Previously, users could
cause a fatal trap in user mode by setting PSL_NT and executing an
iret, and a fatal trap in kernel mode by setting PSL_NT and making
a syscall.  PSL_NT was cleared too late and not in enough modes to
fix the problem.

Make all traps in user mode (except T_NMI) nonfatal.

Recover from traps caused by attempting to load invalid user
registers in doreti by restarting the traps so that they appear to
occur in user mode.
---

Fix bogons that I noticed while fixing the above:

psl.h:
Fix some comments.

Uniformize idempotency ifdef.

exception.s, machdep.c:
Remove rsvd[0-14].  rsvd0 hasn't been reserved since the 486 came
out.  Replace rsvd0 by `align'.  rsvd[0-11] used wrong (magic
non-unique) trap numbers.  Replace rsvd[1-14] by rsvd.

locore.s:
Enable alignment check flag on 486's and 586's.

machdep.c:
Use a better type for kstack[].

Use TFREGP() to find the registers.

Reformat ptrace functions from SEF to something closer to KNF.

procfs_machdep.c:
The wrong pointer to the registers got fixed as a side effect.

Implement reading and writing of FP registers.

/proc/*/*regs now work (only) for processes that are in memory.

Clean up comments.

trap.c, trap.h:
Remove unused trap types.
1995-01-14 13:20:26 +00:00
Bruce Evans
3831ab07f8 Define some public labels for use by trap(). 1995-01-14 11:00:27 +00:00
Jordan K. Hubbard
9949564470 Remove bogus scd0 driver - I should have looked at LINT first, anyway. 1995-01-14 10:48:56 +00:00
Bruce Evans
3117fbd98e Enable define of CR0_AM to prepare for implementing alignment checking.
Uniformize idempotency ifdef.
1995-01-14 10:44:55 +00:00
Bruce Evans
c277f99332 Declare a real `struct fpreg' to prepare for implementing reading and
writing of FP regs for procfs.

Uniformize idempotency ifdef.
1995-01-14 10:41:41 +00:00
Bruce Evans
1e1a3d012d Remove reference to impossible trap type T_KDBTRAP. We don't support
watchpoints.

Uniformize idempotency ifdef.
1995-01-14 10:34:52 +00:00
Bruce Evans
9bf308efab Eliminate T_KDBTRAP, which will soon go away. It was only used for an
unreachable case label in kdb_trap().

Use the correct case labels in kdb_trap() so that normal ddb entry doesn't
print a message.

Change all printf's to db_printf's.  Now you can put a breakpoint at printf,
and ddb entry messages don't spam the syslog output.

Cosmetic:

Use ISPL() instead of magic numbers.

Don't compile the unused function kdb_kbd_trap().

Improve some asms.

Print the arg to Debugger().
1995-01-14 10:24:48 +00:00
Jordan K. Hubbard
d9584d768f Change DISTRIBUTION names. Also make bsd.doc.mk go to doc distribution,
not bin.  Hmmm.
1995-01-14 07:51:10 +00:00
David Greenman
92c385361b Add missing object_lock/unlock. 1995-01-14 04:58:53 +00:00
Jordan K. Hubbard
0dd1eea105 Put UCONSOLE back - I was wrong, it's still used in one last place.
Submitted by:	ollivier
1995-01-14 02:39:22 +00:00
Søren Schmidt
2a13b58b61 Oops, forgot one change when DDB is defined. 1995-01-13 17:13:13 +00:00
David Greenman
b9921222a2 Protect a qcollapse call with an object lock before calling. The locks
need to be moved into the qcollapse and rcollapse routines, but I don't
have time at the moment to make all the required changes...this will do
for now.
1995-01-13 13:30:24 +00:00
Andrey A. Chernov
b9937fcc84 Use (n - 1) in ESC [ xxx d and ESC [ xxx ` 1995-01-13 03:19:22 +00:00
Justin T. Gibbs
b6b99cabea Point dependancy to i386/scsi 1995-01-13 02:29:14 +00:00
Justin T. Gibbs
01ce9c8620 Point include to i386/scsi 1995-01-13 02:27:08 +00:00
Justin T. Gibbs
deefdf55f5 Generic support for the entire aic7x70 line of adaptors. No one else
came up with a directory place ment more me, so now we have i386/scsi.
1995-01-13 02:24:31 +00:00
Justin T. Gibbs
451ab98ff3 Add in aic7770.c (EISA/VL Adaptors) and aic7870.c (PCI adaptor) dependancies
for the ahc driver.
1995-01-13 02:23:27 +00:00
Justin T. Gibbs
20c5e65572 Full support for 294x and Wide devices. Fixed month old bug in the SCSI
sense retrieval code that messed up CDROM devices.  This code will also
responde correctly to SDTR and WDTR messages from devices that start a
negotiation sequence.
1995-01-13 02:22:11 +00:00
Andrey A. Chernov
9db2473d62 Back out cursor wrap (restore original thing)
Submitted by: Bill Paul
1995-01-12 20:14:28 +00:00
Joerg Wunsch
dac0f2dbc1 Argl!, finally found this bummer. The code testing for a write-
protected drive at open() time has been *totally bogus*!  The guy who
submitted it didn't understand all the implications of calling
set_motor(), and the `who' who included the patch into the tree did it
blindly...  Pleeeeze, don't commit code to this driver unless you are
really going to understand what it does!  This one caused me to pull
out even more hears, and those who know me do know that i ain't got
too many o'them. :-)
1995-01-12 19:20:28 +00:00