summaryrefslogtreecommitdiffstats
path: root/sys/arch/macppc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Return EOPNOTSUPP for unsupported ioctlskn2021-03-261-16/+6
| | | | | | | | | Match what apm(4/macppc) says and make apmd(8) log an approiate warning when unsupported power actions are requested. Merge identical cases while here. This syncs with the apm ioctl handlers on loongson and arm64.
* Don't put an extern variable (ppc_kvm_stolen) into vmparam.h, other instancesderaadt2021-03-151-5/+1
| | | | of this file are only doing cpp #define
* spellingjsg2021-03-118-17/+17
|
* ofw_read_mem_regions() can skip calculation of physmem. pmap.cderaadt2021-03-091-5/+1
| | | | | | | | | | already calculates _usable_ memory and updates physmem (if it is 0), whereas ofw_read_mem_regions() was counting usable+unuseable memory. ie. 4G or more on some machines. powerpc's 32-bit pagetable cannot use memory beyond 4G phys addr. (On a 4G machine, physmem64 was calculated as 0, which caused the installer's auto-diskabel code to place /tmp on the b partition). ok gkoehler, works for kurt also
* timecounting: use C99-style initialization for all timecounter structscheloha2021-02-231-2/+9
| | | | | | | | | | | | | | | | | | 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@
* 6.9-betaderaadt2021-02-061-2/+2
|
* 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@
* 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@
* Use daddr_t and not daddr32_t in boot media.krw2020-12-092-4/+4
| | | | | | | | | | 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@
* Teach lld to link the macppc kernelgkoehler2020-11-291-4/+15
| | | | | | | | | | | | | | | | Add R_PPC_ADDR24 to lld. We need R_PPC_ADDR24 for absolute branches "ba" and "bla" in locore.S in the kernel. In Makefile.macppc, add a gapdummy (like in Makefile.powerpc64) to avoid an lld error. Also adapt a part of Makefile.i386, so my powerpc64 can use clang and lld to build and link the macppc kernel. (I didn't boot that kernel.) My macppc can now build, link, and boot kernels with either ld.bfd or ld.lld. Beware that kernels linked with ld.lld have at least one problem (wrong &etext) not yet fixed. ok kettenis@
* Add retguard to macppc kernel locore.S, ofwreal.S, setjmp.Sgkoehler2020-11-282-14/+32
| | | | | | | | | This changes RETGUARD_SETUP(ffs) to RETGUARD_SETUP(ffs, %r11, %r12) and RETGUARD_CHECK(ffs) to RETGUARD_CHECK(ffs, %r11, %r12) to show that r11 and r12 are in use between setup and check, and to pick registers other than r11 and r12 in some kernel functions. ok mortimer@ deraadt@
* In case of failure, call sigexit() from trapsignal instead of sensig().mpi2020-11-081-3/+5
| | | | | | | Simplify MD code and reduce the amount of recursion into the signal code which helps when dealing with locks. ok cheloha@, deraadt@
* Set initial default display brightness via of_setbrightness() to ensuretobhe2020-11-021-2/+2
| | | | | | wscons and ofw are in sync. ok kn@
* Make ws_get_param() return -1 on error. Fixes unhandled wsconsctl displaytobhe2020-10-271-2/+2
| | | | | | settings. Found by and ok kn@
* Define ws_get/set_param for macppc using ofw brightness and backlighttobhe2020-10-261-1/+63
| | | | | | commands. Fixes wsconsctl display commands with drm drivers. ok kettenis@
* Increase CLAIM_LIMIT from 11M to 14M to make room for retguardgkoehler2020-10-032-5/+5
| | | | | | | | | | | | | The kernel text will grow larger when retguard adds code to many functions to check their return addresses. The entire kernel (including text, data, bss, symbol table, and ramdisk) must fit under the CLAIM_LIMIT. A kernel that overflows this limit may fail very quickly, by causing a "DEFAULT CATCH!" error in Open Firmware. Crank version to "1.10", so I can see whether the running ofwboot uses the higher CLAIM_LIMIT. ok deraadt@
* Fix eeprom(8) error when setting variableskn2020-09-211-2/+6
| | | | | | | Values would be updated but the variable would still be reported as invalid. Adopted from NetBSD's sys/dev/ofw/openfirmio.c From miod
* crank to 6.8-betaderaadt2020-08-311-2/+2
|
* Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.visa2020-08-264-12/+4
| | | | OK deraadt@, mpi@
* Userland timecounter for macppcgkoehler2020-07-172-4/+4
| | | | | | | Tested by cwen@ and myself. Thanks to pirofti@ for creating the userland timecounter feature. ok kettenis@ pirofti@ deraadt@ cheloha@
* The PowerPC/Power ISA Time Base is a 64-bit register, so we can use thenaddy2020-07-121-2/+2
| | | | full lower 32 bits for the timecounter. ok kettenis@
* Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thepatrick2020-07-102-4/+4
| | | | | | "new" API. ok dlg@ tobhe@
* Add support for timeconting in userland.pirofti2020-07-062-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* Move PowerBook5,4 audio from aoa(4) to snapper(4).gkoehler2020-06-062-3/+11
| | | | | | | | | | | This adds the missing TAS3004 volume control. Before, I put my ear near the speaker (to hear audio), because I had no way to turn up the volume. Now, the default volume is much louder, so I use sndioctl(1) to turn it down. Check for the model string "PowerBook5,4". This model's device tree has compatible = "AOAKeylargo" for the audio, doesn't show the TAS3004 in the same way as other models.
* Implement cpu_rnd_messybits() as a read of the cycle counter register.naddy2020-06-051-10/+1
| | | | ok dlg@, powerpc/sparc64 ok kettenis@, sparc64/alpha tested by deraadt@
* 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@
* increment version numbers, due to recent RB_GOODSEED and fchmod +T changesderaadt2020-05-261-2/+2
|
* Bootblocks convert RB_GOODRANDOM to -R option, kernel converts it back into howtoderaadt2020-05-252-2/+7
|
* change wsdisplay attribute type from long to uint32_tjsg2020-05-252-6/+6
| | | | | | | | 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-252-4/+4
| | | | | | | | 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@
* Move boot.mac into the Attic.patrick2020-05-183-310/+0
| | | | ok deraadt@
* Make inittodr() and resettodr() MI.kettenis2020-05-161-93/+1
| | | | | ok deraadt@, mpi@, visa@ ok cheloha@ as well (would have preferred in new file for this code)
* Initialize the timeval passed to todr_gettime() with the base time fromkettenis2020-05-111-1/+4
| | | | | | | the file system such that implementations can use it to guess the right century. ok mpi@
* Use the same inittodr()/resettodr() implementation as onkettenis2020-05-012-83/+114
| | | | | | | | amd64/arm64/armv7/i386/hppa/sparc64 and move it to the end of machdep.c. Wrap the existing time_read and time_write hooks into something that can be used as a todr_handle. ok mpi@
* Commented WITNESS entry.mpi2020-04-151-1/+2
|
* Abstract the head of knote lists. This allows extending the lists,visa2020-04-071-3/+3
| | | | | | for example, with locking assertions. OK mpi@, anton@
* crank to 6.7-betaderaadt2020-04-051-2/+2
|
* Make the OpenFirmware functions work with clang.gkoehler2020-04-024-170/+212
| | | | | | | | | ofw_stack() was changing its caller's stack frame, but this stops working when clang inlines the caller into another function. Move the stack-switching logic into openfirmware(). Now ofw_stack() becomes ofw_msr() and only sets the msr. ok deraadt@ kettenis@
* Teach macppc ofwboot(8) about ffs2. Test and ok gkoehler@otto2020-03-163-9/+15
|
* 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@
* try disconnecting old world boot.mac bootloader for a bittedu2020-01-261-2/+2
|
* mesh(4) is old world and only new world macppc hardware is supported.krw2020-01-241-1200/+0
| | | | ok tedu@ jsg@
* mesh(4) is old world and only new world macppc hardware is supported.krw2020-01-243-9/+3
| | | | ok tedu@ jsg@