summaryrefslogtreecommitdiffstats
path: root/sys/arch/loongson (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spellingjsg2021-03-114-8/+8
|
* Make kernel ld.script similar to octeon's on loongson and sgi.visa2021-02-181-7/+37
|
* Skip gp initialization in loongson bootblocksvisa2021-02-172-3/+1
| | | | | | | The loongson bootblocks are compiled with -mno-abicalls and do not use gp-relative addressing. A similar change has been made to the mips64 kernels recently.
* Leave out gp initialization from kernel entry on mips64visa2021-02-112-4/+2
| | | | | | | | | On OpenBSD/mips64, the kernel is compiled with -mno-abicalls. This disables gp-relative addressing and essentially makes gp a spare register in the kernel. Hence it is unnecessary to initialize gp when entering the kernel. The _gp symbol is not needed either. Suggested by miod@
* 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@
* 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@
* Use native display resolution 1368x768 with Lynloong all-in-one computers.visa2021-01-021-3/+7
| | | | From Yifei ZHAN on tech@
* Make kernel recognize Lynloong LM9002/9003 and LM9013.visa2021-01-021-1/+5
| | | | | | | | | | | LM9002/9003 is very similar to LM9001 since it works just fine on LM9002 with the codebase for LM9001. LM9013 on the other hand is fairly different from LM9001 and is more like Yeeloong 8089 when it comes to hardware design. More work might be needed to make it fully functional. From Yifei ZHAN on tech@
* Refactor klist insertion and removalvisa2020-12-251-3/+3
| | | | | | | | | | | | 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@
* Make clang the default compiler on loongson.visa2020-12-221-2/+2
| | | | OK deraadt@
* Use daddr_t and not daddr32_t in boot media.krw2020-12-094-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@
* Add option to build loongson kernels using clang.visa2020-12-011-2/+7
|
* Avoid accidental truncation of large memory segments.visa2020-11-171-2/+2
|
* Ensure proper alignment of memory map entries, needed with clang.visa2020-11-171-8/+8
| | | | gcc has generated unaligned loads with the original code.
* Do not include ../Makefile.inc twice.visa2020-11-131-3/+1
| | | | | | System include file <bsd.lib.mk> includes ../Makefile.inc if it exists. This avoids repetition of certain compile options.
* Fold -fno-builtin-* into -fno-builtin.visa2020-11-131-11/+2
|
* Use BTB bug workaround also with assembly files.visa2020-11-131-1/+2
| | | | This might fix some boot-time hangs.
* 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@.
* Move mfokclock(4) from loongson to sys/dev/i2c so that it be used by morepatrick2020-09-305-163/+7
| | | | | | | | | | | platforms than just loongson. Rename it to mfokrtc(4) for consistency with other RTC drivers. Make it match on st,m41t83, since that was the chip for which the driver was written for. More compatible strings can be added for each chip of the series verified to behave the same. Discussed with kettenis@ Compile tested on loongson by kn@ Tested on loongson by and ok visa@
* Use sysctl_bounded_args for simple cases in cpu_sysctl on loongsongnezdo2020-09-011-21/+7
| | | | deraadt@: looks fine
* Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.visa2020-08-261-2/+1
| | | | OK deraadt@, mpi@
* Do not bother masking IPIs in the Loongson 3A specific IPI routine.visa2020-07-211-7/+1
| | | | | The interrupt dispatcher interrupt() keeps interrupts disabled anyway. Also, the IPI code should not allow nesting of interrupts.
* Add GENERIC.MP kernel config for loongson.visa2020-07-192-0/+11
| | | | | | Not enabled for now. OK deraadt@
* Remove an unused function.visa2020-07-181-12/+1
|
* Userland timecounter implementation for octeonvisa2020-07-181-2/+2
| | | | OK naddy@; no objections from kettenis@
* Add support for timeconting in userland.pirofti2020-07-062-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* wire up kstat(4)dlg2020-07-061-2/+3
| | | | "looks right" deraadt@
* Remove obsolete <machine/stdarg.h> header. Nowadays the varargvisa2020-06-301-3/+0
| | | | | | | | functionality is provided by <sys/stdarg.h> using compiler builtins. Tested in a ports bulk build on amd64 by naddy@ OK naddy@ mpi@
* kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha2020-06-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
* cpu_rnd_messybits() for mips64visa2020-06-051-10/+1
| | | | | | | Use CP0 Count as a basis. Also take noise from virtual memory activity by including BadVAddr. OK deraadt@ dlg@
* introduce "cpu_rnd_messybits" for use instead of nanotime in dev/rnd.c.dlg2020-05-311-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | rnd.c uses nanotime to get access to some bits that change quickly between events that it can mix into the entropy pool. it doesn't use nanotime to get a monotonically increasing set or ordered and accurate timestamps, it just wants something with bits that change. there's been discussions for years about letting rnd use a clock that's super fast to read, but not necessarily accurate, but it wasn't until recently that i figured out it wasn't interested in time at all, so things like keeping a fast clock coherent between cpu cores or correct according to ntp is unecessary. this means we can just let rnd read the cycle counters on cpus and things will be fine. cpus with cycle counters that vary in their speed and arent kept consistent between cores may even be desirable in this context. so this is the first step in converting rnd.c to reading cycle counter. it copies the nanotime backend to each arch, and they can replace it with something MD as a second step later on. djm@ suggested rnd_messybytes, but we landed on cpu_rnd_messybits. thanks to visa for his eyes. ok deraadt@ visa@ deraadt@ says he will help handle any MD fallout that occurs.
* dev/rndvar.h no longer has statistical interfaces (removed during variousderaadt2020-05-291-2/+1
| | | | | | conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
* Retire <machine/varargs.h>.visa2020-05-271-3/+0
| | | | | | Nothing uses the header anymore. OK deraadt@ mpi@
* Fix pmon_iostrategy()visa2020-05-271-5/+6
| | | | | | | | | | | | If rsize is NULL, do not update the variable. Otherwise the bootloader will crash when it invokes libsa's fchmod(). This lets the bootloader work again after the recent loadrandom() change. The fix should also improve the chances of sysupgrade(8) on loongson. Note that pmon_iostrategy() does not allow writing. fchmod() will fail but does not prevent boot.
* increment version numbers, due to recent RB_GOODSEED and fchmod +T changesderaadt2020-05-261-2/+2
|
* Use <dev/clock_subr.h> in mcclock(4).visa2020-05-253-41/+45
| | | | | | Tested on Yeeloong. Looks good to miod@
* Use <dev/clock_subr.h> in mfokclock(4).visa2020-05-251-36/+43
| | | | Looks good to miod@
* change wsdisplay attribute type from long to uint32_tjsg2020-05-253-20/+20
| | | | | | | | miod explained it was initially a long as it was thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. suggested and reviewed by miod@
* rename wsdisplay alloc_attr() to pack_attr()jsg2020-05-253-9/+9
| | | | | | | | Suggested by John Carmack. miod agrees a rename would make sense and explained it was initially thought drivers may need to allocate storage but in practice they don't need more than 32 bits for an attribute. ok mpi@
* Fix some of the more esoteric bus_space functions. Thekettenis2020-04-141-7/+8
| | | | | | | | | | bus_space_read_region_n, bus_space_write_region_n and bus_space_set_region_n functions were all broken. Same fix as arm64; Thanks to patrick@ for noting that mips64 had the same code. ok visa@
* Abstract the head of knote lists. This allows extending the lists,visa2020-04-071-3/+3
| | | | | | for example, with locking assertions. OK mpi@, anton@
* Update my email address.pirofti2020-04-061-2/+2
|
* Allow loongson boot(8) to read from an ffs2 filesystem. ok deraadt@ visa@otto2020-03-032-4/+7
|
* Replace field f_isfd with field f_flags in struct filterops to allowvisa2020-02-201-2/+2
| | | | | | adding more filter properties without cluttering the struct. OK mpi@, anton@
* Send a resume event to apmd(8), like done by apm(4) and acpi(4)jca2020-02-161-1/+3
| | | | | Test & ok visa@. Sadly his Lemote doesn't come back from sleep, with or without this change.
* wire up pppac(4) to some majors on each arch.dlg2020-01-231-1/+2
| | | | | | | | i was lazy and just put them at the end of the existing set. fyi, i think major 51 is free on all archs if anyone is looking for another one. ok claudio@
* Import dt(4) a driver and framework for Dynamic Profiling.mpi2020-01-211-2/+3
| | | | | | | | | | | The design is fairly simple: events, in the form of descriptors on a ring, are being produced in any kernel context and being consumed by a userland process reading /dev/dt. Code and hooks are all guarded under '#if NDT > 0' so this commit shouldn't introduce any change as long as dt(4) is disable in GENERIC. ok kettenis@, visa@, jasper@, deraadt@
* Use C99 designated initializers with struct filterops. In addition,visa2019-12-311-3/+7
| | | | | | make the structs const so that the data are put in .rodata. OK mpi@, deraadt@, anton@, bluhm@
* Convert various boolean_t/TRUE/FALSE to int/1/0 in mips64 memory code.visa2019-12-202-8/+8
| | | | OK mpi@