Commit Graph

319 Commits

Author SHA1 Message Date
riastradh 8d92e516f8 sunkbd(4): Convert to ttylock/ttyunlock. 2022-10-26 23:47:55 +00:00
thorpej 882ce77c82 Remove unnecessary include of <sys/malloc.h>. 2022-09-25 21:27:39 +00:00
macallan beb46a007b be lazy about clearing the cursor - in most cases we're about to overwrite it
anyway. Same logic as with VCONS_DONT_READ.
visible speedup in things like systat and top
2022-04-28 03:12:03 +00:00
thorpej 12ae65d98c Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.

NetBSD 9.99.89
2021-09-26 01:16:07 +00:00
thorpej c7fb772b85 Merge thorpej-cfargs2. 2021-08-07 16:18:40 +00:00
thorpej 2685996b0e Merge thorpej-cfargs branch:
Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
2021-04-24 23:36:23 +00:00
thorpej 03d3394d5e Use sel{record,remove}_knote(). 2020-12-18 01:54:22 +00:00
hannken 555a6dbc47 Change proc_lock -> &proc_lock. 2020-05-24 10:42:27 +00:00
jdc c20fcc6f26 If the sector size is 0, return early in readdisklabel().
Prevents a panic trying to use a 0-sized buffer, which can happen if we run
(e.g.) `scsictl /dev/cd0c identify` with no medium in the CD drive.
2020-05-03 06:31:02 +00:00
tsutsui 566e6833b5 Fix panic on sun3 when any key is typed when kbd is not console. PR/54873
Should be pulled up to netbsd-9.
2020-01-18 21:08:42 +00:00
chs d47bcd296c in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
2019-11-10 21:16:21 +00:00
christos 021d832a13 centralize setdisklabel(9) 2019-04-03 22:10:49 +00:00
macallan 2b6d546e2a apply patches from PR 49639
compile tested only for lack of hardware
2019-01-21 06:23:17 +00:00
macallan 3c64c6cf95 allow font loading, resizing etc. 2019-01-19 00:16:43 +00:00
mrg 33a22d2365 update for GCC 6:
kbd_input_wskbd() has a missing {} issue.
2018-02-08 10:52:05 +00:00
martin 4908bc3fd9 PR port-sparc64/52622: mark the parent device as TS_KERN_ONLY,
so userland will not touch it (and change serial params w/o our
controll).
2017-10-31 10:46:47 +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
martin b9dbf5bad7 Disks without a disk label happen in normal operation (both as USB
stick or with GPT), so do not cause an error message when opening
them.
2017-02-26 09:49:40 +00:00
macallan 695edcefa4 - use bus_space_mmap()
- pass the right colour depth in ioctl()
should fix PR49639
2016-11-09 19:54:25 +00:00
macallan 139ddb03dc add FBTYPE_MGX 2016-05-07 15:28:57 +00:00
macallan 6cb3d5c739 RASTERCONSOLE is gone, wsdisplay no longer optional 2016-04-21 18:06:06 +00:00
macallan 34337aa92f return correct parameters in ioctl(WSDISPLAYIO_GINFO), from lausgans
while there, support WSDISPLAYIO_GET_FBINFO
2016-04-13 17:26:08 +00:00
christos b2e2b58c68 avoid conflicts with our own ioctls 2015-09-26 03:31:52 +00:00
dholland 1fbab01a93 More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
2015-09-06 06:00:59 +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 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
joerg 270ca8fe9d Call memset in a loop, not loop around doing nothing and calling memset
once.
2014-02-20 02:09:28 +00:00
macallan 5aec4c7ca3 - don't use defattr before it actually contains something useful
- clear the screen only once, when we know what colour to use
- set up the colour map only once, when we know which one to use
-> no more funky colour flashing while cgsix attaches on my U1
2013-12-03 17:01:04 +00:00
jdc bfacdd22be Only write to the framebuffer memory 32 bits at a time. If we try to write
larger amounts, we will generate SER_WRITE|SER_SZERR with P4 framebuffers.
(Writing 64 bits at a time is the default with memset().)
Also, set the default attributes to zero to avoid vertical stripes from
uninitialised defattr.
XXX; screen is still not cleared of old text.
2013-12-02 15:54:06 +00:00
christos c812541471 remove unused 2013-11-07 02:38:07 +00:00
martin 10b6e2f5f6 Remove unused variables 2013-09-15 14:13:19 +00:00
martin 10c5b4d905 Remove unused variable 2013-09-15 14:08:25 +00:00
martin bee22eb353 Simplify CG6_DRAW() and CG6_BLIT() macros so gcc 4.8.1 does not warn about
them - assembler looks good, but Michael, can you please test nevertheless?
2013-09-12 12:42:18 +00:00
macallan 4453737ff6 avoid uninitialized use of defattr 2013-07-30 19:16:50 +00:00
macallan 9373d84081 add a bunch of register definitions and clarify some comments 2013-05-28 15:25:37 +00:00
macallan 880c7720a7 don't claim alpha font support unless we have enough off-screen memory to
cache a useful number of glyphs
this should probably be CPU speed dependent, most UltraSPARCs can likely
render anti-aliased fonts fast enough on the fly
2012-11-13 20:47:58 +00:00
macallan 700afa7d40 wipe the glyph cache when re-entring terminal emulation mode 2012-07-18 02:31:46 +00:00
macallan b94d298539 wait for the blitter to go idle before trying to send another command
Apparently on some CG6 the GX_FULL bit is not a reliable indication wether the
engine is ready to accept another command ( LX onboard for example ) - might
be a hardware bug.
2012-07-13 19:48:45 +00:00
macallan 7daaf29c68 support anti-aliased fonts 2012-07-12 01:20:22 +00:00
macallan b7d83378aa don't wait for the blitter unless we want to send another command and the
pipeline is full
2012-07-11 16:59:55 +00:00
macallan 7bb04ad0c4 don't set clipping parameters and such every time we send a blitter command 2012-07-11 15:03:14 +00:00
macallan 4ce7eb58c5 perry some whitespace nits & remove some obsolete comments
no functional change
2012-07-10 22:50:41 +00:00
macallan 67b89d49b5 magic number reduction, no functional change 2012-07-10 22:35:11 +00:00
macallan fe2d7ebdd3 add some register definitions from xf86-video-suncg6 2012-07-10 22:34:32 +00:00
macallan fb12d7f4d3 - re-initialize only when we're really going back to terminal emulation
- don't try to redraw a non-existing screen
- don't try to mmap sbus ranges through /dev/ttyE*
2012-07-10 22:33:15 +00:00
christos 7d659a9119 make this compile again. 2012-05-02 14:54:26 +00:00
martin 7d5d727b0f Make it compilable without envsys 2012-04-27 09:30:13 +00:00
macallan 342b9fca4a report power button events to sysmon
also send pwm events for volume control keys directly with
options KBD_HIJACK_VOLUME_BUTTONS
so they work in X as well
2012-04-26 00:50:10 +00:00
macallan 741daaf46f use rasops_init(0,0) 2012-01-11 16:10:13 +00:00
mrg 84b278ca3f add support for WSDISPLAYIO_LINEBYTES. mostly from macallan. 2010-11-23 22:14:27 +00:00