Commit Graph

395 Commits

Author SHA1 Message Date
jmcneill
8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

  Add MP locking to the audio drivers.

  Making the audio drivers MP safe is necessary before efforts
  can be made to make the VM system MP safe.

  The are two locks per device instance, an ISR lock and
  a character device lock. The ISR lock replaces calls to
  splaudio()/splx(), and will be held across calls to device
  methods which were called at splaudio() before (e.g.
  trigger_output). The character device lock is held across
  calls to nearly all of the methods, excluding some only
  used for initialization, e.g. get_locks.

Welcome to 5.99.57.
2011-11-23 23:07:28 +00:00
tls
3afd44cf08 First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.
2011-11-19 22:51:18 +00:00
isaki
2ccb98927e Obsolete pow(4) and rtcalarm(8). Discussed in port-x68k@.
Probably the combination of pow(4) ioctl and rtcalarm(8) does
not work for a long time, and nobody uses them.
I'll rewrite a part about power switch handler as a new device.
2011-11-19 12:27:42 +00:00
tsutsui
a61d3c89b5 Calling psignal(9) (via EV_WAKEUP()) in interrupt handlers
could cause mutex error panic, so defer it via softint(9).
This should fix panic on heavy key strokes during running Xserver.

Should be pulled up to netbsd-5.

XXX: amiga and atari might have the similar problem?
2011-10-23 13:21:54 +00:00
isaki
fec6c386cc Switch to 2-clause license. 2011-10-16 03:10:17 +00:00
tsutsui
a595e9f720 Add a comment for the previous change. 2011-05-05 13:44:35 +00:00
tsutsui
08bc844a54 Don't call mfp_init() in mfp_attach().
It's already called from early mfp_config_console() via config_console()
and reinitializing MFP could sometimes cause silent hang.
2011-05-04 12:27:03 +00:00
tsutsui
cc81f439dd Reset ZS chip properly in zscninit() so that zscngetc() works
even before zsc is attached during configure.
(i.e. make userconf(4) work on serial console)
2011-05-01 16:19:13 +00:00
rmind
2626d57668 Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency.  Remove some unnecessary malloc.h inclusions as well.
2011-04-24 16:26:51 +00:00
tsutsui
ef54da0a01 Fix hangup on the first floppy access since 2008.
Problem was reported by isaki@.

On X680x0 (and most other machines other than ISA FDC),
the ready line from FDD is connected to FDC and fdc driver can
be notified of the ready state after fd_set_motor() by interrupts.
In this case no need to use callout(9) to wait the FDD motor stabilized,
and the callout(9) method used in ISA fdc(4) driver rather caused
infinite unhandled interrupts since callout(9) was no longer invoked
during interrupt storm after vmlocking2 merge, I guess.

Should be pulled up to netbsd-5.
2011-04-10 15:23:06 +00:00
rmind
9b6bd2d968 Remove clause 3 (UCB advertising clause) from the University of Utah
copyright.  Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
2011-02-08 20:20:06 +00:00
isaki
bec4c1ae51 Probe not only ctrl address but also bank window address.
This prevents the wrong matching when other boards like
Neptune-X exist.  Reported by Yasushi Oshima.
2010-08-08 09:30:29 +00:00
isaki
09e97aa9a0 Probe not only Nereid Ctrl port but also SL811HS/T port. 2010-07-24 13:15:13 +00:00
mrg
fb81c7d694 fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h.  FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
2010-06-06 04:51:33 +00:00
mrg
bd01b4a30e fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h.  FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
2010-06-06 04:50:05 +00:00
isaki
4fc2ffd701 Correct rev1.11.
Fix panic reported by Yasushi Oshima.
2010-05-08 02:48:31 +00:00
tsutsui
8f7c20ed4f Put several fixes to ne(4) driver for better 8 bit mode support,
especially on RTL8019AS which is also used for non-ISA local bus of
embedded controllers and some m68k machines like atari and x68k.

 * move RTL8019 probe and attach code from each bus attachment
   to MI ne2000_detect() and ne2000_attach()
 * change a method for backend and attachment to specify 8 bit mode
   to use a new sc->sc_quirk member, instead of sc->sc_dmawidth
 * handle more NE2000 8 bit mode specific settings, including
   bus_space(9) access width and available size of buffer memory
 * add a function to detect NE2000 8 bit mode
   (disabled by default, but enalbed by options NE2000_DETECT_8BIT
    to avoid possible regression on various ISA clones)
 * fix ipkdb attachment accordingly (untested)

Tested on two NE2000 ISA variants (RTL8019AS and another clone named UL0001)
in both 8 bit and 16 bit mode on i386. "Looks good" from nonaka@.

See my post on tech-kern for details:
http://mail-index.NetBSD.org/tech-kern/2010/02/26/msg007423.html
2010-03-03 13:39:57 +00:00
pooka
10fe49d72c Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client.  This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached.  However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff.  ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
2010-01-19 22:06:18 +00:00
isaki
8cf7d2d787 Make compile with DEBUG. 2010-01-09 09:16:32 +00:00
isaki
bdc7b127e2 Correct return value of ne_*_match().
It's attach priority, not ne2000 model.
2009-11-28 03:10:09 +00:00
rmind
3dc24f5a91 Use lwp_getpcb() on m68k ports, clean from struct user usage. 2009-11-23 00:11:42 +00:00
snj
886d7f6c39 Drop 3rd and 4th clauses on this TNF-copyrighted file. 2009-11-07 19:54:17 +00:00
isaki
34b7dffc11 - malloc() + memset(0) -> malloc(M_ZERO).
- remove temporary variable.
2009-01-18 05:00:39 +00:00
isaki
0a5ccf5143 Delete 10 years old #if 0'd comments in intio.c, locore.s.
According to the old comment, the interrupt handler via intiotrap
should set his interrupt level again, but it's not right.  And
don't set it again by interrupt hander.
2009-01-18 04:48:53 +00:00
isaki
8ca78cfb4e Clean up header files. 2009-01-18 02:40:05 +00:00
isaki
60e2f02631 Split device_t/softc, use aprint*(). 2009-01-17 10:02:23 +00:00
isaki
cbd07c5ca6 Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
2009-01-17 09:20:46 +00:00
isaki
691579f364 Use firm_gettime() (in dev/sun/vuid_event.h) to adapt
changes in chiristos-time_t.
2009-01-17 03:26:31 +00:00
yamt
70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
isaki
917e1cad29 Clean up messages.
- fdcintr: remove duplicated status message.
- fdioctl: make it easy to track ioctl.
2009-01-10 06:45:06 +00:00
isaki
9c9d081d26 fdc->sc_dev is not necessary. 2009-01-10 06:41:06 +00:00
isaki
8cb1e6831d rtclockinit() and range_test*() were removed in rtclock.c,v 1.19. 2009-01-03 09:32:13 +00:00
isaki
aea81d8a0f struct device * -> device_t. 2008-12-31 09:50:21 +00:00
isaki
7563f448e7 Search all of mfp(4)'s children automatically, instead of
attaching hard-coded children.  mfp(4) was trying to attach
pow(4) though pow(4) was a pseudo-device for a long time.
2008-12-31 08:00:31 +00:00
isaki
06cefe4345 Make sram(4) a hardware device.
# I wrote this in 2001 :-)
2008-12-21 09:01:19 +00:00
isaki
cf59801230 x68k pow(4) now uses MI sysmon_pswitch framework. suggested by tsutsui@.
- Make MD poffd(8) retire, and use MI powerd(8) instead of it.
- Make /dev/pow1 retire, because nobody holds /dev/pow0 any longer.
  Use /dev/pow0 for pow(4) ioctl.
- POWIOCSSIGNAL ioctl which is for poffd(8) is also obsoleted.
2008-12-20 13:20:58 +00:00
isaki
c238dc3262 Make pow(4) a hardware device.
Now pow(4) uses intio_intr_establish() which is a common interrupt
routine, but not powtrap which is a device specific routine.
2008-12-20 01:05:46 +00:00
isaki
3b878f898f Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
2008-12-18 05:56:42 +00:00
isaki
ae6ae44eaf Move external decl. of intiobase: dev/intiovar.h -> include/cpu.h
Move definition of intiobase: x68k/pmap_bootstrap.c -> x68k/locore.s
These synchronize code with other m68k ports.
2008-12-18 05:24:03 +00:00
isaki
dc21f7bf9b Make it compilable again. 2008-12-18 03:18:27 +00:00
isaki
b3f443b573 Remove intr_reset(), which has disabled device interrupt just
after start in locore.s.  Initializing interrupt should be done
by each device driver.
2008-12-18 02:27:41 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
isaki
5b2d4637e6 Use intio_set_*() macros to purge macros by the name of sysport, ioctlr. 2008-12-14 02:16:51 +00:00
isaki
1c83a96ebb Use mfp_{set,clear}_*() macros to purge macros by the name of 'mfp'. 2008-12-14 02:05:54 +00:00
isaki
b3a08741f8 Fix a broken 'Front power switch' signal.
Use softint(9), instead of using psignal(9) in
hardware interrupt.  Thanks to soda-san.
2008-12-13 02:49:10 +00:00
isaki
3cffa23a3e Use TAILQ_* macros. 2008-12-05 13:14:42 +00:00
isaki
74a27b3322 Rename variables to avoid confusing. forgotten in previous commit. 2008-11-29 06:16:49 +00:00
isaki
03f059cb18 Split device_t/softc. Use aprint*() and device_xname().
Not tested. I cannot test now...
2008-11-29 06:02:52 +00:00
isaki
b823d19d77 Split device_t/softc. Use aprint*() and device_xname().
Not tested. I don't have its hardware and no response in port-x68k.
2008-11-29 05:59:40 +00:00
isaki
7379f550c7 Make it compilable even if FDDEBUG was defined. 2008-06-29 09:44:11 +00:00