Commit graph

1682 commits

Author SHA1 Message Date
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