Commit Graph

2365 Commits

Author SHA1 Message Date
Poul-Henning Kamp
3bb24c35f2 Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:
Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h.

These two new copies are still intact copies of disklabel.h and
therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them
in programs which already include <sys.disklabel.h> is currently a
no-op.

This commit adds a number of such #includes.

Once I have verified that I have fixed all the places which need fixing,
I will commit the updated versions of the three #include files.

Sponsored by:   DARPA & NAI Labs.
2002-10-01 07:24:55 +00:00
Yoshihiro Takahashi
a92b303976 Call bus_set_resource() to set the ioport resource. 2002-09-30 16:41:47 +00:00
Yoshihiro Takahashi
7698537b29 Added some buggy PC-98 PnP cards support. 2002-09-29 13:31:26 +00:00
Yoshihiro Takahashi
a9efc762e3 Merged from sys/isa/fd.c revision 1.238. 2002-09-29 11:43:14 +00:00
Yoshihiro Takahashi
b47483f6b8 Merged from sys/dev/syscons/syscons.c revision 1.389. 2002-09-29 11:42:36 +00:00
Yoshihiro Takahashi
8bb39f7153 Merged from sys/dev/sio/sio.c revisions 1.380 and 1.381. 2002-09-29 11:41:48 +00:00
Yoshihiro Takahashi
ecf15560c7 MFi386: revisions 1.127, 1.128 and 1.129. 2002-09-24 03:17:38 +00:00
Yoshihiro Takahashi
9601a29654 Move the com_emr register definition to sioreg.h. 2002-09-24 02:35:57 +00:00
Yoshihiro Takahashi
1577b9e6dd Merged from sys/dev/sio/sio.c revision 1.379. 2002-09-24 02:26:55 +00:00
Yoshihiro Takahashi
fb82e755e5 MFi386: revisions 1.536 and 1.538. 2002-09-24 02:22:35 +00:00
Alfred Perlstein
4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00
Poul-Henning Kamp
e48fb743d8 Remove #ifdef/#endif 3 years after the stuff they protected was removed.
Spotted by:	peter.
2002-09-21 08:00:01 +00:00
Poul-Henning Kamp
7812d86f03 (This commit touches about 15 disk device drivers in a very consistent
and predictable way, and I apologize if I have gotten it wrong anywhere,
getting prior review on a patch like this is not feasible, considering
the number of people involved and hardware availability etc.)

If struct disklabel is the messenger: kill the messenger.

Inside struct disk we had a struct disklabel which disk drivers used to
communicate certain metrics to the disklayer above (GEOM or the disk
mini-layer).  This commit changes this communication to use four
explicit fields instead.

Amongst the benefits is that the fields do not get overwritten by
wrong or bogus on-disk disklabels.

Once that is clear, <sys/disk.h> which is included in the drivers
no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in,
the few places that needs them, have gotten explicit #includes for
them.

The disklabel inside struct disk is now only for internal use in
the disk mini-layer, so instead of embedding it, we malloc it as
we need it.

This concludes (modulus any mistakes) the series of disklabel related
commits.

I belive it all amounts to a NOP for all the rest of you :-)

Sponsored by:   DARPA & NAI Labs.
2002-09-20 19:36:05 +00:00
Poul-Henning Kamp
6fb3d70418 For reasons now lost in historical fog, the bounds_check_with_label()
function were put in i386/i386/machdep.c from where it has been
cut and pasted to other architectures with only minor corruption.

Disklabel is really a MI format in many ways, at least it certainly
is when you operate on struct disklabel.

Put bounds_check_with_label() back in subr_disklabel.c where it belongs.

Sponsored by:   DARPA & NAI Labs.
2002-09-20 17:51:00 +00:00
Poul-Henning Kamp
301147cd6a #include <sys/disk.h> to get disk_err() prototype.
Sponsored by:	DARPA & NAI Labs.
2002-09-20 17:40:49 +00:00
Poul-Henning Kamp
f90c382c0c Make FreeBSD "struct disklabel" agnostic, step 311 of 723:
Rename diskerr() to disk_err() for naming consistency.

Drop the by now entirely useless struct disklabel argument.

Add a flag argument for new-line termination.

Fix a couple of printf-format-casts to %j instead of %l.

Correctly print the name of all bio commands.

Move the function from subr_disklabel.c to subr_disk.c,
and from <sys/disklabel.h> to <sys/disk.h>.

Use the new disk_err() throughout, #include <sys/disk.h> as needed.

Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs.

Remove unused disklabel members of softc for aac, amr and mlx, which seem
to originally have been intended for diskerr() use, but which only rotted
and got Copy&Pasted at least two times to many.

Sponsored by:   DARPA & NAI Labs.
2002-09-20 12:52:03 +00:00
Yoshihiro Takahashi
ef46d97a45 MFi386: revisions 1.534 and 1.535. 2002-09-19 13:42:11 +00:00
Peter Wemm
66422f5b7a Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
Yoshihiro Takahashi
5d52e42381 Merged from sys/isa/fd.c revisions 1.234, 1.235 and 1.236. 2002-09-16 07:39:47 +00:00
Yoshihiro Takahashi
14955691c1 Merged from sys/dev/sio/sio.c revision 1.378. 2002-09-16 07:14:02 +00:00
Yoshihiro Takahashi
49e387d30b Merged from sys/isa/syscons_isa.c revision 1.18. 2002-09-16 07:11:43 +00:00
Julian Elischer
4f0db5e08c Allocate KSEs and KSEGRPs separatly and remove them from the proc structure.
next step is to allow > 1 to be allocated per process. This would give
multi-processor threads. (when the rest of the infrastructure is
in place)

While doing this I noticed libkvm and sys/kern/kern_proc.c:fill_kinfo_proc
are diverging more than they should.. corrective action needed soon.
2002-09-15 23:52:25 +00:00
Juli Mallett
77c70ade18 Fill out two fields (si_pid, si_uid) in the siginfo structure handed back
to userland in the signal handler that were not being iflled out before, but
should and can be.

This part of sendsig could be slightly refactored to use an MI interface, or
ideally, *sendsig*() would have an API change to accept a siginfo_t, which
would be filled out by an MI function in the level above sendsig, and said MI
function would make a small call into MD code to fill out the MD parts (some
of which may be bogus, such as the si_addr stuff in some places).  This would
eventually make it possible for parts of the kernel sending signals to set up
a siginfo with meaningful information.

Reviewed by:	mux
MFC after:	2 weeks
2002-09-07 19:12:53 +00:00
Juli Mallett
9d05b77d4f Diff reduction in comments for filling the siginfo structure - refer to
filling in the POSIX parts, when doing the same thing in every port of
FreeBSD.
2002-09-07 18:56:18 +00:00
Peter Wemm
f7749f924c Automatically enable CPU_ENABLE_SSE (detect and enable SSE instructions)
if compiling with I686_CPU as a target.  CPU_DISABLE_SSE will prevent
this from happening and will guarantee the code is not compiled in.

I am still not happy with this, but gcc is now generating code that uses
these instructions if you set CPUTYPE to p3/p4 or athlon-4/mp/xp or higher.
2002-09-07 07:02:12 +00:00
Peter Wemm
31cdffc6d8 Take a shot at fixing up a whole stack of style and other embarresing
unforced errors that Bruce identified.  I have not yet addressed all of
his concerns.
2002-08-31 03:33:32 +00:00
Peter Wemm
447b3772dc Change hw.physmem and hw.usermem to unsigned long like they used to be
in the original hardwired sysctl implementation.

The buf size calculator still overflows an integer on machines with large
KVA (eg: ia64) where the number of pages does not fit into an int.  Use
'long' there.

Change Maxmem and physmem and related variables to 'long', mostly for
completeness.  Machines are not likely to overflow 'int' pages in the
near term, but then again, 640K ought to be enough for anybody.  This
comes for free on 32 bit machines, so why not?
2002-08-30 04:04:37 +00:00
Jake Burkholder
bafbd49201 Renamed poorly named setregs to exec_setregs. Moved its prototype to
imgact.h with the other exec support functions.
2002-08-29 06:17:48 +00:00
Philippe Charnier
93b0017f88 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:23:09 +00:00
Yoshihiro Takahashi
c6fe09e208 Merged from sys/dev/syscons/scvtb.c revision 1.9. 2002-08-22 13:24:00 +00:00
Yoshihiro Takahashi
35cf62d2a2 Merged from sys/dev/syscons/syscons.c revision 1.388. 2002-08-22 13:23:15 +00:00
Yoshihiro Takahashi
dacea73d13 Merged from sys/dev/syscons/syscons.c revisions 1.386 and 1.387. 2002-08-20 14:39:29 +00:00
Peter Wemm
f453022cd9 remove unit counts from atkbdc, pckbd, sc 2002-08-20 00:10:22 +00:00
Peter Wemm
ae05c598e1 de-count pckbd for pc98. This file is only compiled if NPCKBD was 1,
so the conditional compile should never have been used.
2002-08-20 00:05:41 +00:00
Yoshihiro Takahashi
335794c03b MFi386: revisions 1.354 and 1.356.
Remove the mpt driver entry.
2002-08-13 12:25:01 +00:00
Matt Jacob
9b63136347 Add support for the LSI-Logic Fusion/MP architecture.
This is an architecture that present a thing message passing interface
to the OS. You can query as to how many ports and what kind are attached
and enable them and so on.

A less grand view is that this is just another way to package SCSI (SPI or
FC) and FC-IP into a one-driver interface set.

This driver support the following hardware:

LSI FC909:	Single channel, 1Gbps, Fibre Channel (FC-SCSI only)
LSI FC929:	Dual Channel, 1-2Gbps, Fibre Channel (FC-SCSI only)
LSI 53c1020:	Single Channel, Ultra4 (320M) (Untested)
LSI 53c1030:	Dual Channel, Ultra4 (320M)

Currently it's in fair shape, but expect a lot of changes over the
next few weeks as it stabilizes.

Credits:

The driver is mostly from some folks from Jeff Roberson's company- I've
been slowly migrating it to broader support that I it came to me as.

The hardware used in developing support came from:

	FC909: LSI-Logic, Advansys (now Connetix)
	FC929: LSI-Logic
	53c1030: Antares Microsystems (they make a very fine board!)

MFC after:	3 weeks
2002-08-11 23:34:20 +00:00
Brooks Davis
05c872ad62 Make ppp(4) devices clonable and unloadable. 2002-08-09 15:30:48 +00:00
Marc Fonvieille
c0727dcbfe Fix the link to the Handbook 2002-08-01 17:21:18 +00:00
Peter Wemm
93c9745e20 gethints.awk is a machine-specific 4.x->5.x transition aid. We cannot
use a common one because pc98 has got very different values.  This only
needs to exist on platforms that existed under 4.x.
2002-07-26 03:52:30 +00:00
Peter Wemm
b618108fff de-count pci 2002-07-23 06:38:47 +00:00
Peter Wemm
4c8b385244 Add units to card, wdc, wcd, wst and wfd 2002-07-21 23:29:00 +00:00
Peter Wemm
fc147d7fe9 Add explicit unit count on 'device pci' for ahc/ahd 2002-07-21 23:07:31 +00:00
Peter Wemm
a9aa1a970f Use pmap_kenter() rather than vtopte() and bashing the page tables
directly.
2002-07-18 00:42:53 +00:00
Yoshihiro Takahashi
f4189d4022 MFi386: revision 1.524. 2002-07-17 12:43:52 +00:00
Yoshihiro Takahashi
b57fa59aa8 MFi386: revision 1.350. 2002-07-17 12:42:37 +00:00
Yoshihiro Takahashi
5d4a0e12ca Check return status from fd_in() function. 2002-07-16 14:34:38 +00:00
Mark Murray
e9b24da3d5 Retire the perl gethints.conf in favour of an awk version. Move
the awk version to a central place for maintenance.

Submitted by:	Cyrille Lefevre <cyrille.lefevre@laposte.net>
2002-07-16 09:28:25 +00:00
KATO Takenori
248309d434 MFi386: sys/i386/i386/machdep.c revision 1.522. 2002-07-14 09:33:26 +00:00
Alfred Perlstein
f0eb293e88 Move COMPAT_FREEBSD4 to arch-neutral sys/conf/NOTES.
Add COMPAT_FREEBSD4 to GENERIC for arches that existed in FreeBSD 4's time,
not just i386. (alpha and pc98)

Requested by: bde
2002-07-13 16:43:53 +00:00
Peter Wemm
19981bcd54 s/procrunnable/kserunnable/ in a comment 2002-07-08 01:52:55 +00:00
Yoshihiro Takahashi
37bd31c6c7 MFi386: revision 1.521 2002-06-30 09:34:10 +00:00
Robert Watson
006f19e4f2 Remove ALT_BREAK_TO_DEBUGGER. This was inconsistent (both in form
and function) with existing configuration choices.  Arguably if
ALT_BREAK_TO_DEBUGGER was present, so should have been
BREAK_TO_DEBUGGER.  Regardless, it broke the option sort order in
these kernel configuration files.

Requested by:	bde
2002-06-30 04:12:21 +00:00
KATO Takenori
79804ff975 MFi386: sys/i386/i386/machdep.c rev. 1.520. 2002-06-25 09:10:38 +00:00
Yoshihiro Takahashi
b8391d6a1a Merged from sys/dev/sio/sio.c revisions 1.376 and 1.377. 2002-06-24 15:24:42 +00:00
KATO Takenori
0fc8183905 MFi386: sys/i386/isa/clock.c revision 1.187. 2002-06-24 08:04:47 +00:00
Yoshihiro Takahashi
f832bb8c37 MFi386: revisions from 1.342 to 1.344 2002-06-19 13:47:53 +00:00
Yoshihiro Takahashi
5463ee36b6 Backout previous change and merge from sys/dev/sio/sio.c revision 1.375. 2002-06-19 13:20:20 +00:00
Yoshihiro Takahashi
2240ad94a5 Merged from sys/isa/fd.c revision 1.233. 2002-06-19 13:17:43 +00:00
Nick Hibma
d8dbc77c56 Make the speed used by gdb over serial settable in the kernel configuration.
This facilitates the use in circumstances where you are using a serial
console as well. GDB doesn't support anything higher than 9600 baud (19k2
if you are lucky), but the console does.
2002-06-18 21:30:37 +00:00
Jens Schweikhardt
21dc7d4f57 Fix typo in the BSD copyright: s/withough/without/
Spotted and suggested by:	des
MFC after:	3 weeks
2002-06-02 20:05:59 +00:00
Yoshihiro Takahashi
8fed82b9af MFi386: revision 1.519 2002-05-14 12:31:47 +00:00
Yoshihiro Takahashi
3ffc9f0bff Merged from sys/isa/fd.c revisions from 1.229 to 1.232. 2002-05-14 12:30:52 +00:00
Yoshihiro Takahashi
0e053201b3 Merged from sys/dev/syscons/syscons.c revision 1.384 2002-05-14 12:29:34 +00:00
Juli Mallett
ea0b7a7699 Typo fix: detects -> detect.
Reviewed by:	phk
2002-05-03 17:59:25 +00:00
Poul-Henning Kamp
2266fe776e Don't export timecounter structures under debug. with sysctl, they
contain no truly interesting data anymore.
2002-04-30 19:34:31 +00:00
Peter Wemm
db17c6fc07 Tidy up some loose ends.
i386/ia64/alpha - catch up to sparc64/ppc:
- replace pmap_kernel() with refs to kernel_pmap
- change kernel_pmap pointer to (&kernel_pmap_store)
  (this is a speedup since ld can set these at compile/link time)
all platforms (as suggested by jake):
- gc unused pmap_reference
- gc unused pmap_destroy
- gc unused struct pmap.pm_count
(we never used pm_count - we track address space sharing at the vmspace)
2002-04-29 07:43:16 +00:00
Poul-Henning Kamp
7bf758bff0 Simplify the RFC2783 and PPS_SYNC timestamp collection API. 2002-04-26 20:24:28 +00:00
Poul-Henning Kamp
7e2d76ff05 Remove the tc_update() function. Any frequency change to the
timecounter will be used starting at the next second, which is
good enough for sysctl purposes.  If better adjustment is needed
the NTP PLL should be used.
2002-04-26 10:06:26 +00:00
Yoshihiro Takahashi
0b9a090051 MFi386: revision 1.339. 2002-04-25 13:32:56 +00:00
Yoshihiro Takahashi
5497ee0acf Merged from sys/dev/syscons/syscons.c revision 1.383 2002-04-25 13:25:36 +00:00
Maxime Henrion
d786139c76 Rework the kernel environment subsystem. We now convert the static
environment needed at boot time to a dynamic subsystem when VM is
up.  The dynamic kernel environment is protected by an sx lock.

This adds some new functions to manipulate the kernel environment :
freeenv(), setenv(), unsetenv() and testenv().  freeenv() has to be
called after every getenv() when you have finished using the string.
testenv() only tests if an environment variable is present, and
doesn't require a freeenv() call. setenv() and unsetenv() are self
explanatory.

The kenv(2) syscall exports these new functionalities to userland,
mainly for kenv(1).

Reviewed by:	peter
2002-04-17 13:06:36 +00:00
KATO Takenori
f11aa8f5ca MFi386: revision 1.517. 2002-04-11 09:45:41 +00:00
Poul-Henning Kamp
2ce7d7a033 GC various bits and pieces of USERCONFIG from all over the place. 2002-04-09 11:18:46 +00:00
Poul-Henning Kamp
67ec58a802 GC the "dumplo" variable, which is no longer used.
A lot of sys/*/*/machdep.c seems not to be.
2002-04-07 21:01:37 +00:00
Yoshihiro Takahashi
ba5c05f60b Merged from sys/dev/syscons/syscons.c revisions 1.381 and 1.382. 2002-04-06 06:47:23 +00:00
Yoshihiro Takahashi
58823205c4 Merged from sys/isa/fd.c revision 1.228. 2002-04-06 06:43:55 +00:00
Yoshihiro Takahashi
dda7d4dcec Merged from sys/dev/sio/sio.c revisions 1.370 and 1.371. 2002-04-06 06:19:10 +00:00
John Baldwin
6008862bc2 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
Bruce Evans
79065dba2a Moved signal handling and rescheduling from userret() to ast() so that
they aren't in the usual path of execution for syscalls and traps.
The main complication for this is that we have to set flags to control
ast() everywhere that changes the signal mask.

Avoid locking in userret() in most of the remaining cases.

Submitted by:	luoqi (first part only, long ago, reorganized by me)
Reminded by:	dillon
2002-04-04 17:49:48 +00:00
Ruslan Ermilov
12c79eb288 Dike out a highly insecure UCONSOLE option.
TIOCCONS must be able to VOP_ACCESS() /dev/console to succeed.

Obtained from:	OpenBSD
2002-04-03 10:56:59 +00:00
John Baldwin
c53c013bae - Move the MI mutexes sched_lock and Giant from being declared in the
various machdep.c's to being declared in kern_mutex.c.
- Add a new function mutex_init() used to perform early initialization
  needed for mutexes such as setting up thread0's contested lock list
  and initializing MI mutexes.  Change the various MD startup routines
  to call this function instead of duplicating all the code themselves.

Tested on:	alpha, i386
2002-04-02 22:19:16 +00:00
John Baldwin
44731cab3b Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
KATO Takenori
383519984f MFi386: revision 1.508. 2002-03-31 08:00:35 +00:00
Yoshihiro Takahashi
880d114c8a MFi386: revision 1.506. 2002-03-30 11:14:52 +00:00
KATO Takenori
f9c7a90bef MFi386: revision 1.507. 2002-03-27 11:29:40 +00:00
Matthew Dillon
d74ac6819b Compromise for critical*()/cpu_critical*() recommit. Cleanup the interrupt
disablement assumptions in kern_fork.c by adding another API call,
cpu_critical_fork_exit().  Cleanup the td_savecrit field by moving it
from MI to MD.  Temporarily move cpu_critical*() from <arch>/include/cpufunc.h
to <arch>/<arch>/critical.c (stage-2 will clean this up).

Implement interrupt deferral for i386 that allows interrupts to remain
enabled inside critical sections.  This also fixes an IPI interlock bug,
and requires uses of icu_lock to be enclosed in a true interrupt disablement.

This is the stage-1 commit.  Stage-2 will occur after stage-1 has stabilized,
and will move cpu_critical*() into its own header file(s) + other things.
This commit may break non-i386 architectures in trivial ways.  This should
be temporary.

Reviewed by:	core
Approved by:	core
2002-03-27 05:39:23 +00:00
Poul-Henning Kamp
d306122d60 Push BIO_FORMAT into a local hack inside the floppy drivers where
it belongs.
2002-03-26 19:16:37 +00:00
Yoshihiro Takahashi
9a545499fe Merged from sys/dev/sio/sio.c revisions 1.366 and 1.369. 2002-03-25 13:41:06 +00:00
Yoshihiro Takahashi
fd9fe3e748 Merged from sys/dev/syscons/syscons.c revision 1.379. 2002-03-25 13:34:37 +00:00
Yoshihiro Takahashi
2a461eb324 Fix style. 2002-03-25 12:44:03 +00:00
KATO Takenori
26b2476ba6 MFi386: revision 1.65. 2002-03-20 12:28:03 +00:00
KATO Takenori
68ee1c91c8 Remove __P. 2002-03-20 12:22:31 +00:00
KATO Takenori
237a429e22 Remove __P. 2002-03-20 11:52:56 +00:00
KATO Takenori
a3535ef8a4 MFi386: revision 1.505 (remove __P.) 2002-03-20 11:31:17 +00:00
KATO Takenori
eca3d78127 MFi386: revision 1.504. 2002-03-20 11:15:05 +00:00
KATO Takenori
881cfd8387 MFi386: revision 1.503. 2002-03-20 11:13:41 +00:00
Yoshihiro Takahashi
d679987554 Use the dx register for the destination port address. A immediate port
address of outb is only 8 bits.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
MFC after:	3 days
2002-03-13 13:59:41 +00:00
Yoshihiro Takahashi
e454a5425b MFi386: revision 1.502 2002-03-13 13:45:00 +00:00
Yoshihiro Takahashi
369bbb548d Free allocated buffer at siodetach().
MFC after:	3 days
2002-03-10 07:22:42 +00:00
Yoshihiro Takahashi
2bc5801e8c MFi386: revision 1.501 2002-03-10 06:19:37 +00:00
Yoshihiro Takahashi
1de04d6919 - The pc98_ttspeedtab() function returns an error status instead of a divisor,
and sets a divisor to the third argument.
- The second argument of the pc98_set_baud_rate() function is changed from int
  to u_int.
2002-03-08 12:12:46 +00:00
Yoshihiro Takahashi
8a6d1ef4eb MFi386: revision 1.125 2002-03-08 11:38:00 +00:00
Yoshihiro Takahashi
47f470f8b5 MFi386: revision 1.498. 2002-03-02 13:19:22 +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
Poul-Henning Kamp
817988be19 Disksort will not "munge" requests, BIO_ORDERED or not, so remove
use of BIO_ORDERED.
2002-02-22 09:14:06 +00:00
Yoshihiro Takahashi
9090144b01 MFi386: revision 1.497 2002-02-20 05:09:57 +00:00
Yoshihiro Takahashi
aeda92b5f2 Add bus_space_unmap() and bus_space_free() functions to release
a bus_space_handle allocated by bus_space_subregion().
2002-02-18 13:44:46 +00:00
Yoshihiro Takahashi
9d139b79d4 - Split the routine to initialize a bus_space_handle into the separate
function.
- Only access a bus_space_handle if the resource type is SYS_RES_MEMORY or
  SYS_RES_IOPORT.
- Add the bus_space_subregion supports.
2002-02-17 09:16:45 +00:00
Yoshihiro Takahashi
911eb59369 MFi386: revisions 1.334 and 1.335 2002-02-16 13:13:22 +00:00
Yoshihiro Takahashi
35c1f59123 MFi386: revisions 1.495 and 1.496 2002-02-16 12:59:58 +00:00
Yoshihiro Takahashi
49d069f669 Fall through from AT_TYPE_DIRECT to AT_TYPE_CDROM.
Old ATAPI CD-ROM drives return 0 (direct-access) as the type of the device.

(The ata driver has the same problem.)

MFC after:	3 days
2002-02-11 05:46:25 +00:00
Yoshihiro Takahashi
c02cadfe2d Cosmetic changes. 2002-02-10 10:27:37 +00:00
Yoshihiro Takahashi
cbf2d0338e - Refine the iskanji1 function.
- Print continuous ascii characters at a time.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2002-02-10 10:15:41 +00:00
Yoshihiro Takahashi
a1e56a26b3 Fixed mouse cursor on a console.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2002-02-10 10:14:39 +00:00
Yoshihiro Takahashi
4d42fb0aab MFi386: revisions 1.493 and 1.494. 2002-02-08 11:14:16 +00:00
Julian Elischer
079b7badea Pre-KSE/M3 commit.
this is a low-functionality change that changes the kernel to access the main
thread of a process via the linked list of threads rather than
assuming that it is embedded in the process. It IS still embeded there
but remove all teh code that assumes that in preparation for the next commit
which will actually move it out.

Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
2002-02-07 20:58:47 +00:00
Bruce Evans
766f247a59 Use osigreturn(2) instead of sigreturn(2) plus broken magic for returning
from old signal handlers.  This is simpler and faster, and fixes (new)
sigreturn(2) when %eip in the new signal context happens to match the
magic value (0x1d516).  0x1d516 is below the default ELF text section,
so this probably never broken anything in practice.

locore.s:
In addition, don't build the signal trampoline for old signal handlers
when it is not used.

alpha:
Not fixed, but seems to be even less broken in practice due to more
advanced magic. A false match occurs for register #32 in mc_regs[].
Since there is no hardware register #32, a false match is only possible
for direct calls to sigreturn(2) that happen to have the magic number
in the spare mc_regs[32] field.
2002-02-03 09:13:58 +00:00
Bruce Evans
5c8d0a85b0 Improve the change in the previous commit: use a stub for osigreturn()
when it is not really used instead of unconditionalizing all of it.
2002-02-03 04:09:02 +00:00
Bruce Evans
55a9536b65 Compile osigreturn() unconditionally since it will always be needed on
some arches and the syscall table is machine-independent.  It was
(bogusly) conditional on COMPAT_43, so this usually makes no difference.

ia64: in addition:
- replace the bogus cloned comment before osigreturn() by a correct one.
  osigreturn() is just a stub fo ia64's.
- fix the formatting of cloned comment before sigreturn().
- fix the return code.  use nosys() instead of returning ENOSYS to get
  the same semantics as if the syscall is not in the syscall table.
  Generating SIGSYS is actually correct here.
- fix style bugs.

powerpc: copy the cleaned up ia64 stub.  This mainly fixes a bogus comment.

sparc64: copy the cleaned up the ia64 stub, since there was no stub before.
2002-02-01 15:44:03 +00:00
Yoshihiro Takahashi
593cedcce3 MFi386: revision 1.489. 2002-01-31 08:35:38 +00:00
Yoshihiro Takahashi
f9df78bb95 Changed iskanji[12] to inline functions. 2002-01-31 08:29:46 +00:00
Yoshihiro Takahashi
e523a353a2 Merged from sys/dev/sio/{sio.c,sio_isa.c} revisions 1.363 and 1.5,
respectively.
2002-01-31 08:26:45 +00:00
Yoshihiro Takahashi
cad5db6416 MFi386: revision 1.180 2002-01-31 04:28:52 +00:00
Yoshihiro Takahashi
ae610d1fc6 MFi386: revision 1.52 2002-01-31 04:22:20 +00:00
Yoshihiro Takahashi
a31b444c96 MFi386: revision 1.64 2002-01-18 03:33:52 +00:00
Yoshihiro Takahashi
afaabc227f Merged from sys/dev/sio/sio.c revisions from 1.360 to 1.362. 2002-01-18 03:30:22 +00:00
Yoshihiro Takahashi
403eaa1e44 MFi386: revision 1.487 2002-01-18 03:28:02 +00:00
Bruce Evans
846ac2266b Clear the single-step flag for signal handlers. This fixes bogus trace
traps on the first instruction of signal handlers.

In trap.c:syscall(), fake a trace trap if the single-step flag was set
on entry to the kernel, not if it will be set on exit from the kernel.
This fixes bogus trace traps after the last instruction of signal handlers.

gdb-4.18 (the version in FreeBSD) still has problems with the program in
the PR.  These seem to be due to bugs in gdb and not in FreeBSD, and are
fixed in gdb-5.1 (the distribution version).

PR:		33262
Tested by:	k Macy <kip_macy@yahoo.com>
MFC after:	1 day
2002-01-10 11:49:55 +00:00
Yoshihiro Takahashi
26449b8fd7 Merged from sys/dev/sio/sio.c revisions 1.354 and 1.358. 2002-01-06 09:54:50 +00:00
John Baldwin
c86b6ff551 Change the preemption code for software interrupt thread schedules and
mutex releases to not require flags for the cases when preemption is
not allowed:

The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent
switching to a higher priority thread on mutex releease and swi schedule,
respectively when that switch is not safe.  Now that the critical section
API maintains a per-thread nesting count, the kernel can easily check
whether or not it should switch without relying on flags from the
programmer.  This fixes a few bugs in that all current callers of
swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from
fast interrupt handlers and the swi_sched of softclock needed this flag.
Note that to ensure that swi_sched()'s in clock and fast interrupt
handlers do not switch, these handlers have to be explicitly wrapped
in critical_enter/exit pairs.  Presently, just wrapping the handlers is
sufficient, but in the future with the fully preemptive kernel, the
interrupt must be EOI'd before critical_exit() is called.  (critical_exit()
can switch due to a deferred preemption in a fully preemptive kernel.)

I've tested the changes to the interrupt code on i386 and alpha.  I have
not tested ia64, but the interrupt code is almost identical to the alpha
code, so I expect it will work fine.  PowerPC and ARM do not yet have
interrupt code in the tree so they shouldn't be broken.  Sparc64 is
broken, but that's been ok'd by jake and tmm who will be fixing the
interrupt code for sparc64 shortly.

Reviewed by:	peter
Tested on:	i386, alpha
2002-01-05 08:47:13 +00:00
Yoshihiro Takahashi
68eb13c9a1 Disabled the olpt driver temporarily to avoid 'repeat make_dev' panic. 2001-12-31 09:02:24 +00:00
Yoshihiro Takahashi
72e13bfb97 MFi386: revision 1.178 2001-12-22 01:35:44 +00:00
Yoshihiro Takahashi
f96a32ff7b MFi386: revision 1.124 2001-12-22 01:34:09 +00:00
Yoshihiro Takahashi
57ceceeafb Merged from sys/dev/syscons/syscons.c revision 1.377. 2001-12-22 01:32:32 +00:00
Yoshihiro Takahashi
5dcb00d324 cosmetic changes. 2001-12-22 01:30:19 +00:00
Yoshihiro Takahashi
f6145d9c69 MFi386: revision 1.179 2001-12-22 00:38:32 +00:00
Yoshihiro Takahashi
001f90205c MFi386: revision 1.486 2001-12-22 00:35:49 +00:00
Yoshihiro Takahashi
26f891b327 Merged from sys/isa/{fd.c,fdreg.h} revisions 1.222 and 1.15, respectively. 2001-12-16 09:00:03 +00:00
Ian Dowse
1cb4661d56 Enable UFS_DIRHASH in the GENERIC kernel.
Suggested by:	silby
Reviewed by:	dillon
MFC after:	5 days
2001-12-14 16:27:11 +00:00
Yoshihiro Takahashi
9cc62fb3d8 Fixed to draw mouse cursor. The syscons driver for PC98 uses different
attributes from i386.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
MFC after:	3 days
2001-12-14 15:27:15 +00:00
Yoshihiro Takahashi
f169825e02 MFi386: revision 1.485 (the previous commit is not completely) 2001-12-12 12:27:59 +00:00
John Baldwin
0bbc882680 Overhaul the per-CPU support a bit:
- The MI portions of struct globaldata have been consolidated into a MI
  struct pcpu.  The MD per-CPU data are specified via a macro defined in
  machine/pcpu.h.  A macro was chosen over a struct mdpcpu so that the
  interface would be cleaner (PCPU_GET(my_md_field) vs.
  PCPU_GET(md.md_my_md_field)).
- All references to globaldata are changed to pcpu instead.  In a UP kernel,
  this data was stored as global variables which is where the original name
  came from.  In an SMP world this data is per-CPU and ideally private to each
  CPU outside of the context of debuggers.  This also included combining
  machine/globaldata.h and machine/globals.h into machine/pcpu.h.
- The pointer to the thread using the FPU on i386 was renamed from
  npxthread to fpcurthread to be identical with other architectures.
- Make the show pcpu ddb command MI with a MD callout to display MD
  fields.
- The globaldata_register() function was renamed to pcpu_init() and now
  init's MI fields of a struct pcpu in addition to registering it with
  the internal array and list.
- A pcpu_destroy() function was added to remove a struct pcpu from the
  internal array and list.

Tested on:	alpha, i386
Reviewed by:	peter, jake
2001-12-11 23:33:44 +00:00
David E. O'Brien
6e551fb628 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
Matthew Dillon
66a11b9fb1 Allow maxusers to be specified as 0 in the kernel config, which will
cause the system to auto-size to between 32 and 512 depending on the
amount of memory.

MFC after:	1 week
2001-12-09 01:57:09 +00:00
Dag-Erling Smørgrav
88905abc3e PROCFS requires PSEUDOFS. 2001-12-04 11:48:16 +00:00
Yoshihiro Takahashi
de48920662 Split the sio driver for pc98 into bus front end and back end.
(merged from the files in sys/dev/sio)
2001-11-26 12:29:53 +00:00
Yoshihiro Takahashi
84909fb9f2 MFi386: revision 1.326. 2001-11-17 13:48:31 +00:00
Yoshihiro Takahashi
b69802ca41 MFi386: revision 1.483 2001-11-17 13:16:51 +00:00
Yoshihiro Takahashi
6a306bf3cd Use make_dev_alias() instead of call make_dev() twice. 2001-11-12 13:06:04 +00:00
Poul-Henning Kamp
e1a7c5c881 GC userconfig after Peter axed it 15 months ago. 2001-11-05 21:46:35 +00:00
Poul-Henning Kamp
0ac42ec512 Don't call cdevsw_add(). 2001-11-04 09:09:41 +00:00
Poul-Henning Kamp
20a3b67cb2 Rename the top 7 bits if disk minors to spare bits, rather than type bits. 2001-11-04 09:01:07 +00:00
Yoshihiro Takahashi
3f64e5a6c2 MFi386: sys/i386/i386/machdep.c revisions 1.481 and 1.482 2001-10-30 00:53:19 +00:00
Yoshihiro Takahashi
32e2324497 Removed pmc_isa_identify function. It is not needed.
Submitted by:	takawata
2001-10-28 04:16:50 +00:00
Jonathan Lemon
553b79aa63 cn_tab no longer exists, use cnadd() to add a console device. Note that
this may result in duplicate console output in some cases.
2001-10-24 18:30:05 +00:00
Yoshihiro Takahashi
6cac891491 Added the pmc driver which supports power management controller of
old NEC PC-98NOTE.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
MFC after:	1 week
2001-10-24 14:46:40 +00:00
Akio Morita
cfb3969378 fix broken `compat_atdisk'(replace raw device name with block device's).
Reviewed by:	nyan
MFC after:	3 days
2001-10-23 09:39:09 +00:00
Akio Morita
5f44a44380 Fix compile error of the case using `LINE30' option.
Reviewed by:	nyan
MFC after:	3 days
2001-10-23 08:54:50 +00:00
Warner Losh
d75c1b4a90 First commit after a repo copy of isa/sio* -> dev/sio:
Move sio from isa/sio.c to dev/sio/sio.c.  The next step is to break
out the front end attachments, improve support for these parts on
different busses, and maybe, if we're lucky, merging in pc98 support.
It will also be MI and live in conf/files rather than files.*.

Approved by: bde
Tested with: i386, pc98
2001-10-22 02:48:38 +00:00
Bruce Evans
7dd43330b3 Use the i386 version of npx.c. It has been merged with the pc98 version.
Approved by:	nyan
Not tested by:	bde
2001-10-21 06:14:12 +00:00
Matt Jacob
8c7c272c5a Remove wx. 2001-10-20 18:50:31 +00:00
Yoshihiro Takahashi
00da2ef3cc MFi386: sys/i386/isa/npx.c revisions from 1.114 to 1.116 2001-10-19 12:30:16 +00:00
Yoshihiro Takahashi
f89c65e5ab Changed IO_NPXSIZE to 8 2001-10-19 12:24:45 +00:00
Yoshihiro Takahashi
0886808eda MFi386: sys/i386/isa/clock.c revision 1.177 2001-10-19 11:52:49 +00:00
Yoshihiro Takahashi
0db7b6f691 MFi386: sys/i386/isa/pcaudio.c revision 1.63 2001-10-19 11:50:00 +00:00
Yoshihiro Takahashi
2e8727d53d Merged from sys/isa/sio.c revisions from 1.344 to 1.347 2001-10-19 11:48:47 +00:00
Yoshihiro Takahashi
dee072b6ba MFi386: sys/i386/conf/GENERIC revision 1.320 2001-10-19 11:46:13 +00:00
Matt Jacob
aaeac4f6c3 Make SCSI changer and SES devices standard in generic kernels.
Reviewed by:	ken@kdm.org
2001-10-16 22:22:58 +00:00
Yoshihiro Takahashi
f2eeb19063 Rewrite the pc98 bus_space stuff.
The type of bus_space_tag_t is now a pointer to bus_space_tag structure,
and the bus_space_tag structure saves pointers to functions for direct
access and relocate access.

Added bsh_bam member to the bus_space_handle structure, it saves access
method either direct access or relocate access which is called by
bus_space_* functions.

Added the mecia device support. If the bs_da and bs_ra in bus tag are set
NEPC_io_space_tag and NEPC_mem_space_tag respectively, new bus_space stuff
changes the register of mecia automatically for 16bit access.

Obtained from:	NetBSD/pc98
2001-10-07 10:04:18 +00:00
Robert Watson
e8a340cd9a o Modify pc98 syscons code to use securelevel_gt() instead of
direct variable checks.  (Yet another API to perform direct hardware I/O).

Obtained from:	TrustedBSD Project
2001-09-26 20:26:32 +00:00
Brooks Davis
2f65332817 The faith(4) device is no longer a count device so don't specify a count. 2001-09-25 18:56:40 +00:00
Yoshihiro Takahashi
17be0bb430 - Added #include <sys/systm.h>
- Cosmetic change
2001-09-24 06:41:06 +00:00
David E. O'Brien
090905a55c + Fix misplacement of `txp'
+ Document our -CURRENT debugging bits
2001-09-24 03:23:48 +00:00
Peter Wemm
eb25edbda3 Cleanup and split of nfs client and server code.
This builds on the top of several repo-copies.
2001-09-18 23:32:09 +00:00
John Baldwin
659209e636 Whitespace fixes. 2001-09-18 21:05:04 +00:00
Yoshihiro Takahashi
aadcbac104 MFi386: sys/isa/fd.c revision from 1.205 to 1.219. 2001-09-16 12:39:59 +00:00
Yoshihiro Takahashi
07468e79b7 Allocate i/o and memory resources using gdc driver. 2001-09-16 12:38:39 +00:00
Yoshihiro Takahashi
21c8480091 MFi386: added comment for ed driver. 2001-09-16 05:34:34 +00:00
Yoshihiro Takahashi
11dbeb93db MFi386: cosmetic changes. 2001-09-16 05:34:05 +00:00
Yoshihiro Takahashi
096048af92 MFi386: sys/isa/sio.c revision 1.301, 1.336, 1.337, 1.338, 1.339 and 1.342.
Removed unnecessary PnP moden entries.
2001-09-16 05:33:07 +00:00
Yoshihiro Takahashi
accd559318 MFi386: sys/i386/isa/pcaudio.c revision 1.59 and 1.61. 2001-09-16 05:30:59 +00:00
Yoshihiro Takahashi
f058eb7562 MFi386: sys/i386/isa/mse.c revision 1.54 and 1.55. 2001-09-16 05:30:08 +00:00
Yoshihiro Takahashi
555c5bb9dd MFi386: sys/i386/isa/clock.c revision 1.175 and 1.176. 2001-09-16 05:29:27 +00:00
Yoshihiro Takahashi
dc27775f75 Added (commented out) ACPI attachment. 2001-09-16 05:28:16 +00:00
Yoshihiro Takahashi
6559a1844a MFi386: removed IDE_DELAY option. 2001-09-16 05:24:05 +00:00
Yoshihiro Takahashi
dd4c3e48b0 Merged from sys/i386/isa/pcaudio.c revision 1.62 (KSE changes). 2001-09-15 15:37:52 +00:00
Yoshihiro Takahashi
104ec74435 Merged from sys/i386/apm/apm.c revision 1.123 (KSE changes). 2001-09-15 15:33:28 +00:00
Warner Losh
4c1fc1b219 I don't think pc98 has acpi at all, so ifdef the acpi attachments for
now.
2001-09-15 00:03:32 +00:00
Warner Losh
a9649ce6be Merge sys/isa/sio.c 1.343
KSE changes

Reviewed by: julian, bde, jhb
2001-09-14 05:05:08 +00:00
Warner Losh
5fb0e81d8b Merge from sys/dev/syscons/syscons.c 1.373
kse changes

# Note: There are a number of trivial and non-trivial diffs between this and
# sys/dev/syscons/syscons.c that I didn't try to account for.

Reviewed by: julian, bde, jhb
2001-09-14 05:02:12 +00:00
Warner Losh
06da1def0c Merge from sys/i386/isa/sprk.c 1.50, 1.51
KSE changes and acpi attachment

Reviewed by: julian, bde, jhb
2001-09-14 04:58:30 +00:00
Warner Losh
2895a1020c Merge KSE changes from sys/dev/syscons/scterm-sc.c 1.17
# there are more "trivial" diffs in this file that have accumulated over time
# and I didn't try to fix those.

Reviewed by: julian, bde, jhb
2001-09-14 04:54:38 +00:00
Warner Losh
da4e3cd357 KSE changes for olpt driver
Reviewed by: julian, bde, jhb
2001-09-14 04:50:27 +00:00
Warner Losh
58be6f3ff5 Merged sys/i386/isa/npx.c 1.110, 1.111, 1.112 KSE
Reviewed by: julian, bde, jhb
2001-09-14 04:46:57 +00:00
Warner Losh
4417ce7d9e Changes necessary for KSE world
Reivewed by: julian, bde, jhb
2001-09-14 04:35:50 +00:00
Warner Losh
e8b6d44e89 Merge changes from sys/i386/isa/mse.c 1.56 and other tweaks for KSE
Reviewed by: julian, kde, jhb
2001-09-14 04:34:54 +00:00
Warner Losh
8ed1ddc825 Merge from sys/isa/fd.c 1.221 and a few minor tweaks to make compile
with the post KSE world.

Reviewed by: julian, bde, jhb
2001-09-14 04:30:39 +00:00
Warner Losh
2fb670e0b5 Merge from sys/i386/i386/machdep.c 1.480 (Julian's KSE changes)
Reviewed by: julian, bde, jhb
2001-09-14 04:27:42 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
KATO Takenori
d92580b608 Merged from sys/i386/i386/machdep.c revision 1.479. 2001-09-12 08:15:24 +00:00
Peter Wemm
cfbf880deb Zap #if 0'ed map init code that got moved to the MI area.
Convert the powerpc tree to use the common code.
2001-09-04 08:42:35 +00:00
Takeshi Shibagaki
5f5e1ff3b1 Always turned on 8bit access card support for the fe driver
both i386/pc98, so options FE_8BIT_SUPPORT was deleted.

Reviewed by: nyan
2001-09-02 13:05:00 +00:00
Peter Wemm
76cb0cadf1 Enable hardwiring of things like tunables from embedded enironments
that do not start from loader(8).
2001-08-27 05:11:53 +00:00
Peter Wemm
268bdb43f9 Optionize UPAGES for the i386. As part of this I split some of the low
level implementation stuff out of machine/globaldata.h to avoid exposing
UPAGES to lots more places.  The end result is that we can double
the kernel stack size with 'options UPAGES=4' etc.

This is mainly being done for the benefit of a MFC to RELENG_4 at some
point.  -current doesn't really need this so much since each interrupt
runs on its own kstack.
2001-08-25 02:20:02 +00:00
Peter Wemm
85ceedd60f Fix a #endif misplacement in 1.231 due to misapplied patch
Pointy hat to: peter
2001-08-23 01:50:31 +00:00
Peter Wemm
520f648f42 Merge i386/machdep.c rev 1.474: dont overextend %cs. (finally, it doesn't
conflict with unmerged changes)
2001-08-23 01:47:26 +00:00
Peter Wemm
2ddb1aff19 Merge i386/machdep.c rev 1.469: whitespace changes to fit 80 columns
Forgotten by: jhb
2001-08-23 01:46:23 +00:00
Peter Wemm
2fb7d2e4c2 Merge i386/machdep.c rev 1.468: make breakpoint/trace interrupt instead
of trap gates

Forgotten by: bde
2001-08-23 01:43:38 +00:00
Peter Wemm
10abeae984 Merge 386/machdep.c rev 1.467: fix bugs/miscalculations
Forgotten by:  iwasaki
2001-08-23 01:42:21 +00:00
Peter Wemm
b65110f80b Identical to i386/machdep.c rev 1.473: move submap initialization to MI. 2001-08-23 01:36:54 +00:00
Peter Wemm
60e562536f Merge i386/machdep.c rev 1.472: Fix bug in physmem_est and maxbcache
calculation

Forgotten by: dillon
2001-08-23 01:34:35 +00:00
Peter Wemm
748e7247a1 Merge i386/machdep.c rev 1.470. Limit KVM for buffer cache etc.
Forgotten by: dillon
2001-08-23 01:30:51 +00:00
Peter Wemm
3b703181e3 Dont compile in SSE fxsave/fxrstor instructions if CPU_ENABLE_SSE isn't
active.
2001-08-23 01:03:56 +00:00
Peter Wemm
e8ebc08f80 Make COMPAT_43 optional again. XXX we need COMPAT_FBSD3 etc for this
stuff.
2001-08-21 02:32:59 +00:00
John Baldwin
688ebe120c - Close races with signals and other AST's being triggered while we are in
the process of exiting the kernel.  The ast() function now loops as long
  as the PS_ASTPENDING or PS_NEEDRESCHED flags are set.  It returns with
  preemption disabled so that any further AST's that arrive via an
  interrupt will be delayed until the low-level MD code returns to user
  mode.
- Use u_int's to store the tick counts for profiling purposes so that we
  do not need sched_lock just to read p_sticks.  This also closes a
  problem where the call to addupc_task() could screw up the arithmetic
  due to non-atomic reads of p_sticks.
- Axe need_proftick(), aston(), astoff(), astpending(), need_resched(),
  clear_resched(), and resched_wanted() in favor of direct bit operations
  on p_sflag.
- Fix up locking with sched_lock some.  In addupc_intr(), use sched_lock
  to ensure pr_addr and pr_ticks are updated atomically with setting
  PS_OWEUPC.  In ast() we clear pr_ticks atomically with clearing
  PS_OWEUPC.  We also do not grab the lock just to test a flag.
- Simplify the handling of Giant in ast() slightly.

Reviewed by:	bde (mostly)
2001-08-10 22:53:32 +00:00
Peter Wemm
2aca0c28d3 Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
are a really nasty interface that should have been killed long ago
when 'ptrace(PT_[SG]ETREGS' etc came along.  The entity that they
operate on (struct user) will not be around much longer since it
is part-per-process and part-per-thread in a post-KSE world.

gdb does not actually use this except for the obscure 'info udot'
command which does a hexdump of as much of the child's 'struct user'
as it can get.  It carries its own #defines so it doesn't break
compiles.
2001-08-08 05:25:15 +00:00
Yoshihiro Takahashi
e993b51722 Merged from sys/dev/syscons/syscons.c revisions 1.370, 1.371 and 1.372. 2001-08-07 12:23:47 +00:00
Yoshihiro Takahashi
094d43411f Merged from sys/dev/syscons/scterm-sc.c revision 1.16. 2001-08-07 12:10:17 +00:00
Yoshihiro Takahashi
baa444b77e Removed PLIP support. 2001-07-31 03:39:35 +00:00
Yoshihiro Takahashi
f7827e0a6e Convert the olpt driver to using new-bus stuff. 2001-07-29 11:11:45 +00:00
Yoshihiro Takahashi
8ea2602a0d Merged from sys/dev/syscons/syscons.c revisions 1.367 and 1.368. 2001-07-29 10:52:07 +00:00
KATO Takenori
1419e0df32 Merged from sys/i86/isa/npx.c revision 1.107. 2001-07-28 13:08:31 +00:00
Peter Wemm
bd40659f85 Call the early tunable setup functions as soon as kern_envp is available.
Some things depend on hz being set not long after this.
2001-07-26 23:06:44 +00:00
Yoshihiro Takahashi
28b975bf3d Speed up console driver.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2001-07-26 03:07:07 +00:00
KATO Takenori
03b6f6e5ed Merged from sys/i386/conf/GENERIC revision 1.315. 2001-07-24 11:24:58 +00:00
Yoshihiro Takahashi
99df3e3b1a Integrate fdc.h into fd.c. 2001-07-23 13:07:24 +00:00
KATO Takenori
499438b356 Merged from sys/i386/isa/npx.c revision 1.106. 2001-07-19 09:07:19 +00:00
KATO Takenori
e6a23687f6 Merged from sys/i386/isa/npx.c revision 1.105. 2001-07-19 09:06:33 +00:00
KATO Takenori
efa1251026 Merged from sys/i386/i386/machdep.c revisions 1.462 and 1.464. 2001-07-19 08:51:08 +00:00
Yoshihiro Takahashi
2308cfa4fc Fixed conflict with sys/dev/syscons/syscons.h.
Submitted by:	yokota
2001-07-14 08:07:26 +00:00
Yoshihiro Takahashi
77663c3006 - Refine pc98 supports.
- Use bus_space stuff.
- Rename FDO_* -> FDC_* (obtained from NetBSD/pc98)
2001-07-14 04:19:09 +00:00
Yoshihiro Takahashi
cde2e82802 Added epson_inw function. 2001-07-14 04:14:29 +00:00
Yoshihiro Takahashi
c713c25620 Merged from the following changes.
sys/dev/syscons/scvgarndr.c revision  1.11
sys/dev/syscons/scvtb.c     revision  1.8
sys/dev/syscons/syscons.c   revisions 1.361, 1.363, 1.364, 1.365 and 1.366
sys/isa/atkbd_isa.c         revision  1.9
sys/isa/syscons_isa.c       revision  1.17
2001-07-14 03:26:02 +00:00
Yoshihiro Takahashi
dd080a65a2 Merged from sys/i386/conf/GENERIC revision 1.313. 2001-07-14 02:45:53 +00:00
Yoshihiro Takahashi
654739ff90 Added (commented out) audio driver. 2001-07-14 02:44:51 +00:00
Dima Dorfman
2e1b1231fc `pcn' supports AMD Am79C97x cards, not Am79C79x cards.
PR:		28946
Submitted by:	Ryuichiro Imura <imura@ryu16.org>
2001-07-13 13:34:08 +00:00
Peter Wemm
ad1b7ffaee Fix another missed pcb_savefpu reference (inside NPX_DEBUG) 2001-07-12 12:21:53 +00:00
Peter Wemm
adc3cb92c2 Apply the i386 SSE mods to pc98 as well. 2001-07-12 06:34:25 +00:00
Yoshihiro Takahashi
214de8c67f Added #include <sys/proc.h>
Submitted by:	Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
2001-07-10 09:59:52 +00:00
Yoshihiro Takahashi
3b2b0a59d0 Merged from sys/i386/i386/machdep.c revisions 1.459 and 1.460. 2001-07-07 04:06:04 +00:00
Matthew Dillon
0cddd8f023 With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage).  Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.
2001-07-04 16:20:28 +00:00
Yoshihiro Takahashi
f44a4f377e - Don't overwrite inb, inw and outw.
- Move the lance_probe function to if_lnc.c.
- Support C-NET(98)S again.

Submitted by:		chi@bd.mbn.or.jp (Chiharu Shibata) and nyan
No response from:	Paul Richards
2001-07-04 13:00:21 +00:00
Yoshihiro Takahashi
d22e161a15 Fixed warning message.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2001-07-02 10:18:56 +00:00
Warner Losh
1f94b9005c Don't need the .keep_me files. Obrien and I committed past each other.
Add 0-9 to the list of possible kernel names at matsushita-san's
suggestion.

Submitted by: Makoto MATSUSHITA-san <matusita@jp.FreeBSD.org>
2001-07-01 23:35:44 +00:00
David E. O'Brien
5e6ded4212 Ensure sys/${MACHINE}/compile/FOO exists
Reviewed by: arch, imp, peter, and the USENIX terminal room secret kernel cabal
2001-06-30 15:16:29 +00:00
Warner Losh
e1d0d8a941 Really do proper keepme files in the compile directories. Use
.cvsignore file for [A-Za-z]* to keep these directories around rather
than waste a file on .keepme.  This should also make people's built
trees place nice with CVS.

Idea for .cvsignore: peter (although I suggested the regexp)
Pointed out by: Makoto MATSUSHITA-san <matusita@jp.FreeBSD.org>
Llama's costuming by: Fernamdo Llamas
2001-06-30 14:38:32 +00:00
David E. O'Brien
791eca5f7b Ensure sys/${MACHINE}/compile/FOO exists
Reviewed by: arch, imp, peter and
  the USENIX terminal room secret kernel cabal
2001-06-30 07:12:34 +00:00
Warner Losh
1b0a8621e6 Repo copy i8237.h to dev/ic so we can get rid of some of the final vestiges
of includes of i386 files from non-i386 ports.
2001-06-30 05:29:11 +00:00
John Baldwin
6be523bca7 Add a new MI pointer to the process' trapframe p_frame instead of using
various differently named pointers buried under p_md.

Reviewed by:	jake (in principle)
2001-06-29 11:10:41 +00:00
John Baldwin
ec2262612f Enable interrupts again after disabling them in epson_{in,out}sw().
splx() doesn't do the equivalent of sti.
2001-06-29 10:44:45 +00:00
Yoshihiro Takahashi
15bf31ded3 Merged from the following changes.
sys/isa/ppc.c      revisions from 1.27 to 1.34
  sys/isa/ppcreg.h   revisions from 1.10 to 1.15
  sys/isa/isareg.h   revision 1.6
2001-06-26 11:53:12 +00:00
Yoshihiro Takahashi
50c2952249 Merged from sys/isa/sio.c revision 1.335. 2001-06-26 11:48:17 +00:00
Yoshihiro Takahashi
0d3dc5c9f0 Merged from sys/i386/isa/isa_dma.c revision 1.7. 2001-06-26 11:47:24 +00:00
Yoshihiro Takahashi
439d7df917 Merged from sys/isa/syscons_isa.c revision 1.16. 2001-06-26 11:46:42 +00:00
Yoshihiro Takahashi
7dbc5c43d4 Merged from sys/dev/syscons/scterm-sc.c revison 1.15. 2001-06-26 11:45:54 +00:00
Yoshihiro Takahashi
5346e77648 Merged from sys/dev/syscons/syscons.c revisons 1.358 and 1.360. 2001-06-26 11:45:01 +00:00
Yoshihiro Takahashi
fc2c05d1c2 Merged from sys/isa/fd.c revisions 1.198, 1.199, 1.200, 1.202 and 1.204. 2001-06-26 11:44:21 +00:00
KATO Takenori
7cd8375d89 Commented out pcm hints.
Pointed out by:	nyan
2001-06-26 08:27:00 +00:00
Yoshihiro Takahashi
8fce7fd44f Fixed miss merging from revision 1.102. 2001-06-26 00:47:54 +00:00
KATO Takenori
b7494481a0 Merged from sys/i386/isa/npx.c revision 1.102. 2001-06-23 08:39:13 +00:00
KATO Takenori
a655f750be Merged from sys/i386/i386/machdep.c revisions 1.456 and 1.457. 2001-06-23 08:30:13 +00:00
KATO Takenori
4f2114cb40 Removed pcm and sbc devices. 2001-06-23 08:18:55 +00:00
Yoshihiro Takahashi
3d1421a7f8 Allocate all resources using keyboard controller. 2001-06-17 04:43:28 +00:00
Yoshihiro Takahashi
4d153eaeb6 Commented out USERCONFIG and VISUAL_USERCONFIG options. 2001-06-14 11:32:54 +00:00
Peter Wemm
f41325db5f With this commit, I hereby pronounce gensetdefs past its use-by date.
Replace the a.out emulation of 'struct linker_set' with something
a little more flexible.  <sys/linker_set.h> now provides macros for
accessing elements and completely hides the implementation.

The linker_set.h macros have been on the back burner in various
forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()),
John Polstra (ELF clue) and myself (cleaned up API and the conversion
of the rest of the kernel to use it).

The macros declare a strongly typed set.  They return elements with the
type that you declare the set with, rather than a generic void *.

For ELF, we use the magic ld symbols (__start_<setname> and
__stop_<setname>).  Thanks to Richard Henderson <rth@redhat.com> for the
trick about how to force ld to provide them for kld's.

For a.out, we use the old linker_set struct.

NOTE: the item lists are no longer null terminated.  This is why
the code impact is high in certain areas.

The runtime linker has a new method to find the linker set
boundaries depending on which backend format is in use.

linker sets are still module/kld unfriendly and should never be used
for anything that may be modular one day.

Reviewed by:	eivind
2001-06-13 10:58:39 +00:00
Peter Wemm
2398f0cd1d Hints overhaul:
- Replace some very poorly thought out API hacks that should have been
  fixed a long while ago.
- Provide some much more flexible search functions (resource_find_*())
- Use strings for storage instead of an outgrowth of the rather
  inconvenient temporary ioconf table from config().  We already had a
  fallback to using strings before malloc/vm was running anyway.
2001-06-12 09:40:04 +00:00
Yoshihiro Takahashi
50cece92e1 Move the files from i386/isa/ic/ to dev/ic/. 2001-06-10 04:28:39 +00:00
Joerg Wunsch
e774b25111 Nuke the various poorly maintained copies of ioctl_fd.h. The file is
not machine-dependant, thus it has been moved out (repo-copied) into
<sys/fdcio.h>.
2001-06-06 06:15:03 +00:00
Joerg Wunsch
b794010414 Move out the files from src/sys/isa/ic/ to src/sys/dev/ic/, so they
can be made userland-visible as <dev/ic/...>.  Also, those files are
not supposed to contain any bus-specific details at all, so placing
them under .../isa/ has been a misnomer from the beginning.

The files in src/sys/dev/ic/ have been repo-copied from their old
location (this commit is a forced null commit there to record this
message).
2001-06-04 21:04:14 +00:00
Yoshihiro Takahashi
69f5c95465 Merged from sys/kern/subr_diskmbr.c revision 1.45. 2001-06-03 04:44:26 +00:00
Yoshihiro Takahashi
efcd68f008 Merged from sys/kern/subr_diskmbr.c revision 1.52. 2001-06-03 03:36:57 +00:00
Yoshihiro Takahashi
a8ef346171 Merged from sys/i386/i386/machdep.c revision 1.454. 2001-06-02 06:30:56 +00:00
Yoshihiro Takahashi
d4336cd071 Disabled unneeded code for PC98.
Submitted by:	NOKUBI Hirotaka <nokubi@ff.iij4u.or.jp>
2001-06-02 05:51:21 +00:00
Yoshihiro Takahashi
d7e03ee681 Merged from sys/i386/isa/npx.c revision 1.101. 2001-06-02 05:00:08 +00:00
Matt Jacob
ecf33dd4c4 move wx to be part of miibus requiring chipsets 2001-05-30 03:20:52 +00:00
Poul-Henning Kamp
888a8e3567 Remove MFS options from all example kernel configs. 2001-05-29 18:49:06 +00:00
Yoshihiro Takahashi
bd0432d8b0 Update pc98 memory probe functions.
- pc98_getmemsize() function returns available memory size under 16MB.
 - getmemsize() function is merged from PC-AT's one.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata) and
		NOKUBI Hirotaka <nokubi@ff.iij4u.or.jp>
2001-05-21 12:51:44 +00:00
Yoshihiro Takahashi
c48d35696d Merged from sys/i386/isa/npx.c revisions 1.99 and 1.100. 2001-05-21 12:20:22 +00:00
Yoshihiro Takahashi
2877ab5bdb Merged from sys/i386/i386/machdep.c revisions 1.452 and 1.453. 2001-05-21 11:57:54 +00:00
John Baldwin
8bd57f8fc2 Remove unneeded includes of sys/ipl.h and machine/ipl.h. 2001-05-15 23:22:29 +00:00
KATO Takenori
31cf5cec8b Merged from sys/isa/fd.c revision 1.197. 2001-05-15 08:55:30 +00:00
KATO Takenori
55ffce7e4f Merged from sys/i386/i386/machdep.c revision 1.450. 2001-05-15 08:32:01 +00:00
Poul-Henning Kamp
ab9f3b292e Convert DEVFS from an "opt-in" to an "opt-out" option.
If for some reason DEVFS is undesired, the "NODEVFS" option is
needed now.

Pending any significant issues, DEVFS will be made mandatory in
-current on july 1st so that we can start reaping the full
benefits of having it.
2001-05-13 20:52:40 +00:00
John Baldwin
ba228f6d96 - Split out the support for per-CPU data from the SMP code. UP kernels
have per-CPU data and gdb on the i386 at least needs access to it.
- Clean up includes in kern_idle.c and subr_smp.c.

Reviewed by:	jake
2001-05-10 17:45:49 +00:00
Poul-Henning Kamp
a468031ce8 Actually biofinish(struct bio *, struct devstat *, int error) is more general
than the bioerror().

Most of this patch is generated by scripts.
2001-05-06 20:00:03 +00:00
KATO Takenori
3c4848ae4a Merged from sys/i386/i386/machdep.c revision 1.448. 2001-05-06 09:18:32 +00:00
Yoshihiro Takahashi
382157f377 Merged from sys/i386/conf/GENERIC revision 1.304. 2001-05-06 05:57:46 +00:00
Yoshihiro Takahashi
df55282812 Merged from sys/isa/fd.c revision 1.193. 2001-05-06 05:49:11 +00:00
KATO Takenori
4cb0ebe811 Merged from sys/isa/sio.c revision 1.330. 2001-05-02 14:02:16 +00:00
KATO Takenori
e5b4cbf1a9 Merged from sys/isa/fd.c revision 1.195. 2001-05-02 13:59:03 +00:00
KATO Takenori
92c90d5cd1 Merged from sys/i386/isa/npx.c revisions 1.96 and 1.97. 2001-05-02 13:56:50 +00:00
KATO Takenori
3520a2a0e2 Merged from sys/i386/isa/clock.c revisions 1.172 and 1.173. 2001-05-02 13:51:49 +00:00
KATO Takenori
281238b184 Merged the rest of changes in sys/i386/i386/machdep.c revision 1.447. 2001-05-02 13:48:39 +00:00
Mark Murray
fb919e4d5a Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
other "system" header files.

Also help the deprecation of lockmgr.h by making it a sub-include of
sys/lock.h and removing sys/lockmgr.h form kernel .c files.

Sort sys/*.h includes where possible in affected files.

OK'ed by:	bde (with reservations)
2001-05-01 08:13:21 +00:00
John Baldwin
6caa8a1501 Overhaul of the SMP code. Several portions of the SMP kernel support have
been made machine independent and various other adjustments have been made
to support Alpha SMP.

- It splits the per-process portions of hardclock() and statclock() off
  into hardclock_process() and statclock_process() respectively.  hardclock()
  and statclock() call the *_process() functions for the current process so
  that UP systems will run as before.  For SMP systems, it is simply necessary
  to ensure that all other processors execute the *_process() functions when the
  main clock functions are triggered on one CPU by an interrupt.  For the alpha
  4100, clock interrupts are delievered in a staggered broadcast fashion, so
  we simply call hardclock/statclock on the boot CPU and call the *_process()
  functions on the secondaries.  For x86, we call statclock and hardclock as
  usual and then call forward_hardclock/statclock in the MD code to send an IPI
  to cause the AP's to execute forwared_hardclock/statclock which then call the
  *_process() functions.
- forward_signal() and forward_roundrobin() have been reworked to be MI and to
  involve less hackery.  Now the cpu doing the forward sets any flags, etc. and
  sends a very simple IPI_AST to the other cpu(s).  AST IPIs now just basically
  return so that they can execute ast() and don't bother with setting the
  astpending or needresched flags themselves.  This also removes the loop in
  forward_signal() as sched_lock closes the race condition that the loop worked
  around.
- need_resched(), resched_wanted() and clear_resched() have been changed to take
  a process to act on rather than assuming curproc so that they can be used to
  implement forward_roundrobin() as described above.
- Various other SMP variables have been moved to a MI subr_smp.c and a new
  header sys/smp.h declares MI SMP variables and API's.   The IPI API's from
  machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h.
- The globaldata_register() and globaldata_find() functions as well as the
  SLIST of globaldata structures has become MI and moved into subr_smp.c.
  Also, the globaldata list is only available if SMP support is compiled in.

Reviewed by:	jake, peter
Looked over by:	eivind
2001-04-27 19:28:25 +00:00
John Baldwin
33a9ed9d0e Change the pfind() and zpfind() functions to lock the process that they
find before releasing the allproc lock and returning.

Reviewed by:	-smp, dfr, jake
2001-04-24 00:51:53 +00:00
KATO Takenori
1a476993b0 Merged from sys/i386/isa/npx.c revision 1.95. 2001-04-16 09:15:40 +00:00
David E. O'Brien
c5e70d92ce Turn on kernel debugging support (DDB, INVARIANTS, INVARIANT_SUPPORT, WITNESS)
by default while SMPng is still being developed.

Submitted by:	jhb
2001-04-15 19:37:28 +00:00
Yoshihiro Takahashi
ce6c4d9c99 Correct typo. 2001-04-01 07:15:16 +00:00
Yoshihiro Takahashi
dcf81d70de Merged from sys/i386/i386/bioscall.s revision 1.9 and 1.10. 2001-04-01 07:08:13 +00:00
Yoshihiro Takahashi
43c35a2e4f Merged from sys/i386/isa/clock.c revision 1.171. 2001-04-01 06:41:47 +00:00
Yoshihiro Takahashi
0e319a247e Merged from sys/i386/i386/machdep.c revision 1.446. 2001-04-01 06:40:45 +00:00
Yoshihiro Takahashi
3ed49ce8da Merged from sys/i386/apm/apm.c revision 1.121. 2001-04-01 06:34:12 +00:00
John Baldwin
0006681fe6 Switch from save/disable/restore_intr() to critical_enter/exit(). 2001-03-28 03:06:10 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
KATO Takenori
d6cab84130 Merged from sys/i386/isa/npx.c revision 1.93. 2001-03-23 08:58:36 +00:00
KATO Takenori
ff11a33db4 Merged from sys/i386/i386/machdep.c revision 1.445. 2001-03-23 08:57:22 +00:00
KATO Takenori
e2e953a675 Merged from sys/i386/conf/GENERIC revision 1.305 (moved the fxp driver
into the miibus section.)
2001-03-17 14:04:24 +00:00
KATO Takenori
e70037181a Replaced p (undeclared) with curproc (after i386/isa/npx.c). 2001-03-08 14:25:51 +00:00
John Baldwin
19eb87d22a Grab the process lock while calling psignal and before calling psignal. 2001-03-07 03:37:06 +00:00
Yoshihiro Takahashi
bedee18193 Added another wd33c93 based SCSI card driver which replaces the bs driver.
Now, default is still bs.

Submitted by:	nyan and non.
Obtained from:	NetBSD/pc98
2001-02-27 12:34:01 +00:00
Yoshihiro Takahashi
c41e6d1684 Supported pcmcia modem card.
Submitted by:	MURAMATSU Atsushi <amura@ma3.seikyou.ne.jp>
2001-02-25 08:55:07 +00:00
KATO Takenori
c558d45a97 Merged from sys/i386/i386/machdep.c revision 1.443. 2001-02-25 08:00:35 +00:00
Peter Wemm
f1532aadee Activate USER_LDT by default. The new thread libraries are going to
depend on this.  The linux ABI emulator tries to use it for some linux
binaries too.  VM86 had a bigger cost than this and it was made default
a while ago.

Reviewed by:	jhb, imp
2001-02-23 01:25:02 +00:00
KATO Takenori
aad5feb0fb Merged from sys/isa/sio.c revision 1.326. 2001-02-21 10:24:21 +00:00
KATO Takenori
d9cb9fe14c Merged from sys/i386/isa/clock.c revision 1.170. 2001-02-21 10:22:22 +00:00
KATO Takenori
3affb09cee Merged from sys/i386/i386/machdep.c revision 1.441. 2001-02-21 10:20:11 +00:00
Jeroen Ruigrok van der Werven
d7d97eb0aa Preceed/preceeding are not english words. Use precede and preceding. 2001-02-18 10:43:53 +00:00
KATO Takenori
9e2930bdb1 Merged from sys/i386/isa/clock.c revision 1.169. 2001-02-13 10:35:15 +00:00
KATO Takenori
70acfed27c Merged from sys/i386/isa/npx.c revision 1.90. 2001-02-13 10:04:32 +00:00
KATO Takenori
b54b3917b1 Merged from sys/isa/sio.c revision 1.324 (sched_swi -> swi_sched). 2001-02-13 09:55:20 +00:00
Mark Murray
d888fc4e73 RIP <machine/lock.h>.
Some things needed bits of <i386/include/lock.h> - cy.c now has its
own (only) copy of the COM_(UN)LOCK() macros, and IMASK_(UN)LOCK()
has been moved to <i386/include/apic.h> (AKA <machine/apic.h>).
Reviewed by:	jhb
2001-02-11 10:44:09 +00:00
John Baldwin
929604ec9b Move the initailization of the proc lock for proc0 very early into the MD
startup code.
2001-02-09 16:25:16 +00:00
Bosko Milekic
9ed346bab0 Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)
2001-02-09 06:11:45 +00:00
Peter Wemm
bcf77694d1 Clean up some leftovers from the root mount cleanup that was done some
time ago.  FFS_ROOT and CD9660_ROOT are obsolete.
2001-02-04 15:35:10 +00:00
Poul-Henning Kamp
e1d756ce2a Remove the LABPC driver.
Doesn't work, no maintainer, more promising code exists elsewhere.
2001-02-04 11:18:15 +00:00
Peter Wemm
7aef6a1e88 All the world is not an i386. Merge rev 1.438 of i386/i386/machdep.c.
Make buffer_map a system map.
2001-02-04 07:00:47 +00:00
Peter Wemm
8ab109d131 Remove count for NSIO. The only places it was used it were incorrect.
(alpha-gdbstub.c got sync'ed up a bit with the i386 version)
2001-01-31 10:54:45 +00:00
Peter Wemm
f444a0efe9 Convert mca (microchannel bus support) from something that we count
(bogus) to something that we test for the presence of.
2001-01-29 11:57:27 +00:00
Peter Wemm
03927d3c33 Send "#if NISA > 0" to the bit-bucket and replace it with an option.
These were compile-time "is the isa code present?" tests and not
'how many isa busses' tests.
2001-01-29 09:38:39 +00:00
Peter Wemm
9ff4ede1d0 Gag. These compiled because I had a stray "eisa.h" in my config dir. 2001-01-29 08:40:16 +00:00
Peter Wemm
52a90b77f9 change 'count eisa' to 'optional eisa' and update the only consumer
of 'NEISA' - userconfig.c.
While there, send some defunct code to the file history.
2001-01-29 08:19:02 +00:00
KATO Takenori
9ec492e57b Merged from sys/i386/isa/npx.c revisions 1.88 and 1.89. 2001-01-28 12:31:03 +00:00
KATO Takenori
c30d5afab4 Synced with sys/i386/i386/machdep.c revision 1.436. 2001-01-28 11:06:28 +00:00
Yoshihiro Takahashi
5774351e81 Merged from sys/isa/sio.c revision 1.320. 2001-01-27 13:02:06 +00:00
Yoshihiro Takahashi
f2334c4082 Added pc98 apm driver.
Submitted by:	MURAMATSU Atsushi <amura@ma3.seikyou.ne.jp>
2001-01-23 12:37:15 +00:00
Jason Evans
d1c1b8413e Remove MUTEX_DECLARE() and MTX_COLD. Instead, postpone full mutex
initialization until after malloc() is safe to call, then iterate through
all mutexes and complete their initialization.

This change is necessary in order to avoid some circular bootstrapping
dependencies.
2001-01-21 07:52:20 +00:00
Garrett Wollman
074a4a2c84 Finish deprecating <sys/select.h> in favor of <sys/selinfo.h> in kernel code. 2001-01-20 02:24:07 +00:00
Peter Wemm
1467a651ab Convert apm from a bogus 'count' into a plain option. Clean out some
other cruft from the files.alpha and files.ia64 that were related to this.
2001-01-19 14:09:54 +00:00
Peter Wemm
aaa69bf4d0 Zap unused #include "apm.h" 2001-01-19 13:56:31 +00:00
Peter Wemm
558226eae7 Use #ifdef DEV_NPX from opt_npx.h instead of #if NNPX > 0 from npx.h 2001-01-19 13:19:02 +00:00
Bosko Milekic
08812b3925 Implement MTX_RECURSE flag for mtx_init().
All calls to mtx_init() for mutexes that recurse must now include
the MTX_RECURSE bit in the flag argument variable. This change is in
preparation for an upcoming (further) mutex API cleanup.
The witness code will call panic() if a lock is found to recurse but
the MTX_RECURSE bit was not set during the lock's initialization.

The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to
MTX_RECURSED, which is more appropriate given its meaning.

The following locks have been made "recursive," thus far:
eventhandler, Giant, callout, sched_lock, possibly some others declared
in the architecture-specific code, all of the network card driver locks
in pci/, as well as some other locks in dev/ stuff that I've found to
be recursive.

Reviewed by: jhb
2001-01-19 01:59:14 +00:00
Peter Wemm
e44a0ea311 Stop doing runtime checking on i386 cpus for cpu class. The cpu is
slow enough as it is, without having to constantly check that it really
is an i386 still.  It was possible to compile out the conditionals for
faster cpus by leaving out 'I386_CPU', but it was not possible to
unconditionally compile for the i386.  You got the runtime checking whether
you wanted it or not.  This makes I386_CPU mutually exclusive with the
other cpu types, and tidies things up a little in the process.

Reviewed by:  alfred, markm, phk, benno, jlemon, jhb, jake, grog, msmith,
              jasone, dcs, des (and a bunch more people who encouraged it)
2001-01-16 09:10:34 +00:00
Mark Murray
b79ad7e642 Remove NOBLOCKRANDOM as a compile-time option. Instead, provide
exactly the same functionality via a sysctl, making this feature
a run-time option.

The default is 1(ON), which means that /dev/random device will
NOT block at startup.

setting kern.random.sys.seeded to 0(OFF) will cause /dev/random
to block until the next reseed, at which stage the sysctl
will be changed back to 1(ON).

While I'm here, clean up the sysctls, and make them dynamic.
Reviewed by:		des
Tested on Alpha by:	obrien
2001-01-14 17:50:15 +00:00
Yoshihiro Takahashi
0a05044793 Merged from sys/i386/conf/GENERIC revision from 1.286 to 1.291. 2001-01-13 13:23:42 +00:00
Yoshihiro Takahashi
3cf9cf0797 Merged from sys/i386/conf/GENERIC.hints revision 1.6 and 1.7. 2001-01-13 13:23:22 +00:00
KATO Takenori
55d15a0439 Merged from sys/i386/isa/npx.c revision 1.87. 2001-01-12 13:42:53 +00:00
KATO Takenori
7590772d33 Merged from sys/i386/i386/machdep.c revisions 1.427 and 1.428. 2001-01-12 13:39:50 +00:00
Yoshihiro Takahashi
a1abfd66ea Correct typo.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2001-01-08 09:17:58 +00:00
KATO Takenori
e93f5a3faa Merged from sys/i386/i386/machdep.c revision 1.426. 2001-01-07 07:59:19 +00:00
KATO Takenori
1e7e1ff678 Merged from sys/i386/conf/GENERIC revisions 1.292 - 1.294. 2000-12-16 03:31:44 +00:00
KATO Takenori
bf0611e746 Merged from sys/i386/i386/machdep.c revision 1.425. 2000-12-16 03:25:08 +00:00
Yoshihiro Takahashi
4fca76da0c Removed the VoxWare sound drivers. 2000-12-10 10:02:32 +00:00
Yoshihiro Takahashi
8297c2fc98 Fixed to support 3Com 3C569B for PC-98.
Submitted by:	"Hirokazu WATANABE" <gwna@geocities.co.jp>
2000-12-09 04:25:07 +00:00
David Malone
7cc0979fd6 Convert more malloc+bzero to malloc+M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
2000-12-08 21:51:06 +00:00
Poul-Henning Kamp
959b7375ed Staticize some malloc M_ instances. 2000-12-08 20:09:00 +00:00
KATO Takenori
84af0d0cd2 Merged from sys/i386/isa/clock.c revision 1.164. 2000-12-05 09:35:54 +00:00
KATO Takenori
86a86b1be0 Merged from sys/i386/i386/machdep.c revision 1.424. 2000-12-05 09:33:11 +00:00
Marcel Moolenaar
d034d459da Don't use p->p_sigstk.ss_flags to keep state of whether the
process is on the alternate stack or not. For compatibility
with sigstack(2) state is being updated if such is needed.

We now determine whether the process is on the alternate
stack by looking at its stack pointer. This allows a process
to siglongjmp from a signal handler on the alternate stack
to the place of the sigsetjmp on the normal stack. When
maintaining state, this would have invalidated the state
information and causing a subsequent signal to be delivered
on the normal stack instead of the alternate stack.

PR: 22286
2000-11-30 05:23:49 +00:00
KATO Takenori
504a7aad9e Merged from sys/i386/i386/userconfig.c revision 1.185. 2000-11-29 12:31:13 +00:00
Poul-Henning Kamp
cb7e609a3c Make diskerr() always log with printf. 2000-11-26 19:29:15 +00:00
KATO Takenori
69c963801b Merged from sys/i386/i386/machdep.c revision 1.422. 2000-11-26 06:29:33 +00:00
Jonathan Lemon
df5e198723 Lock down the network interface queues. The queue mutex must be obtained
before adding/removing packets from the queue.  Also, the if_obytes and
if_omcasts fields should only be manipulated under protection of the mutex.

IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on
the queue.  An IF_LOCK macro is provided, as well as the old (mutex-less)
versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which
needs them, but their use is discouraged.

Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF,
which takes care of locking/enqueue, and also statistics updating/start
if necessary.
2000-11-25 07:35:38 +00:00
KATO Takenori
76b86dfba6 Merged from sys/i386/i386/machdep.c revision 1.421. 2000-11-20 12:06:08 +00:00
Yoshihiro Takahashi
6ffb65e8b1 Merged from the following changes.
sys/conf/Makefile.i386      1.211
sys/conf/files.i386         1.329
sys/isa/fd.c                1.186, 1.188 and 1.189
sys/isa/sio.c               1.305 and 1.317
sys/i386/conf/GENERIC       1.270, 1.281, 1.282 and 1.284
sys/i386/i386/machdep.c     1.419
sys/i386/i386/userconfig.c  1.184
2000-11-05 14:31:19 +00:00
Poul-Henning Kamp
cf9fa8e725 Move suser() and suser_xxx() prototypes and a related #define from
<sys/proc.h> to <sys/systm.h>.

Correctly document the #includes needed in the manpage.

Add one now needed #include of <sys/systm.h>.
Remove the consequent 48 unused #includes of <sys/proc.h>.
2000-10-29 16:06:56 +00:00
Yoshihiro Takahashi
65a68d7647 Restore GDC mode to initial mode instead of 24KHz.
Submitted by:	Tomokazu HARADA <tkhara@osk4.3web.ne.jp>
2000-10-28 11:27:56 +00:00
Yoshihiro Takahashi
12f1a08005 Fixed extention memory check routine.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2000-10-28 11:16:42 +00:00
Poul-Henning Kamp
46aa3347cb Convert all users of fldoff() to offsetof(). fldoff() is bad
because it only takes a struct tag which makes it impossible to
use unions, typedefs etc.

Define __offsetof() in <machine/ansi.h>

Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h>

Remove myriad of local offsetof() definitions.

Remove includes of <stddef.h> in kernel code.

NB: Kernelcode should *never* include from /usr/include !

Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API.

Deprecate <struct.h> with a warning.  The warning turns into an error on
01-12-2000 and the file gets removed entirely on 01-01-2001.

Paritials reviews by:   various.
Significant brucifications by:  bde
2000-10-27 11:45:49 +00:00
Mark Murray
5f3431b5ad As the blocking model has seems to be troublesome for many, disable
it for now with an option.

This option is already deprecated, and will be removed when the
entropy-harvesting code is fast enough to warrant it.
2000-10-27 06:06:04 +00:00
John Baldwin
cba5b33d1a Catch up to the new swi code.
Noticed by:	phk
2000-10-25 20:21:42 +00:00
John Baldwin
8088699f79 - Overhaul the software interrupt code to use interrupt threads for each
type of software interrupt.  Roughly, what used to be a bit in spending
  now maps to a swi thread.  Each thread can have multiple handlers, just
  like a hardware interrupt thread.
- Instead of using a bitmask of pending interrupts, we schedule the specific
  software interrupt thread to run, so spending, NSWI, and the shandlers
  array are no longer needed.  We can now have an arbitrary number of
  software interrupt threads.  When you register a software interrupt
  thread via sinthand_add(), you get back a struct intrhand that you pass
  to sched_swi() when you wish to schedule your swi thread to run.
- Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit
  more intuitive.  Also, prefix all the members of struct intrhand with
  'ih_'.
- Make swi_net() a MI function since there is now no point in it being
  MD.

Submitted by:	cp
2000-10-25 05:19:40 +00:00
KATO Takenori
8de38d83a3 Used kbio.h and consio.h instead of machine/console.h. 2000-10-20 10:35:44 +00:00
KATO Takenori
5a262ebb43 Merged from sys/i386/isa/npx.c revision 1.86. 2000-10-20 10:20:27 +00:00
KATO Takenori
618028ff9f Merged from sys/i386/isa/clock.c revision 1.160. 2000-10-20 10:19:40 +00:00
KATO Takenori
6a8ef4f44f Merged from sys/i386/i386/machdep.c revisions 1.417 and 1.418. 2000-10-20 10:17:26 +00:00
KATO Takenori
d430064589 Converted da' and wd' into rda' and rwd', respectively.
Submitted by:	MURAMATSU Atsushi <amura@ma3.seikyou.ne.jp>
2000-10-18 15:28:10 +00:00
KATO Takenori
a5414135aa Merged from sys/i386/i386/machdep.c revision 1.416. 2000-10-18 09:05:09 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Peter Wemm
1198579d7b Clean up as in isa/* - resource_query_string() loop cosmetic tweaks. 2000-10-15 09:32:58 +00:00
Yoshihiro Takahashi
b48b645254 Fixed warnings. 2000-10-15 09:04:21 +00:00
Yoshihiro Takahashi
6bf6c91f5d Fixed warnings. 2000-10-15 04:54:17 +00:00
KATO Takenori
733c8d0bf2 Fixed include files to use sys/{cons,fb,kb}io.h instead of
machine/console.h.
2000-10-09 11:07:18 +00:00
Poul-Henning Kamp
f6b5c74c35 Initiate deorbit burn sequence for <machine/mouse.h>.
Replace all in-tree uses with <sys/mouse.h> which repo-copied a few
moments ago from src/sys/i386/include/mouse.h by peter.
This is also the appropriate fix for exo-tree sources.

Put warnings in <machine/mouse.h> to discourage use.
November 15th 2000 the warnings will be converted to errors.
January 15th 2001 the <machine/mouse.h> files will be removed.
2000-10-09 08:08:36 +00:00
KATO Takenori
5e36b573bc Merged from sys/isa/sio.c revision 1.316. 2000-10-06 11:52:32 +00:00
KATO Takenori
9f9cb5dbb1 Merged from sys/i386/isa/npx.c revision 1.85. 2000-10-06 11:51:20 +00:00
KATO Takenori
11f46ebd84 Merged from sys/i386/isa/clock.c revisions 1.158 and 1.159. 2000-10-06 11:50:19 +00:00
KATO Takenori
c25b32ae9d Merged from sys/i386/i386/machdep.c revision 1.415. 2000-10-06 11:43:51 +00:00
KATO Takenori
32c0e11c56 Merged from sys/i386/i386/machdep.c revision 1.414. 2000-10-03 13:27:31 +00:00
Yoshihiro Takahashi
0a917604f0 Added NEC PC-9801-83, 84, PC-9801-103, 104, PC-9801N-25 and PC-9801N-J02R
support which use National Semiconductor DP8393X (SONIC) as ethernet
controller. Currently, this driver is used on only PC-98.

Submitted by:	Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
Obtained from:	NetBSD/pc98
2000-10-02 14:27:20 +00:00
KATO Takenori
7324718bc0 Merged from sys/i368/i386/machdep.c revision 1.413. 2000-10-02 08:57:21 +00:00
Bosko Milekic
7d03271452 Big mbuf subsystem diff #1: incorporate mutexes and fix things up somewhat
to accomodate the changes.

 Here's a list of things that have changed (I may have left out a few); for a
 relatively complete list, see http://people.freebsd.org/~bmilekic/mtx_journal

   * Remove old (once useful) mcluster code for MCLBYTES > PAGE_SIZE which
     nobody uses anymore. It was great while it lasted, but now we're moving
     onto bigger and better things (Approved by: wollman).

   * Practically re-wrote the allocation macros in sys/sys/mbuf.h to accomodate
     new allocations which grab the necessary lock.

   * Make sure that necessary mbstat variables are manipulated with
     corresponding atomic() routines.

   * Changed the "wait" routines, cleaned it up, made one routine that does
     the job.

   * Generalized MWAKEUP() macro. Got rid of m_retry and m_retryhdr, as they
     are now included in the generalized "wait" routines.

   * Sleep routines now use msleep().

   * Free lists have locks.

   * etc... probably other stuff I'm missing...

  Things to look out for and work on later:

   * find a better way to (dynamically) adjust EXT_COUNTERS

   * move necessity to recurse on a lock from drain routines by providing
     lock-free lower-level version of MFREE() (and possibly m_free()?).

   * checkout include of mutex.h in sys/sys/mbuf.h - probably violating
     general philosophy here.

   The code has been reviewed quite a bit, but problems may arise... please,
   don't panic! Send me Emails: bmilekic@freebsd.org

Reviewed by: jlemon, cp, alfred, others?
2000-09-30 06:30:39 +00:00
KATO Takenori
b8c4558548 Merged from sys/i386/i386/machdep.c revision 1.411. 2000-09-23 06:38:59 +00:00
KATO Takenori
75a6b88a20 Merged from sys/i386/conf/GENERIC revision 1.279. 2000-09-23 06:38:04 +00:00
KATO Takenori
a3e04bd352 Merged from sys/isa/sio.c revision 1.315. 2000-09-22 12:56:55 +00:00
KATO Takenori
3f605d2ffc Merged from sys/i386/i386/machdep.c revision 1.410. 2000-09-22 12:54:50 +00:00
KATO Takenori
7dd8cc5686 Merged from sys/i386/conf/GENERIC revision 1.278. 2000-09-22 12:53:49 +00:00
KATO Takenori
11ee9bf233 Merged from sys/isa/fd.c revision 1.187.
Pointed out by:	nyan
2000-09-15 05:47:56 +00:00
KATO Takenori
0011dc221c Merged from sys/i386/isa/sio.c revision 1.314. 2000-09-15 05:45:23 +00:00
KATO Takenori
fd6c4e11e0 Merged from sys/i386/isa/clock.c revision 1.157. 2000-09-15 05:42:42 +00:00
KATO Takenori
6402000285 Merged from sys/i386/i386/machdep.c revision 1.408. 2000-09-15 05:35:55 +00:00
John Baldwin
606f8eb27a Remove the mtx_t, witness_t, and witness_blessed_t types. Instead, just
use struct mtx, struct witness, and struct witness_blessed.

Requested by:	bde
2000-09-14 20:15:16 +00:00
Yoshihiro Takahashi
c400e7405e - Changed the structure name (struct disk -> struct softc).
- Converted to disk_create() interface.
- Removed unnecessary code.
2000-09-14 11:45:31 +00:00
KATO Takenori
715ca46f5c Merged from sys/isa/sio.c revision 1.312. 2000-09-13 10:14:43 +00:00
KATO Takenori
a0859935f5 Merged from sys/i386/conf/GENERIC revision 1.275. 2000-09-13 10:11:30 +00:00
KATO Takenori
9f936f8596 Merged from sys/i386/conf/GENERIC revision 1.274. 2000-09-13 10:10:34 +00:00
David Malone
1c06ce6197 Add the ability to define a "shutdown" and "shutdown and poweroff" key
to syscons. I have a man page to follow describing the format of the
kbdmap file.

PR:		19273
Reviewed by:	sheldonh
2000-09-11 20:37:42 +00:00
KATO Takenori
3584f98832 Merged from sys/isa/sio.c revisions 1.309 - 1.311. 2000-09-08 11:54:13 +00:00
KATO Takenori
f907abc0b3 Merged from sys/i386/i386/machdep.c revision 1.407. 2000-09-08 11:20:04 +00:00
KATO Takenori
232d649b48 Merged from sys/i386/i386/machdep.c revision 1.406. 2000-09-07 13:35:44 +00:00
KATO Takenori
106038c33b Merged from sys/isa/sio.c revision 1.306, 1.307 and 1.308. 2000-09-07 13:34:45 +00:00
KATO Takenori
258cacb69b Merged from sys/i386/isa/npx.c revision 1.84. 2000-09-07 13:33:48 +00:00
KATO Takenori
841d7a731e Merged from sys/i386/isa/clock.c revision 1.156. 2000-09-07 13:32:59 +00:00
KATO Takenori
ec43f77f09 Merged from sys/i386/i386/machdep.c revision 1.405. 2000-09-03 15:55:34 +00:00
KATO Takenori
5340942440 Merged from sys/i386/i386/machdep.c rev. 1.404 just for keeping
similarity.  No PC-98 may have ACPI feature, but I'm not 100%
sure.
2000-09-03 14:11:03 +00:00
KATO Takenori
d557549f61 Merged from sys/dev/syscons/syscons.c revision 1.346. 2000-09-03 07:05:30 +00:00
KATO Takenori
d85a56345e Fixed FPU_ERROR_BROKEN code. It had old-isa code. 2000-09-01 11:47:07 +00:00
Yoshihiro Takahashi
95ea0566b4 Enabled pcic, card and xe devices. 2000-08-26 07:38:43 +00:00
Peter Wemm
2422dd7973 Comment out the static wiring of hints for GENERIC - the release process
now installs the hints file into /boot.
2000-08-24 18:56:54 +00:00
Yoshihiro Takahashi
ac1140b8d5 Disabled serial console. 2000-08-19 10:19:43 +00:00
David Malone
a5c4836d39 Replace the mbuf external reference counting code with something
that should be better.

The old code counted references to mbuf clusters by using the offset
of the cluster from the start of memory allocated for mbufs and
clusters as an index into an array of chars, which did the reference
counting. If the external storage was not a cluster then reference
counting had to be done by the code using that external storage.

NetBSD's system of linked lists of mbufs was cosidered, but Alfred
felt it would have locking issues when the kernel was made more
SMP friendly.

The system implimented uses a pool of unions to track external
storage. The union contains an int for counting the references and
a pointer for forming a free list. The reference counts are
incremented and decremented atomically and so should be SMP friendly.
This system can track reference counts for any sort of external
storage.

Access to the reference counting stuff is now through macros defined
in mbuf.h, so it should be easier to make changes to the system in
the future.

The possibility of storing the reference count in one of the
referencing mbufs was considered, but was rejected 'cos it would
often leave extra mbufs allocated. Storing the reference count in
the cluster was also considered, but because the external storage
may not be a cluster this isn't an option.

The size of the pool of reference counters is available in the
stats provided by "netstat -m".

PR:		19866
Submitted by:	Bosko Milekic <bmilekic@dsuper.net>
Reviewed by:	alfred (glanced at by others on -net)
2000-08-19 08:32:59 +00:00
KATO Takenori
a19d469b8a Merged from sys/i386/i386/machdep.c revision 1.402. 2000-08-18 09:22:01 +00:00
Yoshihiro Takahashi
82583dd564 - Fixed the conversion to bus_space interface.
- Added PC-98 Cbus devices support.
  The original patch is submitted by chi@bd.mbn.or.jp (Chiharu Shibata)
- Removed old ed driver.
2000-08-17 12:15:45 +00:00
KATO Takenori
64145a4abe Merged from sys/i386/i386/machdep.c revision 1.401. 2000-08-14 07:27:10 +00:00
KATO Takenori
e2c9a41a3c Merged from sys/i386/i386/machdep.c revision 1.400. 2000-08-12 07:35:12 +00:00
Yoshihiro Takahashi
a0a9cf6e5b Merged from sys/i386/conf/GENERIC revisions 1.266 and 1.267. 2000-08-08 11:57:09 +00:00
Yoshihiro Takahashi
4e281f317d Merged from sys/i386/conf/GENERIC.hints revision 1.3. 2000-08-08 11:56:45 +00:00
Yoshihiro Takahashi
94be196610 Changed default cursor shape to non-blink mode.
Submitted by:	Tomokazu HARADA <tkhara@osk4.3web.ne.jp>
2000-08-08 09:28:32 +00:00
Yoshihiro Takahashi
ec6d58d33f Fixed PC-9821 NOTE supports with LINE30 mode.
Submitted by:	Tomokazu HARADA <tkhara@osk4.3web.ne.jp>
2000-08-08 09:17:15 +00:00
KATO Takenori
a2c06ee095 Commented out xe device because it depend on PCMCIA stuff. 2000-08-04 08:29:50 +00:00
KATO Takenori
c1e8fc20ac Merged from sys/i386/isa/clock.c revision 1.155. 2000-08-04 08:15:45 +00:00
KATO Takenori
b160feebb5 Commented out card and pcic devices because they are broken in pc98 port. 2000-08-02 09:05:26 +00:00
Yoshihiro Takahashi
0100579d5b Merged from sys/dev/syscons/scterm-sc.c revisions from 1.8 to 1.12. 2000-07-30 08:12:08 +00:00
Yoshihiro Takahashi
87cd59ec7c Merged from sys/dev/syscons/syscons.c revision 1.344. 2000-07-30 07:59:19 +00:00
KATO Takenori
1fb2276093 Merged from sys/dev/syscons/syscons.c revision 1.345. 2000-07-28 09:36:37 +00:00
Archie Cobbs
21b8ebd926 Make all Ethernet drivers attach using ether_ifattach() and detach using
ether_ifdetach().

The former consolidates the operations of if_attach(), ng_ether_attach(),
and bpfattach(). The latter consolidates the corresponding detach operations.

Reviewed by:	julian, freebsd-net
2000-07-13 22:54:34 +00:00
Yoshihiro Takahashi
d70f8cefa0 Backed out a part of previous commit. The function name conflicts.
Pointed out by:	haro@tk.kubota.co.jp (Munehiro Matsuda)
2000-07-12 10:15:43 +00:00
Yoshihiro Takahashi
2446144f7a Merge from the following changes.
sys/conf/files.i386		1.321
sys/dev/syscons/syscons.c	1.343
sys/i386/isa/spkr.c		1.46
sys/isa/fd.c			1.183 and 1.185
sys/isa/syscons_isa.c		1.14
sys/isa/vga_isa.c		1.18
2000-07-11 12:50:34 +00:00
Kris Kennaway
682199d834 Don't call printf without a format string. 2000-07-10 07:13:36 +00:00
Yoshihiro Takahashi
6601e641fd Sync with sys/i386/conf/GENERIC revisions 1.258 and 1.259. 2000-07-04 12:31:46 +00:00
Poul-Henning Kamp
77978ab8bc Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.
Pointed out by:	bde
2000-07-04 11:25:35 +00:00
Poul-Henning Kamp
82d9ae4e32 Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:
Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our
sources:

        -sysctl_vm_zone SYSCTL_HANDLER_ARGS
        +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
2000-07-03 09:35:31 +00:00
KATO Takenori
1753374bc6 Disabled ida, amr and mlx devices. 2000-06-28 03:25:47 +00:00
KATO Takenori
2e76b6aefc Merged from sys/i386/i386/userconfig.c revision 1.181. 2000-06-28 03:23:42 +00:00
KATO Takenori
65c8c4cd2c Merged from sys/i386/isa/spkr.c revision 1.47. 2000-06-28 03:20:56 +00:00
KATO Takenori
aae33d3c2a Merged from sys/i386/isa/npx.c revision 1.83. 2000-06-28 03:19:44 +00:00
KATO Takenori
9e3aaab780 Merged from sys/i386/isa/isa_dma.c revision 1.6. 2000-06-28 03:18:51 +00:00
KATO Takenori
3606d88937 Merged from sys/i386/isa/clock.c revision 1.152. 2000-06-28 03:17:51 +00:00
KATO Takenori
8ff264ff5b Merged from sys/i386/conf/GENERIC revisions 1.261 and 1.262. 2000-06-28 03:15:27 +00:00
Peter Wemm
1bce768912 Report the line number where gethints.pl does not understand something
in an old device line.
2000-06-26 09:08:23 +00:00