Commit Graph

52 Commits

Author SHA1 Message Date
riastradh
445478ce67 MD rnd.h cleanups. Please let me know if I broke anything! 2015-04-13 21:18:40 +00:00
christos
a0a6c85f4d centralize the call unit / dialout macros 2014-11-15 19:20:01 +00:00
tls
ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
dholland
f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
dholland
a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
skrll
7c36e1d910 Sprinkle __unused. 2013-12-14 09:52:33 +00:00
skrll
f5f10bf60f Whitespace 2013-09-05 07:06:37 +00:00
mlelstv
c2b23d53a6 For a polled console incoming characters are buffered on output.
The buffer is never passed to the regular tty routines and can
survive from early boot to halt where it is read by the "press
any continue to reboot" loops.
As a workaround, just kill the read-ahead buffer when switching
from and to polled mode.
2013-05-01 07:38:00 +00:00
mlelstv
882558bd95 fix build for KGDB 2013-03-03 10:26:18 +00:00
skrll
7078f95238 Fix #if 0'ed code.
From chuq
2012-10-10 21:54:13 +00:00
skrll
2c14b44803 Backout previous - it breaks rpi console for me and jak. 2012-08-17 09:38:51 +00:00
reinoud
a69a1c78e1 Improve support for transmit fifo support for plcom.
As Nick, Michiel and I concluded this driver needs a big overhaul since its
logic is modelled on the standard com.c driver which doesn't have the plcom's
treshold interrupt at al.

On Nicks request, the HW FIFO support hasn't been enabled by default on the
RPi though.

Tested with the RPi.
2012-08-12 10:13:17 +00:00
skrll
4c5a9380ec Add support for the PL011 to plcom. Pull across a bunch of fixes from
com(4) while I'm here and do some other tidyup.

Tested on a RaspberryPi.

PL010 not tested.
2012-07-25 07:26:17 +00:00
skrll
346c2c544e Fix locking botch introduced in 1.36. 2012-07-05 10:56:52 +00:00
skrll
b8905ef0ec device_t/softc split
struct device * -> device_t
struct cfdata * -> cfdata_t
2012-05-20 10:28:44 +00:00
skrll
168b073de1 DOH. Replace a line that got accidently deleted in the last commit. 2012-05-20 07:57:34 +00:00
skrll
fc0cd919cc Replace the simple_lock with a kmutex_t. Update the locking to match
com(4) in the few places it didn't already.
2012-05-20 07:54:40 +00:00
skrll
b9703c3d18 Rename register values. No functional change - same code before and after.
Existing names are prefixed with PL01X_ where they're common between the
PL010 and the PL011. The PL010_/PL011_ prefixes are added where they're
found only on the respective chips.
2012-05-14 19:40:06 +00:00
bsh
cb55528a80 avoid warning with options PLCOM_DEBUG for INTEGRATOR. 2012-04-06 01:47:15 +00:00
tls
7b0b7dedd9 Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
   to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
   source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
   avoid expensive operations on disabled entropy sources; make the
   rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
   have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
   system events, and skew between clocks, with a sample implementation
   for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files).  Tested with release
builds on amd64 and evbarm and live testing on amd64.
2012-02-02 19:42:57 +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
dyoung
3dedfc004f Simplify the device-activation hook. Move some of the device
deactivation to the detachment routine, where it belongs.
2009-12-06 21:33:45 +00:00
rmind
7721462952 Use lwp_getpcb() on ARM (and acorn26/32), clean from struct user usage. 2009-11-21 20:32:13 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
cegger
634954287e use device_lookup_private to get softc 2008-06-11 23:24:43 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad
a2249ef75c Make ntp, pmc, reboot, sysarch, time syscalls MPSAFE. 2008-04-21 12:56:30 +00:00
ad
fbed3be26c Make compile. 2008-01-05 12:40:34 +00:00
ad
dc26833bb6 - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
2007-11-19 18:51:36 +00:00
garbled
d974db0ada Merge the ppcoea-renovation branch to HEAD.
This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
2007-10-17 19:52:51 +00:00
he
e8108f3e5b Remove a spurious brace. 2007-07-11 19:50:27 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
elad
65792a0340 More from Matt Fleming:
Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
2006-10-01 20:31:49 +00:00
elad
e8373398dc Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks! 2006-10-01 18:56:21 +00:00
ad
f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
elad
8ccb6c9341 integrate kauth. 2006-05-14 21:55:09 +00:00
thorpej
39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
thorpej
3ddf26777f Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
2006-02-20 16:50:36 +00:00
chs
33d70de438 remove the COM_MPLOCK option. always include the spinlock in the softc
and always call the simple_* locking functions.  the locking functions
are compiled out if they are not needed anyway, so a separate option
for this doesn't gain anything.

this also fixes the serial console on my alpha ES40 (which doesn't make much
sense since the com driver should still be under the big lock on alpha,
but whatever).
2005-12-27 00:46:38 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
kleink
aece7a90fd Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges.  Noted by David Holland in PR kern/31126.
2005-09-06 21:40:37 +00:00
rearnsha
b1f70d4d2d Fix shaddowed declarations of cn_trapped. 2005-06-04 13:38:08 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
lukem
08716eae82 __KERNEL_RCSID() 2003-07-15 00:24:37 +00:00
martin
d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
he
34c6df3404 Initialize the two new members of "struct consdev" to NULL so that
this file compiles again.
2003-03-08 09:47:13 +00:00
jdolecek
e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
gehenna
77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
atatat
31144d9976 Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command".  ERESTART is -1, which can lead to
confusion.  ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4.  No ioctl code should now return -1 anywhere.  The
ioctl() system call is now properly restartable.
2002-03-17 19:40:26 +00:00