summaryrefslogtreecommitdiff
path: root/sys/dev/dcons/dcons_os.c
Commit message (Collapse)AuthorAgeFilesLines
* Last minute TTY API change: remove mutex argument from tty_alloc().Ed Schouten2009-05-291-1/+1
| | | | | | | | | | | | | I don't want people to override the mutex when allocating a TTY. It has to be there, to keep drivers like syscons happy. So I'm creating a tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex() should eventually be removed. The advantage of this approach, is that we can just remove a function, without breaking the regular API in the future. Notes: svn path=/head/; revision=193018
* Reduce the dcons polling frequency to 25 Hz.Ed Schouten2009-04-061-1/+1
| | | | | | | | | | | | | It makes little sense to use 100 Hz polling in dcons. We cannot live without polling, because that's just how dcons works. It polls the buffer filled by the firewire hardware. 25 Hz is probably enough for most use cases. Discussed with: rwatson Tested by: kan Notes: svn path=/head/; revision=190771
* Fix logic in MOD_LOAD handler to call dcons_attach after all successfulAlexander Kabaev2009-04-061-1/+2
| | | | | | | | | dcons_drv_init invocations. Testing return value for 0 does not work for cases where dcons_drv_init was called already as part of low level console initialization. Notes: svn path=/head/; revision=190756
* We need to initialize the console for dcons to work.Warner Losh2009-03-131-0/+1
| | | | | | | Submitted by: nork@ Notes: svn path=/head/; revision=189752
* Check the return values of contigmalloc(9) as well as bus_dma(9)Marius Strobl2009-01-071-7/+11
| | | | | | | | | | | | | | | | | functions and stop attaching of dcons(4) and dcons_crom(4) if they indicate failure. This fixes a panic seen on sparc64 machines with no free physical memory in the requested 32-bit region but still doesn't make dcons(4)/dcons_crom(4) these work. I think the latter can be fixed by simply specifying ~0UL as the upper limit for contigmalloc(9) and letting the bounce pages and the IOMMU respectively handle limitations of the DMA engine. I didn't want to change that without the consensus of simokawa@ though, who unfortunately didn't reply so far. MFC after: 1 week Notes: svn path=/head/; revision=186876
* Also make dcons(4) use MPSAFE callouts.Ed Schouten2008-11-191-1/+1
| | | | | | | | The callout locks the TTY layer the way it should, so there is no reason why its callout shouldn't set this flag. Notes: svn path=/head/; revision=185107
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.Ed Schouten2008-08-201-345/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following: - Improved driver model: The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers. If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver. - Improved hotplugging: With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc). The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly. - Improved performance: One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters. Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING. Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan Notes: svn path=/head/; revision=181905
* Spell KDB_REQ_REBOOT correctly.Peter Wemm2008-05-051-1/+1
| | | | Notes: svn path=/head/; revision=178771
* Expand kdb_alt_break a little, most commonly used with the optionPeter Wemm2008-05-041-10/+24
| | | | | | | | | | | | | | | | | | | | | | ALT_BREAK_TO_DEBUGGER. In addition to "Enter ~ ctrl-B" (to enter the debugger), there is now "Enter ~ ctrl-P" (force panic) and "Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons). We've used variations of this at work. The force panic sequence is best used with KDB_UNATTENDED for when you just want it to dump and get on with it. The reboot request is a safer way of getting into single user than a power cycle. eg: you've hosed the ability to log in (pam, rtld, etc). It gives init the reboot signal, which causes an orderly reboot. I've taken my best guess at what the !x86 and non-sio code changes should be. This also makes sio release its spinlock before calling KDB/DDB. Notes: svn path=/head/; revision=178766
* Add a new 'why' argument to kdb_enter(), and a set of constants to useRobert Watson2007-12-251-2/+4
| | | | | | | | | | | | for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run. Assign approximate why values to all current consumers of the kdb_enter() interface. Notes: svn path=/head/; revision=174898
* We don't need to call dcons_poll event handlers if KDB is not active.Hidetoshi Shimokawa2007-08-171-3/+9
| | | | | | | Approved by: re (kensmith) Notes: svn path=/head/; revision=171867
* - Don't force to be the GDB port since dcons(4) is in GENERIC now.Hidetoshi Shimokawa2007-06-111-1/+5
| | | | | | | | | To enable the GDB port of dcons(4), you need to put dcons_gdb=1 in /boot/loader.conf. Notes: svn path=/head/; revision=170537
* Don't invalidate dcons buffer on shutdown.Hidetoshi Shimokawa2007-06-081-0/+2
| | | | | | | We would like to keep connection after halt. Notes: svn path=/head/; revision=170426
* Replace breakpoint() with kdb_enter().Hidetoshi Shimokawa2007-06-081-2/+2
| | | | Notes: svn path=/head/; revision=170418
* Poll bus resets on FireWire while kdb/gdb is active.Hidetoshi Shimokawa2007-06-081-0/+1
| | | | | | | | | | | | | | | | | | Now, it's safe to call the fwohci interrupt(polling) routine while ddb/gdb is active. After this change, a dcons connnection over FireWire can survive bus resets even in kernel debugger. This means that it is not too late to plug a FireWire cable after a panic to investigate the problem. Actually there is a small window(between a jump to kernel from loader and initialization of dcons_crom) in which no one can take care of a bus reset. Except that window, firewire console should keep working from loader to reboot even with a panic and a bus reset. (as far as you enable LOADER_FIREWIRE_SUPPORT) Notes: svn path=/head/; revision=170408
* We should better ignore a break on gdb port if gdb is not enabled.Hidetoshi Shimokawa2007-05-281-2/+2
| | | | Notes: svn path=/head/; revision=170043
* Make compile without GDB option.Hidetoshi Shimokawa2007-05-271-4/+11
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=170017
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningRobert Watson2006-11-061-1/+3
| | | | | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net> Notes: svn path=/head/; revision=164033
* Convert to new console interface.Poul-Henning Kamp2006-05-261-9/+7
| | | | Notes: svn path=/head/; revision=158959
* Eliminate gdb_checkc member from GDB_DBGPORT(), it is never used.Poul-Henning Kamp2006-05-261-9/+1
| | | | | | | | Use polling behaviour for gdb_getc() where convenient, this edges us closer to the console code. Notes: svn path=/head/; revision=158950
* Use ttyalloc() instead of ttymalloc()Poul-Henning Kamp2006-01-041-2/+2
| | | | Notes: svn path=/head/; revision=154016
* Fix -Wundef warnings found when compiling i386 LINT, GENERIC andRuslan Ermilov2005-12-051-3/+3
| | | | | | | custom kernels. Notes: svn path=/head/; revision=153110
* Make ttyconsolemode() call ttsetwater() so that drivers don't have to.Poul-Henning Kamp2005-10-161-1/+0
| | | | Notes: svn path=/head/; revision=151388
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139749
* Use dcons buffer passed by loader on amd64.Hidetoshi Shimokawa2004-10-281-2/+4
| | | | Notes: svn path=/head/; revision=137013
* - Use quad_t for dcons buffer address and size.Hidetoshi Shimokawa2004-10-241-4/+11
| | | | | | | - Allow read/write access to dcons buffer passed by loader(8). Notes: svn path=/head/; revision=136898
* Add new function ttyinitmode() which sets our systemwide defaultPoul-Henning Kamp2004-10-181-6/+1
| | | | | | | | | | | | | | | | | modes on a tty structure. Both the ".init" and the current settings are initialized allowing the function to be used both at attach and open time. The function takes an argument to decide if echoing should be enabled. Echoing should not be enabled for regular physical serial ports unless they are consoles, in which case they should be configured by ttyconsolemode() instead. Use the new function throughout. Notes: svn path=/head/; revision=136680
* Fix warnings on non-i386 arch.Hidetoshi Shimokawa2004-10-141-0/+2
| | | | | | | Submitted by: keramida Notes: svn path=/head/; revision=136498
* - Split dcons core code and OS dependent code.Hidetoshi Shimokawa2004-10-131-0/+746
- Implement dcons_ischar() and dcons_load_buffer(). - If loader passed a dcons buffer address, keep using it. (We still need a patch to cheat memory management system.) Notes: svn path=/head/; revision=136467