summaryrefslogtreecommitdiffstats
path: root/sys/arch/macppc
AgeCommit message (Collapse)AuthorFilesLines
2021-03-26Return EOPNOTSUPP for unsupported ioctlskn1-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.
2021-03-15Don't put an extern variable (ppc_kvm_stolen) into vmparam.h, other instancesderaadt1-5/+1
of this file are only doing cpp #define
2021-03-11spellingjsg8-17/+17
2021-03-09ofw_read_mem_regions() can skip calculation of physmem. pmap.cderaadt1-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
2021-02-23timecounting: use C99-style initialization for all timecounter structscheloha1-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@
2021-02-066.9-betaderaadt1-2/+2
2021-02-04Add uhidpp(4), a driver for Logitech HID++ devices. Currently limited toanton1-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@
2021-01-30satisfy -fno-commonderaadt2-4/+4
2021-01-28Again allow COPTS= to come from the environment again, and don't lose thederaadt1-4/+4
SMALL_KERNEL specific variations. ok espie jsg
2021-01-23introduce ujoy(4), a restricted subset of uhid(4) for gamecontrollers.thfr2-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@
2020-12-25Refactor klist insertion and removalvisa1-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@
2020-12-09Use daddr_t and not daddr32_t in boot media.krw2-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@
2020-11-29Teach lld to link the macppc kernelgkoehler1-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@
2020-11-28Add retguard to macppc kernel locore.S, ofwreal.S, setjmp.Sgkoehler2-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@
2020-11-08In case of failure, call sigexit() from trapsignal instead of sensig().mpi1-3/+5
Simplify MD code and reduce the amount of recursion into the signal code which helps when dealing with locks. ok cheloha@, deraadt@
2020-11-02Set initial default display brightness via of_setbrightness() to ensuretobhe1-2/+2
wscons and ofw are in sync. ok kn@
2020-10-27Make ws_get_param() return -1 on error. Fixes unhandled wsconsctl displaytobhe1-2/+2
settings. Found by and ok kn@
2020-10-26Define ws_get/set_param for macppc using ofw brightness and backlighttobhe1-1/+63
commands. Fixes wsconsctl display commands with drm drivers. ok kettenis@
2020-10-03Increase CLAIM_LIMIT from 11M to 14M to make room for retguardgkoehler2-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@
2020-09-21Fix eeprom(8) error when setting variableskn1-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
2020-08-31crank to 6.8-betaderaadt1-2/+2
2020-08-26Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.visa4-12/+4
OK deraadt@, mpi@
2020-07-17Userland timecounter for macppcgkoehler2-4/+4
Tested by cwen@ and myself. Thanks to pirofti@ for creating the userland timecounter feature. ok kettenis@ pirofti@ deraadt@ cheloha@
2020-07-12The PowerPC/Power ISA Time Base is a 64-bit register, so we can use thenaddy1-2/+2
full lower 32 bits for the timecounter. ok kettenis@
2020-07-10Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thepatrick2-4/+4
"new" API. ok dlg@ tobhe@
2020-07-06Add support for timeconting in userland.pirofti2-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@
2020-07-06wire up kstat(4)dlg1-2/+3
"looks right" deraadt@
2020-06-30Remove obsolete <machine/stdarg.h> header. Nowadays the varargvisa1-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@
2020-06-06Move PowerBook5,4 audio from aoa(4) to snapper(4).gkoehler2-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.
2020-06-05Implement cpu_rnd_messybits() as a read of the cycle counter register.naddy1-10/+1
ok dlg@, powerpc/sparc64 ok kettenis@, sparc64/alpha tested by deraadt@
2020-05-31introduce "cpu_rnd_messybits" for use instead of nanotime in dev/rnd.c.dlg1-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.
2020-05-29dev/rndvar.h no longer has statistical interfaces (removed during variousderaadt1-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.
2020-05-27Retire <machine/varargs.h>.visa1-3/+0
Nothing uses the header anymore. OK deraadt@ mpi@
2020-05-26increment version numbers, due to recent RB_GOODSEED and fchmod +T changesderaadt1-2/+2
2020-05-25Bootblocks convert RB_GOODRANDOM to -R option, kernel converts it back into howtoderaadt2-2/+7
2020-05-25change wsdisplay attribute type from long to uint32_tjsg2-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@
2020-05-25rename wsdisplay alloc_attr() to pack_attr()jsg2-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@
2020-05-18Move boot.mac into the Attic.patrick3-310/+0
ok deraadt@
2020-05-16Make inittodr() and resettodr() MI.kettenis1-93/+1
ok deraadt@, mpi@, visa@ ok cheloha@ as well (would have preferred in new file for this code)
2020-05-11Initialize the timeval passed to todr_gettime() with the base time fromkettenis1-1/+4
the file system such that implementations can use it to guess the right century. ok mpi@
2020-05-01Use the same inittodr()/resettodr() implementation as onkettenis2-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@
2020-04-15Commented WITNESS entry.mpi1-1/+2
2020-04-07Abstract the head of knote lists. This allows extending the lists,visa1-3/+3
for example, with locking assertions. OK mpi@, anton@
2020-04-05crank to 6.7-betaderaadt1-2/+2
2020-04-02Make the OpenFirmware functions work with clang.gkoehler4-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@
2020-03-16Teach macppc ofwboot(8) about ffs2. Test and ok gkoehler@otto3-9/+15
2020-02-20Replace field f_isfd with field f_flags in struct filterops to allowvisa1-2/+2
adding more filter properties without cluttering the struct. OK mpi@, anton@
2020-01-26try disconnecting old world boot.mac bootloader for a bittedu1-2/+2
2020-01-24mesh(4) is old world and only new world macppc hardware is supported.krw1-1200/+0
ok tedu@ jsg@
2020-01-24mesh(4) is old world and only new world macppc hardware is supported.krw3-9/+3
ok tedu@ jsg@