summaryrefslogtreecommitdiffstats
path: root/sys/arch/sparc64 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spellingjsg2021-03-1113-32/+32
|
* sparc64/clock.c: use ANSI-style function definitionscheloha2021-02-231-57/+20
| | | | | | | | While here, zap a few ARGUSED linter comments. Compile-tested by deraadt@. ok deraadt@
* timecounting: use C99-style initialization for all timecounter structscheloha2021-02-232-7/+26
| | | | | | | | | | | | | | | | | | The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style initialization for all timecounter structs. It also makes reading the code a bit easier. For reasons I cannot explain, switching to C99-style initialization sometimes changes the hash of the resulting object file, even though the resulting struct should be the same. So there is a binary change here, but only sometimes. No behavior should change in either case. I can't compile-test this everywhere but I have been staring at the diff for days now and I'm relatively confident this will not break compilation. Fingers crossed. ok gnezdo@
* Add uhidpp(4), a driver for Logitech HID++ devices. Currently limited toanton2021-02-041-1/+2
| | | | | | | | | exposing battery sensors for HID++ 2.0 devices. Most of the code is derived from the hid-logitech-hidpp Linux driver. Thanks to Ville Valkonen <weezeldinga at gmail dot com> for testing. ok mglocker@
* satisfy -fno-commonderaadt2021-01-302-4/+4
|
* Again allow COPTS= to come from the environment again, and don't lose thederaadt2021-01-281-4/+4
| | | | | SMALL_KERNEL specific variations. ok espie jsg
* introduce ujoy(4), a restricted subset of uhid(4) for gamecontrollers.thfr2021-01-232-2/+5
| | | | | | | | This includes ujoy_hid_is_collection() to work around limitations of hid_is_collection() until this can be combined without fallout. input, testing with 8bitdo controller, and ok brynet@ PS4 controller testing, fix for hid_is_collection, and ok mglocker@
* blacklist com on m3000s. our com code causes faults somehow.dlg2021-01-191-1/+20
| | | | | | | | console i/o still happens using ofw routines, which is Good Enough(tm) for now. having a working machine means i can better test changes now though. ok deraadt@
* Allocate address space for struct cpu_info using km_alloc(9) instead ofjmatthew2021-01-021-2/+8
| | | | | | uvm_km_valloc(9). Tested on a T5120. ok mpi@
* Sync with i386 by asserting that IPL values should be at least IPL_NONE.mpi2020-12-281-1/+2
|
* Refactor klist insertion and removalvisa2020-12-251-4/+4
| | | | | | | | | | | | Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
* Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp.jan2020-12-121-2/+2
| | | | | | OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
* Use daddr_t and not daddr32_t in boot media.krw2020-12-095-9/+9
| | | | | | | | | | At a minimum, amd64/i386 should now boot from 4TB GPT formatted disks. More daddr32_t terminations with extreme prejudice to follow. Tested by various, in snaps for a few days. ok deraadt@
* In case of failure, call sigexit() from trapsignal instead of sensig().mpi2020-11-081-4/+5
| | | | | | | Simplify MD code and reduce the amount of recursion into the signal code which helps when dealing with locks. ok cheloha@, deraadt@
* If Open Firmware doesn't provide an interrupt mapping, use the swizzledkettenis2020-10-271-3/+11
| | | | | interrupt pin as the devino. Fixes ohci(4) and ehci(4) interrupts on the Fujitsu M10-1.
* If the #msi-eqs property says there are no event queues, don't try to setjmatthew2020-10-241-1/+3
| | | | | | | up MSI support. stsp@ and bluhm@ ran into this on T5220s ok stsp@ kettenis@ patrick@
* Refactor page fault/error functions, normalizing their operation relativederaadt2020-10-231-200/+154
| | | | | | to other architectures. Kernel lock only the minimum (in preparation for further unlocking down the line) ok kettenis
* uvm_grow() now does the vm_maxsaddr check (before locking), so callers don'tderaadt2020-10-211-5/+4
| | | | | need to do it ok kettenis
* alpha, loongson, sh, sparc64: recompute tick, tick_nsec when hz(9) is resetcheloha2020-10-201-1/+3
| | | | | | | | | | | | | | Normally we set hz(9) at compile-time in sys/conf/param.c to the value of HZ. HZ is one of the fundamental compilation options(4). However, sometimes we need to reset hz(9) at runtime. Whenever we reset hz(9) we need to recompute tick and tick_nsec. Otherwise a variety of "time stuff" in the kernel will not work correctly. For example, most timeouts will expire "too slow" or "too fast". There are a bunch of other places we use tick and tick_nsec that will exhibit similar problems. Test-compiled by deraadt@.
* unbreak buildjsg2020-10-161-2/+2
|
* Replace simple one-line bcopy()/memcpy() of faked data into scsi_xfer with callkrw2020-10-151-2/+2
| | | | | to scsi_copy_internal_data(). Thus getting xs->resid properly set and adding the usual uio/size sanity checks.
* fix indentationjsg2020-10-011-2/+2
|
* The sparc64 pagefault vectors are directly to specific functions, andderaadt2020-09-241-1/+4
| | | | | all 3 were missing refreshcreds() preceding calls to uvm_fault() ok kettenis
* Only perform uvm_map_inentry() checks for PROC_SP for userland pagefaults.deraadt2020-09-241-13/+25
| | | | | | | | This should be sufficient for identifying pivoted ROP. Doing so for other traps is at best opportunistic for finding a straight-running ROP chain, but the added (and rare) sleeping point has proven to be dangerous. Discussed at length with kettenis and mortimer. ok mortimer kettenis mpi
* Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw2020-09-221-9/+9
| | | | | | | | | | | | member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*' from cmd. Take the address of cmd as required by the various casts. No intentional functional change. luna88k test by aoyama@, sparc64 test by jmatthew@ Identification of 2009's last *cmd use and ok jmatthew@
* emuinstr() proto dies also after emul.c cleanup; from miodderaadt2020-09-141-2/+1
|
* Delete some emulator code which has never been used on 64 bit sparcderaadt2020-09-141-209/+1
| | | | ok kettenis, test compile by kmos
* Include <sys/systm.h> directly instead of relying on hidden UVM includes.mpi2020-09-111-1/+2
| | | | The header is being pulled via db_machdep.h -> uvm_extern.h -> uvm_map.h
* Replace '32' with SID_SCSI2_ALEN (a.k.a. 31) when building emulated INQUIRYkrw2020-09-051-2/+2
| | | | | responses. This is what the SCSI specifications say is the correct value and already used in several cases.
* Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.krw2020-09-031-2/+2
|
* When building emulated INQUIRY results use the SCSI_REV_* #define's tokrw2020-09-021-2/+2
| | | | initialize the 'version' field. Not numbers.
* Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big tokrw2020-09-011-9/+9
| | | | | | struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
* Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.visa2020-08-261-4/+1
| | | | OK deraadt@, mpi@
* Push KERNEL_LOCK/UNLOCK() dance inside trapsignal().mpi2020-08-193-51/+3
| | | | ok kettenis@, visa@
* Add __multi3 from compiler_rt-8.xjca2020-08-131-1/+2
| | | | | Needed to build a sparc64 kernel with clang 10. ok kettenis@
* On sun4u systems that have the STICK register, clear the NPT bit of thekettenis2020-07-314-17/+42
| | | | | | | register such that it can be accessed from userland. With this change we can unconditionally enabled the usertc code again. ok naddy@
* Enable usertc if the NPT bit isn't set for %tick and %sys_tick.kettenis2020-07-241-4/+9
| | | | ok naddy@
* Nuke unused struct scsi_link member of vdsk_softc.krw2020-07-221-2/+1
| | | | sparc64 compile test by jmatthew@
* console marker should be after :deraadt2020-07-221-2/+2
|
* It's saa_flags, not flags.krw2020-07-211-2/+2
| | | | Encountered by deraadt@
* saa.ssa.wwpn is not the same as saa.saa_wwpn.krw2020-07-201-2/+2
| | | | Typo broke miod's luna88k build. Would have broken next sparc64 build.
* Move remaining scsi bus initialization info from "prototype scsi link"krw2020-07-201-4/+5
| | | | | | | fields to struct scsibus_attach_args. Nuke the struct scsi_link * (saa_sc_link) in scaibus_attach_args. Explicitly initialize each field in scsibus_attach_args variables.
* Disable userland timecounters for now. On some (all?) sun4u machines thiskettenis2020-07-191-3/+3
| | | | | triggers an illegal instruction exception presumably because unpriviliged access to the cycle counters is prohibited.
* Move the adapter related items (luns, adapter, adapter_target,krw2020-07-191-6/+6
| | | | | | | adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
* Access adapter softc via link->bus->sb_adapter_softc.krw2020-07-162-10/+10
| | | | | | | | In sparc64 autoconf access 'luns' via sb_luns and 'adapter_buswidth' via sb_adapter_buswidth. Removes last post-config uses of the copies of bus related information in scsi_link.
* Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugkrw2020-07-111-2/+2
| | | | statement. All to make upcoming diff(s) smaller and easier to read.
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-101-3/+3
| | | | ok dlg@ tobhe@
* Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thepatrick2020-07-101-3/+3
| | | | | | "new" API. ok dlg@ tobhe@
* Userland timecounter implementation for sparc64.kettenis2020-07-082-7/+9
| | | | ok deraadt@, pirofti@
* Add support for timeconting in userland.pirofti2020-07-063-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@