Commit Graph

110 Commits

Author SHA1 Message Date
Sam Leffler
ca640ca965 check copyin return values when loading pallete
Noticed by:	Coverity Prevent analysis tool
2005-03-26 18:01:35 +00:00
Warner Losh
538565c4a5 Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +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
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Ruslan Ermilov
b7b28d26c4 Fixed compilation warnings with option VGA_NO_MODE_CHANGE.
PR:		kern/71130
2004-12-15 13:49:25 +00:00
Peter Wemm
2169193596 Converge towards i386. I originally resisted creating <machine/pc/bios.h>
because it was mostly irrelevant - except for the silly BIOS_PADDRTOVADDR
etc macros.  Along the way of working around this, I missed a few things.

* Make syscons properly inherit the bios capslock/shiftlock/etc state like
  i386 does.  Note that we cannot inherit the bios key repeat rate because
  that requires a bios call (which is impossible for us).
* Give syscons the ability to beep on amd64.  Oops.

While here, make bios.c compile and add it to files.amd64.
2004-09-24 01:08:34 +00:00
Dag-Erling Smørgrav
c930712a51 While we're revisiting old sins, try to clean up the code a little and
make it more style(9)ish.
2004-08-06 21:35:51 +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
Marius Strobl
64e6e863ac - Add missing <sys/module.h>. [1]
- Remove unused includes.
- Sort includes.

Reported by:	Pyun YongHyeon <yongari@kt-is.co.kr> [1]
2004-07-09 23:12:22 +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
John Baldwin
092a5c4530 Remove atdevbase and replace it's remaining uses with direct references to
KERNBASE instead.
2004-06-10 20:31:00 +00:00
Poul-Henning Kamp
186f2b9e04 Add missing <sys/module.h> includes currently relying on nested include
in <sys/kernel.h>
2004-06-03 06:10:02 +00:00
Poul-Henning Kamp
5dba30f15a add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Warner Losh
f36cfd49ad Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson
2004-04-07 20:46:16 +00:00
Thomas Moestl
6e7272f69d - Use an ihandle_t to store the stdout instance handle instead of a
phandle_t. Since both are typedefed to unsigned int, this is more
  or less cosmetic.
- Fix the code that determines whether a creator instance was used
  for firmware output (and should not be blanked on initialization).
  Since r1.2 of dev/fb/creator.c, this consisted comparing a handle of
  an instance of a package with a handle of the package itself.
  Use the test from r1.1, which utilizes OF_instance_to_package().

Submitted by:	Marius Strobl <marius@alchemy.franken.de>
2004-04-04 12:52:22 +00:00
Jacques Vidrine
4f2eff8c32 Correct a potential panic condition that could be caused when getting or
setting the VGA palette.

Reported by:	Christer Öberg <christer.oberg@texonet.com>
Reviewed by:	bde
2004-04-03 15:28:25 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +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
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
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
David E. O'Brien
2affa9f7b1 Don't confuse NULL with 0. 2004-01-02 10:46:38 +00:00
Jake Burkholder
036913d1be Fix a typo. Allow for the creator not being stdout. 2003-11-11 07:34:08 +00:00
Poul-Henning Kamp
4866f95d76 Change fb_attach() and fb_detach() to take a integer unit number rather
than a dev_t.

All of the dev_t's passed were bogusly created with makedev()
2003-09-26 10:41:44 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Jake Burkholder
dfc161b4ad Changed ??? to foo in dead code since ??? screws up my editor. 2003-08-24 02:42:01 +00:00
Jake Burkholder
bf920dafa4 Add a driver for creator upa frame buffers found in many sparc64 machines.
These are fixed resolution and operate only in pixel mode so they present
a challenge to syscons (square peg, round hole, etc, etc).  The driver
provides a video driver interface for syscons and a separate character
device for X to mmap.  Wherever possible the creator's accelarated graphics
functions are used so text mode is very fast.

Based roughly on the openbsd driver.
2003-08-24 01:15:40 +00:00
Marcel Moolenaar
fe9d118aa2 o Explicitly cast the second argument to bus_space_set_region_#()
to intptr_t. This fixes a compiler warning (integer from pointer
   without cast) in scvgarndr.c when SC_PIXEL_MODE is defined.
o  Define readb() and writeb(). Both are used in scvgarndr.c when,
   guess what, SC_PIXEL_MODE is defined.

Both changes are ia64 specific.

Found by: LINT
2003-08-23 08:52:52 +00:00
Warner Losh
4fbd232c86 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 05:54:52 +00:00
Peter Wemm
637068b1d3 Low risk amd64 fix. Use a vm_offset_t for the virtual location of the
buffer space instead of a u_int32_t.  Otherwise the upper 32 bits of
the address space get truncated and syscons blows up.

Approved by:	re (safe, low risk amd64 fixes)
2003-05-23 05:10:49 +00:00
Marcel Moolenaar
ae3c9aff52 Unbreak alpha and ia64 builds. The previous change made the inclusion
of <machine/pc/bios.h> specific to i386 and added a conditional define
for BIOS_PADDRTOVADDR that depends on ISA_HOLE_START. The latter is
undefined on alpha and ia64. Since the former is defined the same on
both alpha and ia64, assume the ISA_HOLE_START dependent definition
is specific to amd64 and use the identity-mapping in all other cases.

This of course is getting uglier every day...
2003-05-02 01:36:27 +00:00
Peter Wemm
8c3765708a Add AMD64 support to dev/fb. It isn't optimized. 2003-05-01 04:21:05 +00:00
Marcel Moolenaar
0ba311ef3a Keep syscons specific I/O functions internal/specific to syscons on
ia64 by defining them in terms of newbus. Add a static inline for
fillw(), which doesn't have anything to do with I/O.
It's still ugly, but now the ugliness can be removed from ia64
specific headers.
2003-04-29 07:06:44 +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
Poul-Henning Kamp
b4b138c27f Including <sys/stdint.h> is (almost?) universally only to be able to use
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.
2003-03-18 08:45:25 +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
Poul-Henning Kamp
6d473442ca NODEVFS cleanup:
Don't call cdevsw_{add,remove}()
Bracket a more correct subset in "#if experimental"
2003-02-26 21:14:39 +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
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +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
Maxime Henrion
aa26768242 Warning fixes. 2002-11-11 10:28:44 +00:00
Maxime Henrion
97be736aca Warning fix. 2002-11-11 10:17:01 +00:00
John Baldwin
3f57c87ebf Fix printf warnings with %j and uintmax_t. 2002-11-08 20:59:23 +00:00
Poul-Henning Kamp
8311f05a45 Fix rare and probably inconsequential memory leak.
Spotted by:	FlexeLint
2002-10-02 20:34:23 +00:00
Alfred Perlstein
4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00
Philippe Charnier
93b0017f88 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:23:09 +00:00
David E. O'Brien
0301e9c83b Turn on TGA support.
Submitted by:	Andrew M. Miklic <AndrwMklc@cs.com>
2002-04-13 22:34:16 +00:00
Poul-Henning Kamp
2ce7d7a033 GC various bits and pieces of USERCONFIG from all over the place. 2002-04-09 11:18:46 +00:00
David E. O'Brien
6e551fb628 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
Dag-Erling Smørgrav
b1511f4fb5 syscons' set_border() is now named sc_set_border(), so there is no longer
a naming conflict.
2001-11-06 02:36:26 +00:00