Commit Graph

11347 Commits

Author SHA1 Message Date
bde
959a234634 Set p->p_switchtime to switchtime instead of to the current time in
fork_trampoline() if switchtime is valid.  This fixes not accounting
for the time between the previous context switch and and the current
time (when the forked child starts up here) in most cases - the time
is now counted in the child's runtime.  I think it actually fixes
all cases, and switchtime is always valid here, since there must have
been a context switch just before the forked child starts up.  Some
code should be removed if this is correct.  The check that switchtime
is valid sometimes gives a false negative because the check isn't
correct until the after the first context switch after the system
has been up for >= 1 second.
1998-07-28 17:55:37 +00:00
bde
09a9db632f Micro-optimized and cleaned up the clearing of switchtime in idle().
Cleaned up the conditionals in the disgusting SMP ifdef in idle().
1998-07-28 17:35:09 +00:00
bde
d7aa77e789 Fixed two spl nesting bugs. They caused (at least) the entire pageout
daemon to run at splvm() forever after swap_pager_putpages() is called
from vm_pageout_scan().

Broken in: rev.1.189 (1998/02/23)
1998-07-28 15:30:01 +00:00
jlemon
f3f6e5cc39 u_int --> unsigned int, remove (now unneeded) <sys/types.h> 1998-07-28 15:22:51 +00:00
dfr
ebdd0888b1 Record the new physical address of the pcb in pmap_swapin_proc.
Third attempt at pmap_remove().  This one actually works properly :-).
1998-07-28 09:34:50 +00:00
phk
f59d8bb706 I have a PD drive (Matsushita PD/CD Drive LF-1600).
The machine can not recognize this PD drive
as neither PD drive nor CD-ROM Drive.
So I can not use CD-ROMs and PDs from FreeBSD.

PR:		7423
Reviewed by:	phk
Submitted by:	Takura Koyama <takura@popweb.ne.jp>
1998-07-28 09:03:37 +00:00
jlemon
f4995111a0 Add wrappers for i386_*_ioperm, i386_vm86 so userland code does
not have to call sysarch() directly.
Added man pages for above, as well as sysarch()
1998-07-28 03:33:27 +00:00
jlemon
93c5ad9d9e Fix an off-by-one error when setting the iomap bits.
Change struct i386_*_iomap to use ints instead of shorts/chars.
  (pointed out by bde long ago, prodded into action by msmith)
1998-07-28 03:29:32 +00:00
alex
d48cc1feee Style fixes and a bug fix: don't remove the exit handler if unmount
fails.

Submitted by:	bde
1998-07-27 22:47:17 +00:00
bde
d3ce1542c8 Fixed double counting of runtime after a process exits. The last
timeslice of the exiting process was counted for both the exiting
process and the next process to run if the next process runs
immediately.

Broken in:	mostly in kern_clock.c rev.1.70 (1998/05/28)
1998-07-27 19:16:21 +00:00
jlemon
e2204441ea Extend cpl workaround so that it applies when we are returning to
user-mode as well as vm86 mode.
1998-07-27 16:51:33 +00:00
jlemon
d757cde4ed Re-arrange the page layout used by vm86_bioscall so that we can
potentially re-use the stack page.

Cosmetic cleanup of the code to de-obfuscate it and make it easier
to follow.  There should be no functional changes in this commit.
1998-07-27 16:45:05 +00:00
bde
1881ba1352 Made lazy syncing of timestamps for special files non-optional. 1998-07-27 15:37:00 +00:00
kato
7dbfcf7956 Sync with sys/i386/isa/diskslice_machdep.c revision 1.30. 1998-07-27 09:49:23 +00:00
dfr
93ab89b30e Macros for accessing alpha sparse device ports and memory. 1998-07-27 09:40:35 +00:00
dfr
bd66cc2399 Support the disabled keyword for isa devices. 1998-07-27 09:38:26 +00:00
dg
2b482f824a Only call m_reclaim() if M_WAIT since calling it from an interrupt can
cause problems.
PR:	7403
1998-07-27 03:59:48 +00:00
alex
be85829abc A better solution to the rm_at_exit problem: Register the exit function
during first mount.  Unregister the exit function at last unmount.

Concept by:	sef
Reviewed by:	sef
Implemented by:	alex
1998-07-27 01:07:01 +00:00
dfr
0668f6953d Fix a stupid bug preventing gdb from seeing the right value of 'v0'. 1998-07-26 18:47:47 +00:00
dfr
9c96ae361d Notify pmap when a page is freed on the alpha to allow it to clean up
its emulated modified/referenced bits.
1998-07-26 18:15:20 +00:00
dfr
03ddb15c2b Fix a stupid bug in the new pmap_remove().
Arrange for soft modified/referenced flags to be cleared when a page is freed.
1998-07-26 18:13:28 +00:00
bde
3b18043bd8 Don't pass the label to diskerr(), since the label is being constructed
and may be invalid.  In particular, d_secpercyl may be 0, and diskerr()
divides by it.
1998-07-25 16:35:06 +00:00
alex
4ab63c85e2 Override the default VFS LKM dispatch functions so that a module
unload function can be provided (this is necessary to unregister
the at_exit handler).
1998-07-25 15:52:44 +00:00
alex
4c90ac575d Allow VFS LKMs to override the default module dispatch functions if
VFS_LKM_NO_DEFAULT_DISPATCH is defined.
1998-07-25 15:52:10 +00:00
dfr
1b2d3de986 Make __weak_reference work on the alpha. 1998-07-25 14:37:37 +00:00
mjacob
a3b54b46a3 minphys means something different in FreeBSD than in NetBSD- not needed here and in the way 1998-07-25 04:48:25 +00:00
dfr
f424d5f084 Fix pmap_enter_quick() to stop it hanging when the level 2 pte exists
but isn't valid.

Reimplement pmap_remove() to be much more efficient at removing large
stretches of addresses.

As part of reimplementing pmap_remove() fix pmap_protect() so that it stands
a hope of working.
1998-07-24 09:43:27 +00:00
julian
c77c9fb18b Don't return an error if the magic number is not present.
Failing to probe is not an error, just a negative result.
1998-07-22 19:37:02 +00:00
dg
76fd38da9c Improved pager input failure message. 1998-07-22 09:38:04 +00:00
dfr
8414aaec0d Add a call to a platform-specific irq remapping function for alpha platforms
which don't record the correct irqs in PCI config space.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-22 08:40:46 +00:00
dfr
02ecd6d029 On the alpha, ports may be allocated above 64k.
Change the port address argument to pci_map_port to pci_port_t* which is
defined as u_int on the alpha, u_short on i386.  This is a stopgap with a
hopefully limited lifetime.

Discussed with: Stefan Esser <se@freebsd.org>
1998-07-22 08:39:08 +00:00
dfr
a573865db3 Add some very simple support for a compiled in (from config(8)) resource
database.
1998-07-22 08:35:52 +00:00
dfr
953622fb2a Add ISA support.
Remove mcclock hack which was only needed because ISA wasn't done yet.
1998-07-22 08:34:19 +00:00
dfr
15d5de14dc Add some convenience functions for accessing device memory.
Add a DDB command to allow access to inb/inw/inl from the debugger.
1998-07-22 08:33:30 +00:00
dfr
cc3eb8a152 Merge KN20AA support from Andrew Gallatin.
Add support for device memory access.
Add support for ISA irqs.
1998-07-22 08:32:17 +00:00
dfr
f103a50fde Move the mcclock from root to isa. 1998-07-22 08:30:25 +00:00
dfr
eb3dbdd0de Add a simple ISA bus. No support for memory mapped devices or DMA as yet. 1998-07-22 08:29:26 +00:00
dfr
9cb558a8da Add sio support. 1998-07-22 08:28:24 +00:00
dfr
8964f60d8e Add platform functions for manipulating PCI irqs.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-22 08:27:56 +00:00
dfr
9bc86e47bd Add declaration of {aquire,release}_timer2(). 1998-07-22 08:26:23 +00:00
dfr
b5978db404 Add macros and chipset support for accessing device i/o memory on the alpha. 1998-07-22 08:25:39 +00:00
dfr
5dfe812895 Add KN20AA support.
Add entries for syscons.
1998-07-22 08:24:39 +00:00
dfr
d2bedeabab Tweaks to stop config(8) warnings and to avoid an unfinished experiment of
mine.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-22 08:23:26 +00:00
dfr
90402a6db5 Support header for sysbeep() implementation. 1998-07-22 08:21:36 +00:00
dfr
db52332709 Make ptrace single steps over branches work as intended. 1998-07-22 08:20:57 +00:00
dfr
6651610ba2 Add support for sio's soft interrupts. 1998-07-22 08:20:15 +00:00
dfr
9249ba813d Support the DEC_KN20AA platform (AlphaStation 500 or 600).
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-22 08:19:39 +00:00
dfr
028c8a1c5b Merge changes from Andrew Gallatin to support different CIA based platforms.
Add code to identify and attach either serial or VGA console as appropriate.
1998-07-22 08:18:34 +00:00
dfr
385f0cb1c1 Add code from i386 to support sysbeep(). Doesn't work quite right but it
makes a noise.
1998-07-22 08:16:34 +00:00
dfr
dd7b21d1e7 Change siocn{put,get}c to siogdb{put,get}c to allow a serial console on one
line with serial debugging on another line.
1998-07-22 08:15:34 +00:00
phk
101e6d7c92 There is a comment in vm_param.h which doesn't belong to the
code still left in there.  The macros it describes disapeared some-
time since 4.4BSD lite.

PR:		7246
Reviewed by:	phk
Submitted by:	Stefan Eggers <seggers@semyam.dinoco.de>
1998-07-22 06:21:55 +00:00
kato
991631c4d1 Sync with sys/i386/i386/userconfig.c revision 1.105. 1998-07-21 12:07:49 +00:00
kato
f114fd095b Sync with sys/i386/conf/files.i386 revision 1.199. 1998-07-21 12:07:02 +00:00
kato
96af576b1e Sync with sys/i386/isa/diskslice_machdep.c revision 1.29. 1998-07-21 12:06:04 +00:00
msmith
bb5c239654 Add the 'cs' driver for Crystal Semiconductor CS89x0 devices. This
supports PnP and if_media.  I've been running a slightly older version
here for several weeks now.
Submitted by:	Maxim Bolotin <max@rsu.ru>
1998-07-20 20:00:43 +00:00
msmith
164c653979 Add support for PCNet PCI chips that only work when we talk to them as ISA
devices. Specifically fix the case for the Hitachi version as used in
their VisionBook models.

Submitted by:	Ted Faber <faber@isi.edu>
1998-07-20 17:33:01 +00:00
bde
8f5a35b01d Initialize more defaults for the in-core label for the whole disk.
Callers only need to initialize d_secperunit now, but should
initialize d_type (to reduce the IDE/SCSI confusion), d_typename
(put the disk model in it) and geometry info (if it isn't completely
ficticious).  Callers will soon need to initialize d_secsize.
1998-07-20 14:35:27 +00:00
bde
f1f93d2703 Cleaned up rev.1.39 - the shadowing variable should have just gone away. 1998-07-20 13:51:11 +00:00
bde
79b1340c5b Moved allocation of the slices struct to the right place. Initialize
everything in it (the devsw pointers were not initialized early or at
all for the !DEVFS case, but this was harmless on i386's).
1998-07-20 13:39:45 +00:00
dfr
fc4d618c2d Make sure the link level sockaddr size is rounded up correctly on alpha. 1998-07-20 13:21:56 +00:00
bde
6bdff03bd1 Backed out rev.1.43 (removed nonsense SLICE ifdef). SLICE is
normally only defined in opt_devfs.h, so testing it before including
anything is normally a no-op.  Undef'ing DEVFS before including
opt_devfs.h is similarly useless.  OTOH, DEVFS support for sliced
but not SLICEd (despite defined(SLICE)) devices is either harmless
(if there are no such devices, then nothing in this file is used)
or necessary (otherwise).  It even seems to work for sliced cd
devices.
1998-07-20 12:37:59 +00:00
julian
b2313fb5d3 Start cleaning up the aynchronous probing code for SLICE handlers. 1998-07-20 04:12:40 +00:00
kato
f2d843cbf5 Sync with sys/i386/isa/isa.c revision 1.113. 1998-07-19 15:04:26 +00:00
kato
56b9383d16 Sync with sys/i386/isa/fd.c revision 1.119. 1998-07-19 15:03:49 +00:00
jkh
d4548c1c49 A slap on the wrist to Dag-Erling, who plainly did not test this before
committing it.  There was a large syntax error at line 404 which could
not possibly have allowed compilation. :)
1998-07-19 11:12:14 +00:00
bde
39d6cd0751 Stop physical DMA for the non-auto case in isa_dmadone(). This fixes a
small part of a bug suite beginning in the SLICE probes but mostly in the
floppy driver.  This is a quick fix: the auto case shouldn't be special;
DMA should also be stopped in isa_dma_release(); isa_dmastop() probably
shouldn't exist; common DMA registers should not be accessed without
locking.
1998-07-19 04:22:55 +00:00
alex
22c2ae2a77 Don't log ICMP type and subtype for non-zero offset packet fragments. 1998-07-18 23:27:15 +00:00
des
88f64384b3 Allow dump devices with dkpart != SWAP_PART on devfs/slice
systems. This test should probably be removed altogether.

See CVS log entries for revisions 1.97 and 1.98.
1998-07-18 21:42:55 +00:00
fenner
c45b137a7b Undo rev 1.41 until we get more details about why it makes some systems
fail.
1998-07-18 18:48:45 +00:00
bde
7466f92c1a Fixed error handling after a seek error that can't happen. When the
controller reports a successful seek, it is very unlikely to report
seeking to a cylinder other than the one requested, but we check for
this, and botched the error handling for the requested_cylinder != 0
case.  This error happened when the bug fixed in rev.1.52 of <sys/buf.h>
caused the head of buffer queue to change to one starting on a different
cylnder - the requested cylinder was found, but it wasn't what we
thought we requested.  The fix is simply to arrange to reset the state
machine.

Corruption of the buffer queue seems to only have been a problem in the
floppy driver.  Other drivers dequeue the head of the queue before doing
physical i/o on it, so the corruption at worse broke the elevator sort
order.  Dequeueing breaks it anyway.
1998-07-18 03:15:33 +00:00
joerg
701b445509 Place a fat warning that floppy tapes should be configured as drive 2
only (normally).

PR:		kern/7176
1998-07-17 06:45:26 +00:00
gibbs
a0f37891cd Correct SEEPROM checksum calculation when multiple checksum attemps are made.
Pointed out by:	"Jose M. Alcaide" <jose@we.lc.ehu.es>
1998-07-16 19:33:43 +00:00
dfr
024928fa98 Simplify access to PCI config registers. 1998-07-16 13:38:35 +00:00
kato
4ec71fc104 Merge from sys/i386/isa/syscons.c (1.265->1.266). 1998-07-16 10:29:11 +00:00
kato
cf1246d9d5 Sync with sys/i386/isa/fd.c revision 1.118. 1998-07-16 10:27:49 +00:00
kato
2092b7604a Sync with sys/i386/i386/userconfig.c revision 1.104. 1998-07-16 10:26:59 +00:00
kato
c628afbbc2 Sync with sys/i386/isa/pcaudio.c revision 1.42. 1998-07-16 10:25:50 +00:00
dfr
e5c5e26ecc Point at the right place for alpha registers. 1998-07-15 20:18:00 +00:00
dfr
43439d1572 Make ptrace work. 1998-07-15 20:16:28 +00:00
dfr
988e0b33fd Tweaks for cross-building from NetBSD/alpha.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
1998-07-15 20:12:54 +00:00
dfr
583ae31e95 Add some debug code. 1998-07-15 20:07:33 +00:00
dfr
f14b57be26 An mc146818a clock attached to an isa bus. 1998-07-15 19:21:31 +00:00
dfr
0b4d04df93 Linker script for alpha kernel. 1998-07-15 19:19:24 +00:00
bde
8b2af4315e Changed %n to %r in devfs name format strings. %n has almost gone away. 1998-07-15 12:18:34 +00:00
bde
b38d9009d3 Don't cast pointers to longs in asm statements.
These asm statments are not quite as pessimal as when I complained
about them in rev.1.9 of audio.c.  They seem to be only 40% slower
than the C version on P5's and the same speed on K6's.
1998-07-15 11:47:58 +00:00
bde
b17aa4794d %n in a comment was a poor abbreviation for Immediate-byte-signed,
especially now that %n format has almost gone away.
1998-07-15 11:27:11 +00:00
bde
fab4cc7170 The ioctl request arg is unsigned log, so don't attempt to pass it
around as signed int.

Fixed printf format error for ioctl request arg hidden in ifdefed code.
1998-07-15 10:11:21 +00:00
bde
0d627f2ae9 The ioctl request arg is unsigned long, so don't attempt to pass it
around as signed int.
1998-07-15 09:59:31 +00:00
bde
fb75e06c3e Don't pretend to support ix86's with 16-bit ints by using longs
just to ensure 32-bit variables.
1998-07-15 09:38:10 +00:00
bde
06b8f50599 Don't cast pointers to longs in asms. Changed all remaining longs
to int32_t's and all unsigned longs to u_int32_t's.  Fixed the one
printf format broken by this.  The old math emulator now compiles
cleanly on i386's with 64-bit longs.  It may even work, provided
suword() doesn't actually write a long.
1998-07-15 09:01:18 +00:00
bde
259a90a05b Cast between longs and pointers via intptr_t. There shouldn't be
nearly so many casts here.  Casting an pointer that was an integer
back to an integer just to compare it with -1 is bad, and casting
it back just to compare it with NULL is just wrong.
1998-07-15 06:51:14 +00:00
bde
b21a1d7674 Cast between u_longs and object pointers via uintptr_t.
Access the entry address as a uintfptr_t, not as a long, and not
necessarily as what modload(8) passes (it takes a u_long from the
exec header and passes a u_int).
1998-07-15 06:39:12 +00:00
bde
3b46a89ac7 Cast between longs and pointers via intptr_t. The results of fuword()
should be checked before casting.  The results of suword() should be
checked.
1998-07-15 06:19:33 +00:00
bde
e006ba669f Cast longs to intptr_t before casting them to pointers.
Fixed bitrot in pseudo-declaration of `struct fcntl_args'.  fcntl()
is now broken in some cases when ints are larger than longs.
1998-07-15 06:10:16 +00:00
bde
99afdcef51 Cast pointers to intptr_t instead of or before casting to long.
Fixed bitrot in K&R support (suword() now takes a long word).
Didn't fix corresponding bitrot in store.9 and fetch.9.

The correct types for the store and fetch families are problematic.
The `word' functions are unfortunately named and need to be split
to handle ints/longs/object pointers/function pointers.  Storing
argv[] as longs is quite broken when longs are longer than pointers,
but usually works because it clobbers variables that will soon be
reinitialized.
1998-07-15 05:21:48 +00:00
bde
6d175fbd76 Cast u_longs to uintptr_t before casting them to pointers. Don't
attempt to even partially support systems with function pointers
larger than object pointers.
1998-07-15 05:00:26 +00:00
bde
74477c961e Cast function pointers to uintfptr_t before casting them to u_long.
Hopefully caddr_t is large enough to hold function pointers.

Cast object pointers to uintptr_t before casting them to u_long.

Types are wronger than usual for the PT_READ_U case.  ptrace() can
only return ints, but longs are accessed.
1998-07-15 04:43:49 +00:00
bde
bd9ef8a24a Cast pointers to [u]intptr_t instead of to [unsigned] long. 1998-07-15 04:17:55 +00:00
bde
26e0149674 Cast the value returned by strtoul() to a uintptr_t before casting
it to a pointer.  There's nothing better than strtoul() for reading
pointers from strings, but the range checking should be better.
1998-07-15 04:03:54 +00:00
bde
8478ec77bb Cast virtual addresses that happen to be represented as u_longs to
uintptr_t before casting them to pointers.  Explicit u_longs should
never be used to represent virtual addresses... (vm_offset_t is
normally right).
1998-07-15 03:58:57 +00:00