Commit Graph

560 Commits

Author SHA1 Message Date
Poul-Henning Kamp
672c05d49c Preparation commit for the tty cleanups that will follow in the near
future:

rename ttyopen() -> tty_open() and ttyclose() -> tty_close().

We need the ttyopen() and ttyclose() for the new generic cdevsw
functions for tty devices in order to have consistent naming.
2004-07-15 20:47:41 +00:00
Poul-Henning Kamp
3e019deaed Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".
2004-07-15 08:26:07 +00:00
Stefan Farfeleder
439dfb0c35 Remove erroneous semicolons. 2004-07-13 16:06:19 +00:00
Marcel Moolenaar
6af8e47df7 Update for the KDB framework. Sanitize the alpha console code now that
it's in the way even more. Basicly: remove all alpha specific console
support from gfb(4), sio(4) and syscons(4). Rewrite the alpha console
initialization to be identical to all other platforms. In a nutshell:
call cninit().
The platform specific code now only sets or clears RB_SERIAL and thus
automaticly causes the right console to be selected.

sio.c:
o  Replace the remote GDB hacks and use the GDB debug port interface
   instead.
o  Make debugging code conditional upon KDB instead of DDB.
o  Call kdb_alt_break() instead of db_alt_break().
o  Call kdb_enter() instead of breakpoint().
o  Remove the ugly compatibility of using the console as the debug
   port.
2004-07-10 22:29:41 +00:00
Poul-Henning Kamp
f3732fd15b Second half of the dev_t cleanup.
The big lines are:
	NODEV -> NULL
	NOUDEV -> NODEV
	udev_t -> dev_t
	udev2dev() -> findcdev()

Various minor adjustments including handling of userland access to kernel
space struct cdev etc.
2004-06-17 17:16:53 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
fe3ec6224a Manual edits to change linesw[]-frobbing to ttyld_*() calls. 2004-06-04 20:04:52 +00:00
Poul-Henning Kamp
2140d01b27 Machine generated patch which changes linedisc calls from accessing
linesw[] directly to using the ttyld...() functions

The ttyld...() functions ar inline so there is no performance hit.
2004-06-04 16:02:56 +00:00
Poul-Henning Kamp
4b5f407579 Remove unused variable. 2004-06-01 19:02:51 +00:00
Poul-Henning Kamp
138fbf675a Gainfully employ the new ttyioctl in the trivial cases. 2004-06-01 13:49:28 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Ken Smith
34b678a695 Rearrangements needed for syscons(4) to be used as a console device
on architectures that need to call cninit() before the machine is
ready to support mutexes (required by make_dev()).

	- Remove make_dev() call from scinit() when flags indicate
	  unit is the system console, rely on sc_attach_unit() to
	  handle it.
	- When trying to access current screen's status (scr_stat
	  structure) use the static one provided for the initial
	  system console if no dev_t is available.
	- When calling make_dev() in sc_attach_unit() catch special
	  case of system's initial console and set up dev_t structure
	  to include pointer to console's scr_stat struct.

Reviewed by:	marcel
Tested by:	marcel, grehan (ppc), others on current@
Approved by:	rwatson (mentor)
2004-04-02 15:02:44 +00:00
Ruslan Ermilov
200c238e95 Fixed a nasty old bug where a visual bell in the currently active
VTY prevented waking up processes waiting for the output queue to
get free on other VTYs.

In collaboration with:	Vsevolod Lobko
MFC after:		1 week
2004-03-18 21:07:54 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
8e1f1df080 Device megapatch 3/6:
Add missing D_TTY flags to various drivers.

Complete asserts that dev_t's passed to ttyread(), ttywrite(),
ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty
pointer.

Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default
cdevsw methods for D_TTY drivers and remove the explicit initializations
in various drivers cdevsw structures.
2004-02-21 20:41:11 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Poul-Henning Kamp
f457ed1403 Try again to get rid of makedev(). 2004-02-14 17:56:59 +00:00
Poul-Henning Kamp
18e47b55a9 Back out my last commit to syscons, things seem to be far more evil
than suspected.

and obviously nobody runs the patches I post to -current :-(

Poul-Henning
2004-02-13 12:04:15 +00:00
Poul-Henning Kamp
f484fc6593 Don't use makedev() to hack up dev_t's early in boot, do it right
with make_dev() (and avoid doing it again later).
2004-02-12 21:32:59 +00:00
Alexander Kabaev
e99c09e2dc Eliminate global cons_unavailable flag and replace it by the status
bit maintained on a per-device basis. Single variable is inadequate
on machines running with multiple consoles enabled.
2004-02-05 01:56:43 +00:00
Peter Grehan
a2dce78a84 __powerpc__ conditional code for the syscons OpenFirmware/PPC framebuffer.
Took the opportunity to reduce

 __i386__ || __ia64__ || __amd64__ || __sparc64__ || __powerpc__

 to

 !__alpha__

reviewed by: gallatin
2004-01-21 05:08:51 +00:00
Nate Lawson
e8c321c92f Fix a panic that occurs when resuming. For some reason, sc->cur_scp is
NULL.

Submitted by:	Andrew Thompson <andy@fud.org.nz>
2003-10-29 20:48:13 +00:00
Poul-Henning Kamp
c9f007b685 Convert to cn_name rather than cn_dev. 2003-09-26 18:57:34 +00:00
Jake Burkholder
d893d5f8dc Fix the alpha kernel build.
Pointy hat to:	jake
2003-08-25 21:32:00 +00:00
Yoshihiro Takahashi
ad81a26706 Merge pc98 support from sys/pc98/pc98/syscons.c. 2003-08-25 07:48:42 +00:00
David E. O'Brien
42af95a3c2 Use __FBSDID().
Also some minor style cleanups.
2003-08-24 18:17:24 +00:00
Jake Burkholder
73b0c90728 - Add a font width field to struct scr_stat. Use this instead of '8'.
- Use the values in the video info for the font size and width instead
  of second guessing.
2003-08-24 04:04:44 +00:00
Jake Burkholder
6817cec98e - Remember to flip the foreground and background color attributes in
gfb_draw if 'flip' is specified.  This causes the mouse cut region
  to be displayed in reverse color so it is visbile.
- Use the "other" implementation of gfb_cursor for the creator driver,
  which doesn't assume there is a hardware cursor.  It seems that the
  hardware cursor that creator provides doesn't display the character
  under the cursor in reverse colors, so the driver does this manually
  and uses the hardware cursor for the mouse pointer (which it also works
  much better for).  This is wedged here because it required less hoops
  than accessing the syscons vtb from inside the video driver, which is
  needed to read the character and color attributes under the new cursor
  position.
2003-08-24 02:31:55 +00:00
Jake Burkholder
8b9698b711 Add sparc64 ifdefs. 2003-08-24 00:44:00 +00:00
Jake Burkholder
4ceb2b2039 Fix endian bugs accessing ioctl arguments that are passed by value. 2003-08-24 00:35:10 +00:00
Yoshihiro Takahashi
720cdc05bb Use the clear function provided by the video adapter driver.
Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
2003-07-21 13:04:54 +00:00
Juli Mallett
b0327095f6 Use SC_NO_CUTPASTE to protect cutpaste variables correctly, fixing the
-Werror build with such option, but not other combinations.  LINT
misses this because syscons knobs in LINT turn off a lot of code.

Reviewed by:	marcel (some time ago)
2003-06-01 04:42:14 +00:00
Poul-Henning Kamp
670966596b Remove unused variable(s).
Found by:       FlexeLint
2003-05-31 20:29:34 +00:00
Peter Wemm
7edc7b0d3b Trivial addition of __amd64__ to the ifdefs for platforms that use
i386-style vga console support.

Approved by:  re
2003-05-09 18:24:40 +00:00
Alexander Kabaev
104a9b7e3e Deprecate machine/limits.h in favor of new sys/limits.h.
Change all in-tree consumers to include <sys/limits.h>

Discussed on:	standards@
Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-04-29 13:36:06 +00:00
Matthew N. Dodd
618095ccef Catch up with recent events. 2003-03-27 07:37:02 +00:00
Jake Burkholder
227f9a1c58 - Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
  with PAE.
- Use this to represent physical addresses in the MI vm system and in the
  i386 pmap code.  This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
  detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by:	DARPA, Network Associates Laboratories
Discussed with:	re, phk (cdevsw change)
2003-03-25 00:07:06 +00:00
Matthew N. Dodd
b7b5ae3edb Use repo-copied files in sys/i386/bios. 2003-03-24 19:14:46 +00:00
John Baldwin
c2fae87169 Don't call sysbeep() in sc_bell() if either duration or pitch is zero.
Otherwise sysbeep() makes an annoying clicking sound on some systems.
'kbdcontrol -b off' just sets the duration and pitch to zero, it doesn't
set the QUIET_BELL flag.

Tested by:	SorAlx <soralx@cydem.zp.ua>
PR:		misc/41772
MFC after:	1 week
2003-03-24 15:56:00 +00:00
Poul-Henning Kamp
182a9f7455 Make nokqfilter() return the correct return value.
Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
2003-03-03 16:24:47 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Dag-Erling Smørgrav
521f364b80 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
Maxime Henrion
03ab197379 When DDB is in the kernel, unlock VTY switching so that we
don't end up freezing the box.  This makes VTY locking useless
in the DDB case but a box which is supposed to be physically
secure shouldn't compile DDB anyway.

Reviewed by:	silence on -audit
2003-02-27 18:24:06 +00:00
Maxime Henrion
07159f9c56 Cleanup of the d_mmap_t interface.
- Get rid of the useless atop() / pmap_phys_address() detour.  The
  device mmap handlers must now give back the physical address
  without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
  int.  Now we properly pass a vm_offset_t * and expect it to be
  filled by the mmap handler when the mapping was successful.  The
  mmap handler must now return 0 when successful, any other value
  is considered as an error.  Previously, returning -1 was the only
  way to fail.  This change thus accidentally fixes some devices
  which were bogusly returning errno constants which would have been
  considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
  no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with:		alc, phk, jake
Reviewed by:		peter
Compile-tested on:	LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on:	i386
2003-02-25 03:21:22 +00:00
Poul-Henning Kamp
263444cfbf Change the console interface to pass a "struct consdev *" instead of a
dev_t to the method functions.

The dev_t can still be found at struct consdev *->cn_dev.

Add a void *cn_arg element to struct consdev which the drivers can use
for retrieving their softc.
2003-02-20 20:54:45 +00:00
Olivier Houchard
fe6d8dd8ee Add a "hw.syscons.bell" sysctl, which can disable the bell at syscons level. 2003-02-20 03:27:09 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Ruslan Ermilov
4ce9429c20 Added dependency on the apm(4) module. 2003-02-15 21:22:19 +00:00
Alfred Perlstein
b7f305981e chase more of the MIN/MAX mess. *sigh* 2003-02-02 13:52:25 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00