summaryrefslogtreecommitdiff
path: root/sys/arch/luna88k
AgeCommit message (Collapse)Author
2024-11-08Change 'labeloffset' to 0 from 64 as that space in the OpenBSD disklabel ↵Kenneth R Westerback
block is no longer used by luna88k. Tested & ok miod@ aoyam@
2024-11-05The MI boot code used to have an infinite loop trying to boot the kernel,Miod Vallat
which got limited to at most two tries 26 years ago for the 2.3 release, but the documentation was never updated to match this change. Do it now. Reported by Nir Lichtman on tech@
2024-11-04remove ability to specify root/dump/swap on st(4)Jonathan Gray
support for tape block devices was removed in 2016 ok miod@
2024-11-04No need to duplicate the scsi_xfer timeout field in spc_acb.Miod Vallat
Tested by & ok aoyama@
2024-10-22put opening { on same line as struct nameJonathan Gray
ok claudio@
2024-09-04Fix some spelling.Marcus Glocker
Input and ok jmc@, jsg@
2024-07-14Add missing <machine/elf.h> for compound arches.Miod Vallat
The spice^Wkernel must flow^Wbuild.
2024-06-26return type on a dedicated line when declaring functionsJonathan Gray
ok mglocker@
2024-06-01Move common definitions into the header file.Kenji Aoyama
No binary change.
2024-05-22remove prototypes with no matching function; ok miod@Jonathan Gray
2024-05-02Delete extra spaces, change spaces to tab.Kenji Aoyama
No binary change.
2024-03-30Use illop1 as failure instruction in the locore gap file.Miod Vallat
2024-01-28set -fno-stack-protector in NORMAL_C_NOP, which is used to compileTheo de Raadt
mcount.c, in the same way that -fno-ret-protector is set (because the default ret-protector is an "always" generator). This change ensures there is never a stack protector prologue/epilogue in the functions in that file, no matter what stack protector selection algorithm is in play. ok kettenis guenther
2023-10-24Normally context switches happen in mi_switch() but there are 3 casesClaudio Jeker
where a switch happens outside. Cleanup these code paths and make the machine independent. - when a process forks (fork, tfork, kthread), the new proc needs to somehow be scheduled for the first time. This is done by proc_trampoline. Since proc_trampoline is machine dependent assembler code change the MP specific proc_trampoline_mp() to proc_trampoline_mi() and make sure it is now always called. - cpu_hatch: when booting APs the code needs to jump to the first proc running on that CPU. This should be the idle thread for that CPU. - sched_exit: when a proc exits it needs to switch away from itself and then instruct the reaper to clean up the rest. This is done by switching to the idle loop. Since the last two cases require a context switch to the idle proc factor out the common code to sched_toidle() and use it in those places. Tested by many on all archs. OK miod@ mpi@ cheloha@
2023-10-08Add inclusion of "dev/hid/files.hid" and "dev/usb/files.usb".Kenji Aoyama
Actually these devices are not supported on luna88k, but we need them in order to create attribute header files (e.g. "ucom.h") required in MI part recently. Suggested by miod@, tested by me.
2023-09-17clockintr: remove clockintr_init(), clockintr_flagsScott Soule Cheloha
All the state initialization once done in clockintr_init() has been moved to other parts of the kernel. It's a dead function. Remove it. Likewise, the clockintr_flags variable no longer sports any meaningful flags. Remove it. This frees up the CL_* flag namespace, which might be useful to the clockintr frontend if we ever need to add behavior flags to any of those functions.
2023-09-11Remove unnecessary <sys/selinfo.h> includes.Vitaliy Makkoveev
ok jsg
2023-08-23all platforms: separate cpu_initclocks() from cpu_startclock()Scott Soule Cheloha
To give the primary CPU an opportunity to perform clock interrupt preparation in a machine-independent manner we need to separate the "initialization" parts of cpu_initclocks() from the "start the clock interrupt" parts. Currently, cpu_initclocks() does everything all at once, so there is no space for this MI setup. Many platforms have more-or-less already done this separation by implementing a separate routine named "cpu_startclock()". This patch promotes cpu_startclock() from de facto standard to mandatory API. - Prototype cpu_startclock() in sys/systm.h alongside cpu_initclocks(). The separation of responsibility between the two routines is a bit fuzzy but the basic guidelines are as follows: + cpu_initclocks() must initialize hz, stathz, and profhz, and call clockintr_init(). + cpu_startclock() must call clockintr_cpu_init() and start the clock interrupt cycle on the calling CPU. These guidelines will shift in the future, but that's the way things stand as of *this* commit. - In initclocks(): first call cpu_initclocks(), then do MI setup, and last call cpu_startclock(). - On platforms where cpu_startclock() already exists: don't call cpu_startclock() from cpu_initclocks() anymore. - On platforms where cpu_startclock() doesn't yet exist: implement it. Usually this is as simple as dividing cpu_initclocks() in two. Tested on amd64 (i8254, lapic), arm64, i386 (i8254, lapic), macppc, mips64/octeon, and sparc64. Tested on arm/armv7 (agtimer(4)) by phessler@ and jmatthew@. Tested on m88k/luna88k by aoyama@. Tested on powerpc64 by gkoehler@ and mlarkin@. Tested on riscv64 by jmatthew@. Thread: https://marc.info/?l=openbsd-tech&m=169195251322149&w=2
2023-08-05Inform 8bpp capability on 8bpp framebuffer inKenji Aoyama
WSDISPLAYIO_GETSUPPORTEDDEPTH ioctl. This is needed to use recent updated wsfb(4) driver in 8bpp mode. We can use 1bpp X server on 8bpp framebuffer by 'startx -- -depth 1'. Tested by me.
2023-07-25statclock: move profil(2), GPROF code to profclock(), gmonclock()Scott Soule Cheloha
This patch isolates profil(2) and GPROF from statclock(). Currently, statclock() implements both profil(2) and GPROF through a complex mechanism involving both platform code (setstatclockrate) and the scheduler (pscnt, psdiv, and psratio). We have a machine-independent interface to the clock interrupt hardware now, so we no longer need to do it this way. - Move profil(2)-specific code from statclock() to a new clock interrupt callback, profclock(), in subr_prof.c. Each schedstate_percpu has its own profclock handle. The profclock is enabled/disabled for a given CPU when it is needed by the running thread during mi_switch() and sched_exit(). - Move GPROF-specific code from statclock() to a new clock interrupt callback, gmonclock(), in subr_prof.c. Where available, each cpu_info has its own gmonclock handle . The gmonclock is enabled/disabled for a given CPU via sysctl(2) in prof_state_toggle(). - Both profclock() and gmonclock() have a fixed period, profclock_period, that is initialized during initclocks(). - Export clockintr_advance(), clockintr_cancel(), clockintr_establish(), and clockintr_stagger() via <sys/clockintr.h>. They have external callers now. - Delete pscnt, psdiv, psratio. From schedstate_percpu, also delete spc_pscnt and spc_psdiv. The statclock frequency is not dynamic anymore so these variables are now useless. - Delete code/state related to the dynamic statclock frequency from kern_clockintr.c. The statclock frequency can still be pseudo-random, so move the contents of clockintr_statvar_init() into clockintr_init(). With input from miod@, deraadt@, and claudio@. Early revisions cleaned up by claudio. Early revisions tested by claudio@. Tested by cheloha@ on amd64, arm64, macppc, octeon, and sparc64 (sun4v). Compile- and boot- tested on i386 by mlarkin@. riscv64 compilation bugs found by mlarkin@. Tested on riscv64 by jca@. Tested on powerpc64 by gkoehler@.
2023-06-18Add fchmod() entry in luna88k bootloader.Kenji Aoyama
Now 'chmod a-x /bsd.upgrade' works in order to prevent re-upgrade, like other architectures. Tested by me on LUNA-88K2.
2023-06-18Fix SCSI CMD_WRITE_EXT command length to 10 bytes.Kenji Aoyama
This is needed to work libsa's ufs_fchmod() on luna88k. Tested by me on LUNA-88K2.
2023-06-15all platforms, main(): call clockqueue_init() just before sched_init_cpu()Scott Soule Cheloha
Move the clockqueue_init() call out of clockintr_cpu_init() and up just before the sched_init_cpu() call for a given CPU. This will allow sched_init_cpu() to allocate clockintr handles for a given CPU's scheduler in a later patch. Link: https://marc.info/?l=openbsd-tech&m=168661507607622&w=2 ok kettenis@, claudio@
2023-04-10spellingJonathan Gray
2023-03-13Add "machine poweroff" command on luna88k bootloader.Kenji Aoyama
ok miod@
2023-03-11Add missing $OpenBSD$ tag.Kenji Aoyama
2023-03-08Delete obsolete /* ARGSUSED */ lint comments.Philip Guenther
ok miod@ millert@
2023-02-24Change to use the default bsd.prog.mk "install" target.Kenji Aoyama
This also brings to install boot.8 man page correctly. ok miod@
2023-02-23Remove dangerous user-settable "addr" variable from MI boot loader, andMiod Vallat
only compile tty-related code (stty command, tty variable) on platforms where it makes sense for the boot loader to control it, rather than the PROM/firmware/whatever.
2023-02-23Make bootloader 'time' command work correctly on luna88k.Kenji Aoyama
Now the correct date is displayed instead of January 1, 1970. Tested on LUNA-88K2 and nono emulator by me. "make sense" miod@
2023-02-15Now Puffy comes on luna88k bootloader!Kenji Aoyama
"Of course!" miod@
2023-02-11Make 'ls' command in bootloader work correctly on luna88k.Kenji Aoyama
Now 'ls' against directory works fine. Tested on LUNA-88K2 and nono emulator by me.
2023-02-10Delete no-longer-used file.Kenji Aoyama
2023-01-27Delete get_plane_numbers() function.Kenji Aoyama
Different from original LUNA(68k), the number of planes is directly stored as an integer value on LUNA-88K. Tested on LUNA-88K2 by me.
2023-01-23Add Backtab key, based on a change from Crystal Kolipe kolipe.c atNicholas Marriott
exoticsilicon dot com. ok miod
2023-01-13put man page in the right placeTheo de Raadt
2023-01-12Update luna88k boot procedure; help & tweaks jmc@Miod Vallat
2023-01-10Switch the luna88k boot loader to the MI boot code, to ease future maintainenceMiod Vallat
of it. Crank version to 0.8. ok aoyama@
2022-12-31Let luna88k's bootloader pass RB_GOODRANDOM to the kernel.Kenji Aoyama
Current bootloader can pass boothowto information to the kernel. It also has the capability to load random seed data from /etc/random.seed already. So set RB_GOODRANDOM at the bootloader when loadrandom() has been finished successfully. Now the kernel says "random: good seed from bootblocks". Tested by LUNA-88K2 and nono emulator, "Absolutely!" ok miod@
2022-12-18Do not save bootdev and boothowto when invalid value has passed.Kenji Aoyama
This occurs the kernel has booted from old boot loader or directly booted by command line parameter on emulator. Tested by LUNA-88K2 and nono emulator.
2022-12-10Fix comments, no binary change.Kenji Aoyama
2022-12-06_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingPhilip Guenther
is ELF" world. Eliminate use of them in m88k code. ok aoyama@
2022-12-06m88k, luna88k: switch to clockintrScott Soule Cheloha
- Initialize tick_nsec during cpu_initclocks() We have no control over the interrupt clock on luna88k, so this switch is trivial. Bringup help and testing from aoyama@ and miod@. Link: https://marc.info/?l=openbsd-tech&m=166776371203450&w=2 ok aoyama@ mlarkin@
2022-11-06Change character drawing depth when 'pseudo' framebuffer depth is changed.Kenji Aoyama
Tested on LUNA-88K2 with 4bpp/8bpp framebuffer by me.
2022-11-02Remove audio(9) speaker_ctl(), let open() handle speakers where neededKlemens Nanni
Only five legacy half-duplex hardware drivers require this function to change between playing and recording: i386: ess(4), gus(4), pas(4), sb(4) luna88k: nec86(4) If defined, it is always called early in audio_open(), so just move the call from audio(4) to each hardware driver's open() handler. SPKR_ON/OFF remain defined to leave driver-specific code unchanged. Further cleanup (unchecked speaker_ctl() return values, FWRITE -> AUMODE_PLAY -> SPKR_ON dances, etc.) can happen later. Builds fine on i386. OK ratchov
2022-10-28Replace audio(9) get_props() with duplex check in open() in non-duplex driversKlemens Nanni
Make drivers which do *not* adverise AUDIO_PROP_FULLDPLEX return ENXIO in their open() if full-duplex mode was requested. This way, sys/dev/audio.c:audio_open() will fail immediately rather than later through the to-be-removed get_props() check. These are all drivers which simply don't support full-duplex mode. In device-tree based drivers like simpleaudio(4)/rkiis(4) and newer Apple ones like aplaudio(4)/aplmca(4), this adds a new open() stub to the low-level drivers which merely does the duplex check. My Pinebook Pro keeps playing audio and recording silence with this diff just like before (rkiis(4) is currently play-only): simpleaudio0 at mainbus0 simpleaudio1 at mainbus0 audio0 at simpleaudio1 $ aucat -i song69.wav -o rec.wav OK ratchov miod
2022-10-25Add more chance to process IPI in the interrupt service routine.Kenji Aoyama
This prevents "luna88k_ext_int: cpu0 level 1 interrupt" message on heavy load. "This makes sense" miod@, tested by me.
2022-10-19Use C99 struct init for struct audio_hw_ifKlemens Nanni
This audio(9) struct will lose a member, but drivers init their struct quite inconsistently, most pre-C99 style. Use C99 style everywhere, to get rid of all annoying differences and allow for easy member removals/additions: - don't change current order of members - no explicit NULL members - no comments or blank lines - trailing comma in last member line GENERIC.MP builds fine with this on arm64, amd64, i386 and sparc64. macppc and alpha build-tested by miod OK ratchov miod
2022-10-19Remove audio(9) setfd() stubKlemens Nanni
necsb(4/luna88k) is the only driver that "implements" it... through EIO. Remove it so setfd can be removed from struct audio_hw_if. Prodded by ratchov OK aoyama
2022-10-15ansiJonathan Gray