Commit Graph

16 Commits

Author SHA1 Message Date
John Baldwin
0b377a49fa FB_INSTALL_CDEV: Remove this option and related code.
This option was never enabled in GENERIC and does not appear to work
(the cdevsw is stored in a global array but never passed to make_dev
to be associated with a character device).

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D35008
2022-04-21 10:29:14 -07:00
Konstantin Belousov
9a52756044 i386: Merge PAE and non-PAE pmaps into same kernel.
Effectively all i386 kernels now have two pmaps compiled in: one
managing PAE pagetables, and another non-PAE. The implementation is
selected at cold time depending on the CPU features. The vm_paddr_t is
always 64bit now. As result, nx bit can be used on all capable CPUs.

Option PAE only affects the bus_addr_t: it is still 32bit for non-PAE
configs, for drivers compatibility. Kernel layout, esp. max kernel
address, low memory PDEs and max user address (same as trampoline
start) are now same for PAE and for non-PAE regardless of the type of
page tables used.

Non-PAE kernel (when using PAE pagetables) can handle physical memory
up to 24G now, larger memory requires re-tuning the KVA consumers and
instead the code caps the maximum at 24G. Unfortunately, a lot of
drivers do not use busdma(9) properly so by default even 4G barrier is
not easy. There are two tunables added: hw.above4g_allow and
hw.above24g_allow, the first one is kept enabled for now to evaluate
the status on HEAD, second is only for dev use.

i386 now creates three freelists if there is any memory above 4G, to
allow proper bounce pages allocation. Also, VM_KMEM_SIZE_SCALE changed
from 3 to 1.

The PAE_TABLES kernel config option is retired.

In collaboarion with: pho
Discussed with:	emaste
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D18894
2019-01-30 02:07:13 +00:00
Pedro F. Giffuni
718cf2ccb9 sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-27 14:52:40 +00:00
Robert Noland
cfd7bacef2 Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.
This replaces d_mmap() with the d_mmap2() implementation and also
changes the type of offset to vm_ooffset_t.

Purge d_mmap2().

All driver modules will need to be rebuilt since D_VERSION is also
bumped.

Reviewed by:	jhb@
MFC after:	Not in this lifetime...
2009-12-29 21:51:28 +00:00
Jung-uk Kim
bf71c25f87 - Partially revert hackish r198964 and r199002.
- Add a proxy driver vgapm to help vgapci to save/load VGA state.
- Move device_set_desc() to the right place while we are here.

Reviewed by:	jhb
2009-11-12 17:56:56 +00:00
Jung-uk Kim
b66e2b8e50 Remove duplicate suspend/resume code from vga_pci.c and let vga(4) register
itself to an associated PCI device if it exists.  It is little bit hackish
but it should fix build without frame buffer driver since r198964.
Fix some style(9) nits in vga_isa.c while we are here.
2009-11-06 20:32:26 +00:00
Jung-uk Kim
7ac3e951e3 Save/restore VGA color palette while suspending and resuming. 2009-11-04 00:58:20 +00:00
Ed Schouten
6bfa9a2d66 Replace all calls to minor() with dev2unit().
After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.

This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.

Reviewed by:	kib
2008-09-27 08:51:18 +00:00
Ian Dowse
528433ba71 Save and restore the VGA state across a suspend-resume cycle. This
is particularly useful when VESA is available (either `options VESA'
or load the vesa module), as BIOSes in some notebooks may correctly
save and restore LCD panel settings using VESA in cases where calling
the video BIOS POST is not effective. On some systems it may also
be necessary to set the hw.acpi.reset_video sysctl to 0.
2005-02-28 21:06:14 +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
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
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Kazutaka YOKOTA
6e8394b8ba The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize
  some of complicated functions.

- Many static variables are moved to the softc structure.

- Added a new key function, PREV.  When this key is pressed, the vty
  immediately before the current vty will become foreground.  Analogue
  to PREV, which is usually assigned to the PrntScrn key.
  PR: kern/10113
  Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>

- Modified the kernel console input function sccngetc() so that it
  handles function keys properly.

- Reorganized the screen update routine.

- VT switching code is reorganized.  It now should be slightly more
  robust than before.

- Added the DEVICE_RESUME function so that syscons no longer hooks the
  APM resume event directly.

- New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING,
  SC_NO_HISTORY and SC_NO_SYSMOUSE.
  Various parts of syscons can be omitted so that the kernel size is
  reduced.

  SC_PIXEL_MODE
  Made the VESA 800x600 mode an option, rather than a standard part of
  syscons.

  SC_DISABLE_DDBKEY
  Disables the `debug' key combination.

  SC_ALT_MOUSE_IMAGE
  Inverse the character cell at the mouse cursor position in the text
  console, rather than drawing an arrow on the screen.
  Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG)

  SC_DFLT_FONT
  makeoptions "SC_DFLT_FONT=_font_name_"
  Include the named font as the default font of syscons.  16-line,
  14-line and 8-line font data will be compiled in.  This option replaces
  the existing STD8X16FONT option, which loads 16-line font data only.

- The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c.

- The video driver provides a set of ioctl commands to manipulate the
  frame buffer.

- New kernel configuration option: VGA_WIDTH90
  Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60.  These
  modes are mot always supported by the video card.
  PR: i386/7510
  Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx.

- The header file machine/console.h is reorganized; its contents is now
  split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h
  (another new file).  machine/console.h is still maintained for
  compatibility reasons.

- Kernel console selection/installation routines are fixed and
  slightly rebumped so that it should now be possible to switch between
  the interanl kernel console (sc or vt) and a remote kernel console
  (sio) again, as it was in 2.x, 3.0 and 3.1.

- Screen savers and splash screen decoders
  Because of the header file reorganization described above, screen
  savers and splash screen decoders are slightly modified.  After this
  update, /sys/modules/syscons/saver.h is no longer necessary and is
  removed.
1999-06-22 14:14:06 +00:00
Kazutaka YOKOTA
617b908036 Add the new keyboard driver and video card driver. They will be
used by console drivers.

(They are not yet activated yet.  Wait for announcement later.)
1999-01-09 02:44:50 +00:00