Commit Graph

1131 Commits

Author SHA1 Message Date
macallan f4a02ceff0 - implement buttom-up copies in cg14_bitblt() so scrolling down works now
- use more registers when copying
- use hardware to draw the cursor
- use putchar() for horizontal scrolling since byte-wise overlapping copy
  ops wouldn't be any faster anyway
2013-02-07 16:14:30 +00:00
macallan 328b697b0f add SX_ROP instruction 2013-02-06 20:39:03 +00:00
macallan afd2d65f39 use SX for basic hardware acceleration
not quite complete yet but good enough to be useful
missing things include:
- backwards blits
- ROP support
- the cursor is still drawn by software
2013-02-06 04:10:54 +00:00
macallan d211f15b2f fix typos, deal with hardware insanity 2013-02-06 04:06:29 +00:00
macallan 3b60920a22 attachment and initialization for SX 2013-02-05 21:52:48 +00:00
macallan 8c5cfad34f throw out RASTERCONSOLE goo 2013-02-05 21:45:39 +00:00
chs cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
jdc 4be6ce2eeb Adapt to the changed signature of pckbc_cnattach(). 2012-10-13 17:58:53 +00:00
tsutsui 19c63c3512 Fix device_t/softc split botches that could be fatal. From
Chuck Silvers' patch posted current-users and tech-kern:
http://mail-index.netbsd.org/current-users/2012/10/09/msg021233.html

Should be pulled up to netbsd-6.
2012-10-10 16:51:50 +00:00
jdc 5e8337c848 Wrap sbuserr_handler and sbus_error with:
#if (defined(SUN4M) && !defined(MSIIEP)) || defined(SUN4D)
to give them the same scope as the definitions in ../sparc/intr.c.
Allows SUN4C-only kernels to compile.
OK mrg
2012-09-23 09:54:04 +00:00
christos 4362d3edda move cn_tab initializationt to cpu_startup 2012-07-30 17:29:55 +00:00
matt 8ad8b5528b Fix more -fno-common fallout. 2012-07-29 00:04:05 +00:00
martin bb4ba021f4 Make explicitly clear that we mean raw I/O on device passthru, not just
generic passthru.
2012-03-25 08:48:40 +00:00
elad 0c9d8d15c9 Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

    http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
    http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
    http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
2012-03-13 18:40:26 +00:00
mrg 4f67d478db avoid writing 1 byte beyond the end of the string promlib.c has given us.
instead of forcing a nul byte afterwards, KASSERT() that the final byte
already is a nul.  if there are broken proms... well, we can fix them.

this, plus one more change, allows my SS20 to boot multiuser.
2012-01-30 04:25:14 +00:00
para 89c9828deb converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
2012-01-27 18:52:47 +00:00
macallan 1fa79ac882 use rasops_init(0, 0) 2012-01-11 15:53:32 +00:00
jmcneill 8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

  Add MP locking to the audio drivers.

  Making the audio drivers MP safe is necessary before efforts
  can be made to make the VM system MP safe.

  The are two locks per device instance, an ISR lock and
  a character device lock. The ISR lock replaces calls to
  splaudio()/splx(), and will be held across calls to device
  methods which were called at splaudio() before (e.g.
  trigger_output). The character device lock is held across
  calls to nearly all of the methods, excluding some only
  used for initialization, e.g. get_locks.

Welcome to 5.99.57.
2011-11-23 23:07:28 +00:00
jakllsch 1578aa6f33 Another copy/paste problem with a function name in a error printf. 2011-09-08 15:36:42 +00:00
jakllsch d8c7d8f2e8 Correct copy/paste of function name in error printf. 2011-09-08 15:34:07 +00:00
dyoung 75ccda5a51 Don't set the iobase and iosize members of pcmciabus_attach_args because
they're not used in any meaningful way.
2011-07-26 22:52:47 +00:00
mrg 142a02103b convert the remaining sparc drivers to CFATTACH_DECL_NEW/cfdata_t/device_t.
(cgsix_obio.c was only partially converted with the rest of the cgsix code
when it was changed some time ago.)
2011-07-18 00:31:13 +00:00
mrg 9c508f54bd convert to use device_t, cfdata_t and CFATTACH_DECL_NEW().
XXX: compile time tested only.
2011-07-18 00:05:35 +00:00
mrg ace9f0e4af convert all the sparc drivers that attach on my ss20 to use device_t,
cfdata_t and CFATTACH_DECL_NEW().

fd/fdc could use better testing, but i'm pretty sure i got it right.
2011-07-17 23:18:23 +00:00
dyoung b6584574fc #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:41:51 +00:00
wiz 4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +00:00
pgoyette f80eb73fce Initialize sensor states before registering 2011-06-20 16:33:42 +00:00
tsutsui 595cbc6ae0 Split device_t/softc of am7930. No crash on TME and GXemul. 2011-06-04 01:27:57 +00:00
tsutsui c22ffc3803 Split device_t/softc of i82586. No crash on TME emulating sun2. 2011-06-03 16:28:40 +00:00
rmind 2626d57668 Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency.  Remove some unnecessary malloc.h inclusions as well.
2011-04-24 16:26:51 +00:00
macallan dfdc4959f7 use the same function whenever we change colour depth
also, when opening the fb device switch to 32bit and back to 8 on close, not
the other way around
2011-04-13 23:31:25 +00:00
chuck 39094c9da3 udpate license clauses on my code to match the new-style BSD licenses.
remove no-longer-valid wustl email address for me.
based on diff that rmind@ sent me.

no functional change with this commit.
2011-02-01 20:19:31 +00:00
rmind 7146b2f61d Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete.  Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
2011-01-14 02:06:22 +00:00
macallan 3337b3cd99 remove shadow framebuffer support, use VCONS_DONT_READ instead 2010-08-31 21:14:57 +00:00
tsutsui 42db966caf Remove an unused variable. 2010-06-26 03:39:53 +00:00
tsutsui dc3badf5ec Establish interrupt handlers with proper softc per each zs device
rather than sharing them among all zs devices and searching softc
in handlers.

The latter method is derived from ancient sun3 zs driver which tried
to reduce overhead on autovectored interrupts, but nowadays such hack
might cause recursive global locks on modern SMP capable framework.

Fixes "5.99.30 sparc panic during startup" reported by Hauke Fath
on tech-kern@:
http://mail-index.NetBSD.org/tech-kern/2010/06/19/msg008374.html
and also tested by Jochen Kunz on SS20 with both serial and kbd console.

Ok'ed by mrg@ and dyoung@.
2010-06-26 01:42:57 +00:00
macallan ec4afcf862 add some more offsets
this should have been committed with the previous, noticed by he
2010-06-12 21:25:56 +00:00
macallan 3ab6a60f8f Add a couple more hw offset definitions, add an ioctl() to set colour depth
which works like Solaris and Linux, and finally make mmap() behave like an
actual CG14. This should be all we need to get Xorg's suncg14 driver going.
2010-06-10 13:21:13 +00:00
macallan c7622a73d1 get rid of the cg3/cg8 'emulation' kludge since we have the xf86-video-suncg14
driver now
this will probably need some work in cgfourteenmmap() to match what the
driver expects from a cg14
2010-06-08 06:30:41 +00:00
macallan 1960e8cdf1 make sure we pass a valid consdev pointer to the console keyboard so kbd
knows it's console and passes the right flags to wskbd, now the wskbd will
not drop off the mux when leaving event mode.
Symptoms: now the keyboard should no longer be dead when leaving X and there
          should be no more panics caused by it
I tested this on an SS5 and an SS20, may need some more attention and zs.c
sure could use some cleanup - there are a few differences to sparc64 that
really don't make much sense to me, like not passing console flags to zstty
which sparc64 does but sparc avoids, which caused this problem in the first
place.
2010-06-04 06:04:15 +00:00
dyoung c1b390d493 A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00
tsutsui 15c20a62b3 Make sure to set ZS_HWFLAG_USE_CONSDEV and zs_consdev into zsc_args
passed to child devices even in !(NWSKBD == 0) case so that zs console
functions are actually used rather than the default prom console.
Fixes stray interrupts on MP machines running GENERIC.MP kernel with
zs serial console.

Ok'ed by mrg@.
2010-01-17 16:23:43 +00:00
bouyer 3c5e160011 Add apc(4), a driver for the Aurora Personality Chip (APC) found
on SPARCstation-4/5, and emulated by qemu to idle the simulator
when the CPU is idle. Infos about the registers from the linux driver.
Not enabled by default because it can cause some Sparc systems to
hang (so says the linux driver).
Only the CPU idle part implemented at this time; fan speed and
Convenience power outlet management to be added.
Tested on qemu.
2010-01-15 20:57:12 +00:00
dyoung 3022acc4eb Expand PMF_FN_* macros. 2010-01-08 19:42:11 +00:00
mrg 1ee1eb05c3 add an explicit "bool mpsafe" to intr_establish(). only set it to true
for the sun4m timer/counter interrupts.  this gets lev10/14 working again
on SMP systems, where those interrupts started taking the kernel lock and
hanging...
2010-01-03 23:03:20 +00:00
tsutsui 72c76c73d8 Disable "fast trap" handlers which invoke software interrupts
in sparc/amd7930intr.s and sparc/bsd_fdintr.s until they are
rewritten to adapt new MI softint(9) API.

No particular comments on PR port-sparc/42192, but
this fixes timeout problem on floppy access on my SPARCstation 1+.

XXX: floppy support on sun4m seems to have another problem (data overrun).
2009-12-19 10:34:18 +00:00
tsutsui 471e528b58 Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
2009-12-12 14:44:08 +00:00
rmind a626cff9ae Use lwp_getpcb() on sparc{64} and sun2/3 MD code, clean from struct user usage. 2009-11-21 04:16:51 +00:00
tsutsui 102f04400c - use device_t and cfdriver_t
- use device_private() and device_xname()
- use proper types or variables for device_t/softc
2009-09-20 16:18:21 +00:00
tsutsui a616b75df3 Split device_t/softc.
Tested on TME emulating SS2.

XXX: bwtwo at obmem on TME emulating sun2 didn't match and cannot test
2009-09-19 04:52:44 +00:00
tsutsui 12ad76b18c Remove struct sbusdev and related functions sbus_establish() and sbusreset().
They are derived from 4.4BSD/sparc and have been there since initial import
of NetBSD/sparc in 1993, but the struct sbusdev is almost unused for years,
nothing calls sbusreset(), and all (*sd->sd_reset)() functions look bogus.

Suggested by mrg@ and martin@, and tested on SS1+ and SS20.
2009-09-17 16:28:12 +00:00
tsutsui 41559777ac Use device_t, cfdriver_t, device_private(), device_xname(),
and appropriate types and variables for device_t/softc.
2009-09-17 12:38:11 +00:00
macallan a11c6c1d62 use vcons_replay_msgbuf() 2009-08-27 20:52:18 +00:00
apb 36bad35673 Enclose the argument to #error in quotes, to protect an embedded single
quote.  Part of PR 41255 from Kurt Lidl.
2009-07-14 20:57:22 +00:00
martin 900e24968a Properly initialize child attach args to zero - we could end up with
various devices having different ideas about being console otherwise.
2009-05-31 17:09:03 +00:00
macallan d3ed51a859 use BUS_SPACE_MAP_LARGE to map the framebuffer 2009-05-26 03:31:12 +00:00
jnemeth daae204570 Convert shutdownhook_establish() to pmf_device_register1().
XXX  This should be done as part of an overall plan to support
power management and device detachment.  However, in order to do
that, I would first have to invent sbus_intr_disestablish().  This
is being done at this time in order to aid in the effort to eliminate
shutdownhook_establish().

This was based on the sys/arch/sparc64/fd.c change.  Thanks to jdc@
for testing this version.
2009-05-25 19:22:53 +00:00
mrg a149917d19 add two new functions for z8530tty: zs_chan_lock() and zs_chan_unlock(),
and use them instead of various spl's in the zs.c's.

reviewed by ad and martin.
2009-05-22 03:51:30 +00:00
cegger d70ad70603 KNF, same object code generated 2009-05-16 16:55:24 +00:00
macallan d1ec421048 use sparc_bus_map_large() to map the framebuffer if we can't find a PROM
mapping - now we won't exhaust the IODEV range and thus prevent other graphics
devices from working.
2009-04-16 16:57:21 +00:00
cegger e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
macallan 685cae19f2 Recycle OBP's framebuffer mapping if available instead of wasting KVA space
by creating our own.
2009-02-05 16:04:00 +00:00
he 7a69db4aa6 Use firm_gettime() to retain compatibility with old firm_event. From amiga. 2009-01-17 14:35:06 +00:00
yamt 70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
cegger dcf705893e use M_ZERO on malloc() and remove subsequent bzero(). 2008-12-19 18:49:37 +00:00
cegger 9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
christos 9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
macallan 25f1a62f67 some cleanup, add shadowfb support 2008-12-12 18:52:40 +00:00
macallan 2a1ee97a2a device_t-ify 2008-12-12 18:50:13 +00:00
martin ae7357a3ad PR port-sparc/39942: ifdef ch0_is_cons declaration and all uses consistently 2008-11-17 18:32:08 +00:00
macallan d61452c45c fix another botched device_t-ification 2008-08-04 03:14:43 +00:00
cegger 2515b0ec09 make this compile 2008-07-17 14:43:38 +00:00
cegger 2dea63fe78 use device_lookup_private to get softc 2008-06-13 13:08:57 +00:00
drochner 1a9e64b4a7 mechanical changes to use device_private() or device_lookup_private()
to get softcs, makes the code compile under the stricter type checking
introduced earlier today
2008-06-11 21:25:31 +00:00
mrg c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00
macallan 21ef3a53d1 more device_t-ification 2008-05-17 18:11:32 +00:00
macallan 266d000a3d struct device * -> device_t 2008-05-17 01:30:48 +00:00
macallan edc658718f cosmetics:
- finally add my copyright, almost 3 year after the fact
- remove a comment that never applied to the NetBSD port of this driver,
  only the OpenBSD version
2008-05-17 01:00:19 +00:00
macallan acb1cf42d5 struct device * -> device_t 2008-05-17 00:45:38 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tsutsui 78a1d236b6 Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
2008-04-13 04:55:52 +00:00
tsutsui a109378b55 Split device_t/softc, as following parents in sys/dev/sun. 2008-04-07 13:31:15 +00:00
tsutsui 5147571380 Split devict_t/softc for ncr5380sbc SCSI, and misc cosmetic changes. 2008-04-04 16:00:57 +00:00
tsutsui d9941582bf Split device_t/softc for le(4) and variants and misc cosmetic changes. 2008-04-04 12:25:06 +00:00
tsutsui 02cb47cab2 Split softc and device_t for zsc(4) and its children.
XXX we should restructure MI APIs and make it really machine independent.
2008-03-29 19:15:34 +00:00
dogcow de88169824 pesky missing spaces. 2008-03-18 05:05:35 +00:00
cube a22d8d4abb Split device_t and softc for pckbc(4) and its attachments. 2008-03-15 13:23:24 +00:00
cube 607ead0ef4 Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend).  Use proper types and ansify where appropriate.
2008-03-14 15:09:09 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
dyoung e4f3892584 Use pmf_device_register1() instead of shutdownhook_establish() to
register com_cleanup() as the shutdown hook.

Add a generic suspend routine.  Suspend and resume com@isa.

Protect against dereferencing a NULL softc in comioctl().

Destroy both a mutex and a callout in com_detach().

Cosmetic: use aprint_*_dev().  Use PMF_FN_ARGS, PMF_FN_PROTO.
2008-02-29 07:02:04 +00:00
joerg e69482d49d Introduce device_find_by_xname and device_find_by_driver_unit to replace
alldevs iterations all over src.

Patch discussed with and improved on suggestioned from cube@.
2008-02-12 17:30:57 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad 4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
ad 99801e924b Use the softint API. 2007-11-27 21:56:06 +00:00
ad dc26833bb6 - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
2007-11-19 18:51:36 +00:00
xtraeme 31962fc6e5 Extend the envsys2 API (one more time, sorry) as defined in:
http://mail-index.netbsd.org/tech-kern/2007/11/09/0001.html

sysmon_envsys_create() and sysmon_envsys_destroy() were added to
create/destroy sysmon_envsys objects (and its TAILQ/LIST for sensors/events).

sysmon_envsys_sensor_attach() and sysmon_envsys_sensor_detach() were
added to attach/detach sensors to a specified sysmon_envsys device.

The events framework is now per device and configurable via the
ENVSYS_SETDICTIONARY ioctl or /etc/envsys.conf and envstat(8).

Update all users and documentation to reflect these changes.
2007-11-16 08:00:11 +00:00
ad f2c57d8566 Call zs_lock_init() to set up the chanstate's lock. 2007-11-09 00:05:04 +00:00
jnemeth d43d105081 typo 2007-11-01 10:07:45 +00:00
joerg d238692c3e Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
2007-10-18 18:54:56 +00:00