Commit Graph

1131 Commits

Author SHA1 Message Date
isaki 4eac595939 Move dev/audio_if.h -> dev/audio/audio_if.h 2019-05-04 07:20:07 +00:00
isaki c102f4caca Adapt am7930 families to audio2.
- Remove {input/output}_conv stuff from am7930_glue.
  Filter pipelines for user encoding are not necessary in audio2
  so the driver only needs to handle its hardware encoding.
- audioamd/vsaudio use an ordinal linear-mulaw conversion filter
  and bba requires special one.  dev/audio/mulaw.c supports this
  variant just for bba.  It might not a good way for bba but it
  keeps all other drivers simple.
- Tested on vsaudio(4) by naru@, bba(4) by tsutsui@ (a few months ago).
  Thanks!
2019-04-22 13:29:34 +00:00
isaki 6291b1348d Use C99 style struct initializer to audio_hw_if. 2019-03-16 12:09:56 +00:00
macallan 04a1595b63 adapt to changes in sxreg.h 2019-03-01 02:30:42 +00:00
macallan 9a79811e23 some register bits are defined differently by SunOS's sxreg.h and the SPAM
manual, upon investigation the hardware appears to agree with the SunOS header,
so adapt accordingly
2019-02-22 23:01:25 +00:00
mrg 8255ce9ee0 make *fd*.c's fd_dev_to_type() always a static inline. some
have it as a const, and have code to copy the defaults to
modify them before using them, but that probably requires a
real test to feel confident in changing.
2019-02-08 08:47:35 +00:00
macallan b135601990 don't crash when we're not the console 2019-01-17 23:05:15 +00:00
thorpej 6d4870476f Clean up initialization of com_regs structure, in preparation for
some additional changers.
2018-12-08 17:46:09 +00:00
riastradh d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
macallan 1ca1edecf6 do boundary checks when writing cursor sprite colour registers 2018-01-25 14:45:58 +00:00
macallan 49265ef4d6 enable font loading 2018-01-12 23:38:24 +00:00
macallan ca569de986 support underlines 2018-01-06 07:26:54 +00:00
macallan f6a791a3a0 fix tpyos and pastos 2017-12-08 22:28:54 +00:00
macallan abd9e70d68 add SCATTER/GATHER instructions 2017-12-07 19:15:56 +00:00
macallan 5738d83547 add load & store instructions for channel data type
mostly for Xorg
2017-10-30 21:41:39 +00:00
maya 18b796d442 Use C99 initializer for filterops
Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- 	{ a, b, c, d
+ 	{
+ 	.f_isfd = a,
+ 	.f_attach = b,
+ 	.f_detach = c,
+ 	.f_event = d,
};
2017-10-25 08:12:37 +00:00
macallan 4b66d9e2f9 add SX_STBM ( STore Byte Masked ) instruction 2017-01-13 21:49:46 +00:00
christos 2437894b76 catch up with sd changes. 2016-12-11 16:25:54 +00:00
macallan f2615f2d9a wipe glyph cache as needed when re-entering text mode
now the console is readable again when leaving X
2016-09-16 22:39:35 +00:00
macallan 602c62148b use DEFATTR if we're not the console and can't init defattr.
should appease clang
TODO: we should really init the glyphcache whith the first screen
2016-06-02 21:19:24 +00:00
macallan 8c670e8bb1 support anti-aliased fonts, glyphcache etc. 2016-04-30 05:23:03 +00:00
macallan d4cb83d843 sprinkle ()s in macros 2016-04-30 05:22:19 +00:00
macallan 13f197f799 RASTERCONSOLE is no more 2016-04-21 17:59:18 +00:00
dholland 25d3b9e7cb Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
2015-09-07 03:49:44 +00:00
mlelstv 6f00c789e1 Use C99-style initializers for struct dkdriver. 2015-04-26 15:15:19 +00:00
christos c182898b0d We have three sets of DTYPE_ constants in the kernel:
altq		Drop 		Type
	disklabel	Disk 		Type
	file		Descriptor	Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
2015-01-02 19:42:05 +00:00
snj f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
tsutsui 09d162f919 Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().
I'm not sure why this 18 year old bug didn't cause problem before
(at least my old 5.99.23 kernel worked), but probably it's triggered
by new gcc 4.8 which might do more aggressive memory allocation.
The problem is found by Nobuyoshi Sato on trying eject(1) against fd(4).

Should be pulled up to netbsd-7.
2014-08-19 14:43:41 +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
dholland 8c70ef39af Add d_discard to all struct bdevsw instances I could find.
I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
2014-07-25 08:02:18 +00:00
tsutsui 8b7b39a86f Add a newline at end of file. 2014-06-29 03:57:10 +00:00
macallan c32ba149e1 rev. 27 SX needs memory referencing instructions written to 64bit aligned
addresses ( my rev. 25 just ignores the lower 3 bits )
so, we zero these bits now
2014-04-23 16:54:21 +00:00
macallan a825263fc6 print chip revision on attach 2014-04-15 10:24:54 +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
mrg fa33d35f40 - remove unused but set variables.
- use __USE() where necessary.
- remove useless 'volatile' markers

kd.c:consinit() might be wrong for old proms, but i've not
changed it really.
2013-10-19 19:40:23 +00:00
macallan e74252408e comments & whitespace police 2013-08-14 01:53:27 +00:00
macallan 94cfee8919 add store-with-clamp instructions 2013-06-19 00:41:16 +00:00
macallan 263f0a1b9e fix typo 2013-06-12 20:44:20 +00:00
macallan 3a5f3d0384 document arithmetics instructions 2013-06-12 20:43:21 +00:00
macallan b2dfd674e8 fix serial type&pasto, while there add SX_ADD instructions 2013-06-12 04:23:46 +00:00
macallan 74a80711ca add a bunch more instructions ( still not complete but we're getting there ) 2013-06-05 18:15:06 +00:00
macallan 8df3ac20cc report actual VRAM size in fb_type.fb_size 2013-06-04 22:31:30 +00:00
macallan cfaf702b2e add STore with (plane) Mask instruction 2013-06-04 22:30:30 +00:00
macallan 7ad41540d3 actually map the whole SX IO space instead of just the first page over and
over again (doh)
2013-06-04 13:42:37 +00:00
macallan d9d045776f add SX_SELECT_S instruction 2013-05-30 20:09:23 +00:00
macallan be5435b2d3 install sxreg.h to /usr/include/sparc/ 2013-05-30 20:08:47 +00:00
macallan b4df4454b7 allow userland to map SX registers and IO space 2013-05-29 22:26:39 +00:00
macallan 43e7cffbe8 fix a typo 2013-05-29 22:25:23 +00:00
jdc 9e86b737ce Check if sbus is defined in the kernel configuration before using it.
From Taylor R Campbell.
2013-03-24 17:50:26 +00:00
macallan aadf8bb6f4 break some more long lines 2013-02-12 22:24:47 +00:00