Commit Graph

327 Commits

Author SHA1 Message Date
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
christos 82ab0be9ff Clear dtr on transition from !0 to 0, and set it on the opposite.
This leaves dtr alone in the normal case.
2014-04-08 00:09:15 +00:00
christos 4cd4dee55a PR/48720: John Kelly: com driver does not allow B0 to be set. The code to
handle B0 was commented out for no reason given at revision 1.99. POSIX
mandates to hangup on B0:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetattr.html
2014-04-06 23:29:58 +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
matt 7532101325 Now that cngetc supports -1 as a return value from the cn_getc routine,
let cngetc loop until a character is available so it can call the critpoll
hooks.
2013-12-22 18:20:46 +00:00
skrll 3f73102cea Use #if defined in previous. 2013-12-16 12:08:14 +00:00
htodd 3ebdd249d0 Fix build. 2013-12-16 01:51:19 +00:00
mbalmer 3f37aa7ac8 lcr is only used when COM_16650 is defined; unbreak the build 2013-12-15 15:55:39 +00:00
skrll 0bc393adf1 Only attempt to set 64byte fifo for 16750 when COM_16750 is defined.
Hi kiyohara.

PR/48359 NetBSD/cobalt 6.99.25 GENERIC kernel freeze at initializing com0
2013-12-15 11:06:57 +00:00
kiyohara b1b7c6a2ff Revirt 'Move the Marvell extension to com_mv.c' at Sun Sep 1 04:51:24 UTC 2013.
build test only.
2013-10-03 13:23:03 +00:00
martin bf471dab7e Minor tweaks for newer gcc 2013-09-12 12:54:39 +00:00
jmcneill 6b4d5e4626 no EFR on tl16c750, use AFE bit on MCR reg instead for flow control 2013-09-03 15:32:55 +00:00
kiyohara 38435b16f2 Add support 16750 64Byte FIFO. But not test. 2013-09-01 04:58:15 +00:00
kiyohara b5773b7ae3 Move the Marvell extension to com_mv.c. 2013-09-01 04:51:24 +00:00
kiyohara 157818c590 As for the console of ns16750, comintr() may be called before comopen().
If sc_lcr is not initialized at this time, console will be in an ugly state.
2013-07-27 06:54:35 +00:00
kiyohara 3950103e65 Remove white-spaces, null-line and new-line. 2013-07-27 06:43:56 +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
rkujawa 0f86c4f94a Add support for 16750 style UARTs. Activated by defining COM_16750.
Obtained from Marvell, Semihalf.
2013-04-20 11:52:40 +00:00
matt 1c06d41d98 Initialize t_softc. 2013-02-24 06:21:36 +00:00
macallan 7f088f1423 don't try to become console if we get is_console=false as device property 2013-01-10 17:38:10 +00:00
skrll d5795db78b Remove empty line. 2012-05-21 20:51:46 +00:00
christos 0758b27308 don't include <sys/rnd.h> before we define cn_trap, because it might bring
in <sys/systm.h>
2012-04-22 16:00:45 +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
jakllsch 823df23091 more whitespace and comment spelling fixes 2011-11-27 18:17:08 +00:00
jakllsch fcc28c8d61 whitespace consistency adjustment 2011-11-27 15:28:26 +00:00
matt 2a1887ef27 Allow COM_TOLERANCE to be tweakable. If comspeed returns an invalid
rate, don't use that error value to set the speed.
2011-05-28 19:30:19 +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 434fbfac7f Revert part of changes in rev 1.298:
- it breaks cobalt's serial console as mentioned in PR port-cobalt/44292
 - MCR_PRESCALE doesn't affect unless EFR_EFCR is set in the EFR register
 - even if MCR_PRESCALE is enabled we should define appropriate sc_type
   variants and BRG values should be adjusted in comspeed() per sc_type
 - sc_frequency should be adjusted in MD attachment if necessary
Tested on cobalt by several people, ok from jklos@
2011-01-22 16:59:26 +00:00
jklos 644246af8b Add support for 16650's prescaler from Frank Wille. Tested with
IOblix on Amiga.
2010-07-20 06:17:20 +00:00
dyoung ad6e139a80 Add default implementations for bus_space_is_equal(9),
bus_space_tag_create(9), and bus_space_tag_destroy(9).  Use
bus_space_is_equal(9) throughout the kernel to compare
bus_space_tag_t's.  Tested on i386 and on sparc64.
2010-04-19 18:24:26 +00:00
dyoung 6b732a0da7 MI code should not compare bus_space_tag_t! Introduce tags_are_equal()
for "comparing" two bus_space_tag_t's.  It is always true.

Everywhere that com(4) compares two tags, it compares to I/O base
addresses, too; comparing the base addresses should suffice.

TBD Clean this up more thoroughly.
2010-03-22 23:00:08 +00:00
dyoung c1b390d493 A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00
tsutsui 59882a6e03 To print bus_addr_t value, cast it to u_long rather than size_t. 2010-01-09 14:15:48 +00:00
dyoung cd6e1fbf91 Expand PMF_FN_* macros. 2010-01-08 19:53:10 +00:00
dyoung e98edc8502 Delete dead code. 2009-12-06 23:15:59 +00:00
rmind dbd9b86792 Remove some unecessary includes sys/user.h header. 2009-11-23 02:13:44 +00:00
dyoung 021235e4a6 Remove some dead code. 2009-11-12 20:38:35 +00:00
dyoung b2f2de753f Move the code in com_activate() to com_detach(), where it always
belonged.  Remove com_activate().

Consolidate information about the console on com(4) in a new struct
comcons_info.

Support detachment & re-attachment of a system console on com(4).
Re-attachment is somehow incomplete.  Ideally, if some other device
could take over as console, it would, but we're not quite there,
yet.
2009-11-12 20:37:09 +00:00
cegger 6d542a9a5c add KASSERT to identify when PR kern/40734 happens again.
It happened to me twice and to Emmanuel Dreyfus (reported on port-amd64 ML)
2009-05-06 07:27:42 +00:00
yamt b1fea83762 remove extra semicolons. 2009-01-03 03:43:21 +00:00
matt 17996c3ca8 Simplify NOERS case. Revert most changes back to 1.283. 2008-10-25 17:50:29 +00:00
tsutsui 9cb64a72eb Fix a botch in an FIFO check for 16650. 2008-10-25 15:21:57 +00:00
he 833cc988ed Replace a "type" with "sc->sc_type" to make this build again for cobalt
(and I'm sure a few others as well).
2008-10-25 10:05:43 +00:00
matt f759cc96ec Add support for 16550 chips without an Enhanced Register Set. 2008-10-24 04:43:08 +00:00
matt cfd3ec1da9 Remove OMAP gunk in com_activate, it's not needed.
Spotted by Matthias Drochner.
2008-07-14 15:40:55 +00:00
matt d22fb7c7d0 More forgotten changes from matt-armv6. 2008-04-28 22:00:01 +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
tsutsui 435efaffea If it's a high speed, trim the trigger level down to prevent overflows,
as comment says.  The piece of code was removed in rev 1.230,
but it looks an error on reverting of rev 1.228.
2008-04-11 12:45:08 +00:00