summaryrefslogtreecommitdiff
path: root/sys/arch/macppc
AgeCommit message (Collapse)Author
2021-06-23adb(4/macppc): fix adb_cuda_tickle() prototypecheloha
Timeout callback functions are of type void (*)(void *). adb_cuda_tickle() needs a void pointer for a first parameter. ok mpi@
2021-06-14reset ppc_altivec if 'option ALTIVEC' is not present.Matthieu Herrb
This makes sysctl machdep.altivec return 0 in this case, allowing applications to select the non-altivec code path. Issue with pixman reported by cwen@ ok jca@ gkoehler@ deraadt@
2021-05-10Add ld.script for macppc kernel, ofwbootgkoehler
These are copies of powerpc64/conf/ld.script with some changes for macppc. They work with both ld.bfd and ld.lld. The ld.script fixes ld.lld. Without ld.script, lld would set the symbol "etext" to a wrong value like 0x10000034, then ofwboot would freeze and fail to boot the kernel. With ld.script, we PROVIDE a correct etext. ok kettenis@
2021-03-26Return EOPNOTSUPP for unsupported ioctlskn
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 instancesTheo de Raadt
of this file are only doing cpp #define
2021-03-11spellingJonathan Gray
2021-03-09ofw_read_mem_regions() can skip calculation of physmem. pmap.cTheo de Raadt
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 structscheloha
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-betaTheo de Raadt
2021-02-04Add uhidpp(4), a driver for Logitech HID++ devices. Currently limited toanton
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-commonTheo de Raadt
2021-01-28Again allow COPTS= to come from the environment again, and don't lose theTheo de Raadt
SMALL_KERNEL specific variations. ok espie jsg
2021-01-23introduce ujoy(4), a restricted subset of uhid(4) for gamecontrollers.thfr
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 removalVisa Hankala
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.Kenneth R Westerback
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 kernelgkoehler
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.Sgkoehler
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().Martin Pieuchot
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 ensuretobhe
wscons and ofw are in sync. ok kn@
2020-10-27Make ws_get_param() return -1 on error. Fixes unhandled wsconsctl displaytobhe
settings. Found by and ok kn@
2020-10-26Define ws_get/set_param for macppc using ofw brightness and backlighttobhe
commands. Fixes wsconsctl display commands with drm drivers. ok kettenis@
2020-10-03Increase CLAIM_LIMIT from 11M to 14M to make room for retguardgkoehler
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 variableskn
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-betaTheo de Raadt
2020-08-26Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.Visa Hankala
OK deraadt@, mpi@
2020-07-17Userland timecounter for macppcgkoehler
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 theChristian Weisgerber
full lower 32 bits for the timecounter. ok kettenis@
2020-07-10Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thePatrick Wildt
"new" API. ok dlg@ tobhe@
2020-07-06Add support for timeconting in userland.Paul Irofti
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)David Gwynne
"looks right" deraadt@
2020-06-30Remove obsolete <machine/stdarg.h> header. Nowadays the varargVisa Hankala
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).gkoehler
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.Christian Weisgerber
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.David Gwynne
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 variousTheo de Raadt
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>.Visa Hankala
Nothing uses the header anymore. OK deraadt@ mpi@
2020-05-26increment version numbers, due to recent RB_GOODSEED and fchmod +T changesTheo de Raadt
2020-05-25Bootblocks convert RB_GOODRANDOM to -R option, kernel converts it back into ↵Theo de Raadt
howto
2020-05-25change wsdisplay attribute type from long to uint32_tJonathan Gray
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()Jonathan Gray
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.Patrick Wildt
ok deraadt@
2020-05-16Make inittodr() and resettodr() MI.Mark Kettenis
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 fromMark Kettenis
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 onMark Kettenis
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.Martin Pieuchot
2020-04-07Abstract the head of knote lists. This allows extending the lists,Visa Hankala
for example, with locking assertions. OK mpi@, anton@
2020-04-05crank to 6.7-betaTheo de Raadt
2020-04-02Make the OpenFirmware functions work with clang.gkoehler
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@Otto Moerbeek
2020-02-20Replace field f_isfd with field f_flags in struct filterops to allowVisa Hankala
adding more filter properties without cluttering the struct. OK mpi@, anton@