summaryrefslogtreecommitdiff
path: root/sys/arch/m88k
AgeCommit message (Collapse)Author
2013-12-18Provide MI symbol _STACKALIGNBYTESTheo de Raadt
2013-11-16Allow initial device mappings (from pmap_table) to be backed up by BATC.Miod Vallat
Use this on luna88k to map the bitmap planes of the frame buffer used by the driver. 10% speedup under X.
2013-11-03Even saner kernel layout, so that .rodata can be batc mapped by a read-onlyMiod Vallat
dbatc. Add batc mapping support for 88110 systems as well.
2013-11-02Create the initial page tables in the area between the end of the firmwareMiod Vallat
data area and the kernel image, whenever possible. On 88100/88200 systems, use BATC mappings to map the kernel text (and the kernel data for non-MULTIPROCESSOR kernels). 88110 to follow soon.
2013-10-17Remove support for a.out and ecoff. We only do elf now.Theo de Raadt
ok miod
2013-10-07Put the kernel VBR page at the beginning of the kernel text, as done onMiod Vallat
mvme88k, to be able to unmap the page at address zero in the kernel, and have the vbr page read-only after being initialized.
2013-09-23- change m8820x_cmmu_set_reg() and m8820x_cmmu_set_cmd() to performMiod Vallat
unconditional actions. Introduce _if_addr() and _if_mode() variants of these to act on a given cmmu type only, or on a matching address line only. This makes the code slightly larger but easier to read and a tad faster. - report each cmmu on its own line in dmesg, sorted by type (I$ first, then D$). make sure disabled line information ends up in dmesg, rather than in the early bootstrap messages. - fix the multiprocessor writeback logic in m8820x_dma_cachectl() again to be more reliable; also only rendezvous the cmmus after all cmmu operation have been issued, instead of doing a rendezvous per cpu.
2013-09-05Service the 88100 floating-point exceptions through trap(), keeping theMiod Vallat
existing assembly code for now. Make sure the trapframe images of %fpsr and %fpcr are updated by the assembly handlers (in addition to the real registers which were already updated). When returning into trap(), check these updated value to decide whether a signal ought to be sent to the userland process. With these changes, computations which ought to cause a signal to be delivered will indeed trigger the signal, even when they are handled by the completion code in the floating point exception handlers. This fixes the libc/ieeefp/except and lib/fenv regress tests on 88100 systems, finally!
2013-08-26Use %r27 as the thread control block pointer, allowing for __get_tcb() callsMiod Vallat
in libpthread to be optimized away. While there, follow DG/UX's example of using more than one register for thread purposes (after all, the ABI reserves four of them), and also use %r26 to store a pointer to the current thread's errno. Since it is not possible to initialize %r26 at thread creation without intrusive and potentially race-prone changes, have __tfork() reset %r26 to zero, and libpthread's __cerror lazy initialize it. As soon as %r26 is nonzero, it will be used instead of calling __errno(). This means that binaries linked against HEAD libpthread need to run on HEAD kernels, and we are belatedly jumping on the 64-bit time_t bump (since there are no 64-bit time_t m88k snapshots yet). Joint work with guenther@; "Your love of asm is sick and wrong, and yet beautiful." and ok guenther@
2013-08-26When a page needs to be flushed from all caches, make sure the writebackMiod Vallat
happens on all D$ in MULTIPROCESSOR kernels, for the dirty lines may not all be on the current cpu. Fixes spurious segmentation faults or ill behaviours in MULTIPROCESSOR kernels, but there are still some left.
2013-08-24Make sure do_xmem_* return the correct value. This fixes usage of fork()Miod Vallat
in programs linked against libpthread on 88100 processors, where the parent thread issueing fork() would spin. Interestingly enough, this bug is not found in Mach, but has been introduced by Nivas when porting to mvme88k, 18 years ago. DAE involving xmem are rare enough for the issue to have survived so long (and once again, it was a nightmare to track down).
2013-08-18data_access_emulation() may fault. Be sure to clear pcb_onfault beforeMiod Vallat
invoking it. While there, rework the return-to-pcb_onfault logic to avoid falling through the DAE code. This allows us to get rid of the bogus DMT_SKIP flag as well: DAE is only necessary if DMT_VALID is set in DMT0, and DMT0 is reset to zero afterwards.
2013-08-18Rework the DAE print routines again to output something closer to an actualMiod Vallat
instruction, and print the target address rather than the rounded address and the byte enables.
2013-08-18data_access_emulation() may fault. Be sure to clear pcb_onfault beforeMiod Vallat
invoking it. While there, rework the return-to-pcb_onfault logic to avoid falling through the DAE code. This allows us to get rid of the bogus DMT_SKIP flag as well: DAE is only necessary if DMT_VALID is set in DMT0, and DMT0 is reset to zero afterwards.
2013-08-18No need to test for DMT0 being valid a second time in the `save DMT andMiod Vallat
clear proper SSBR bits' code path.
2013-08-18Fix prototypes of do_load_half() and do_load_byte() - those return aMiod Vallat
sign-extended 32-bit value. The previous prototypes used too narrow return types since the mvme88k/luna88k code unification 9 years ago. Amazingly this did not cause much harm and took quite a while to understand. The most visible occurence of this bug would be awk aborting early with a syntax error message, on valid output; this is no surprise as awk is probably the largest consumer of `short' types in the tree. Of course, the bug would not be reliably reproduceable, because it would only trigger if the DAE code path was taken, usually during page fault processing; and since uvm_fault() will attempt to fault neighbouring pages, depending upon the particular randomness (stackgap, shared library location) at the time one ran awk, it may (but quite often may not) trigger. [forcing all uvm_fault() narrow helped reproduce the issue reliably and eventually fix it]
2013-08-15Be sure to always invoke cache routines with properly rounded addresses;Miod Vallat
the bus_dmamap_sync() bowels would sometimes use incorrectly rounded addresses, which has been apparently harmless so far, but better be safe than sorry.
2013-08-15Be sure to set the `non equal' bit when emulating fcmp{,u} and the operandsMiod Vallat
are orderable, but not equal.
2013-08-15make debug output sligthly more usefulMiod Vallat
2013-08-15typosMiod Vallat
2013-08-07We uniformly define size_t to be unsigned long and ssize_t to be long. MakeMark Kettenis
sure that SIZE_MAX and SSIZE_MAX are defined as constants with a matching type on all are architectures. ok millert@, matthew@
2013-07-17Use `long' instead of `int' in structure layouts which may get assigned fromMiod Vallat
(or to) register_t, but need to be usable without register_t in scope, so that the compiler won't warn about these assignments after the recent _types.h changes; aoyama@
2013-07-17Fix setregs() to match prototype. Exposed by recent _types.h change, found theMiod Vallat
hard way by aoyama@
2013-07-13unify register_t to long on all platformsTheo de Raadt
ok miod kettenis
2013-07-05Take II, this time without flubbing off_t: : move several internalPhilip Guenther
type definitions that are the same across all archs from <machine/_types.h> to <sys/_types.h> ok deraadt@ kettenis@ otto@
2013-07-04backout previous; off_t must be signed and there might be other C++ APIOtto Moerbeek
breakage lurking; ok kettenis@
2013-07-04To ease future changes, move several internal type definitions that arePhilip Guenther
the same across all archs from <machine/_types.h> to <sys/_types.h> ok deraadt@
2013-06-30Add a luna88k-specific function to initialize the instruction cmmuKenji Aoyama
SAPR register. On luna88k, secondary processors are not disabled while the kernel is initializing. They are running an infinite loop in locore.S:secondary_init on non-MULTIPROCESSOR kernel. Then, after initializing the CMMUs tied to the currently-running processor, we turn on the instruction cache of other processors to make them happier. As a bonus, on non-MULTIPROCESSOR kernel, the power switch LED of luna88k is blinking green and orange again. According to the hardware manual, it indicates processors' cache hit status. suggested and ok miod@
2013-06-07Add {,u}{div,mod}si3 to libkern and to the kernel as well.Miod Vallat
2013-06-04comment fix: actually called __cpu_simple_lock_tTed Unangst
2013-06-01cleanup and consolidate the spinlock_lock (what a name!) code.Ted Unangst
it's now atomic_lock to better reflect its usage, and librthread now features a new spinlock that's really a ticket lock. thrlseep can handle both types of lock via a flag in the clock arg. (temp back compat hack) remove some old stuff that's accumulated along the way and no longer used. some feedback from dlg, who is concerned with all things ticket lock. (you need to boot a new kernel before installing librthread)
2013-05-31remove counters for simplelocksTed Unangst
2013-05-27Use FLUSH_PIPELINE instead of rolling our own. No functional change.Miod Vallat
2013-05-25Fix wbinv routine used by bus_dmamap_sync() to correctly operate on all cmmus,Miod Vallat
instead of I$ cmmu only. This longstanding bug has been introduced in r1.44, which commit message was right mentioning that it `fixes some bugs, probably introduces new ones as well'.
2013-05-25Allow badaddr() to be used with a size of 8. Needed by the MVME181 memoryMiod Vallat
detection code, and forgotten in previous commit.
2013-05-17Unnecessary includeMiod Vallat
2013-05-17Extend cmmu routines to return the caching mode to use for page tables.Miod Vallat
Alter the 88200-specific code to enforce cache-inhibited page tables for extremely old 88200 versions, and to disable write-back caching on systems where xmem instructions do not behave correctly when applied to write-back cached addresses. No change introduced on 88110 systems, as well as most 88100 systems; the affected systems are 88100 systems with 88100 revision < 10 and/or 88200 revision < 7; that is, only early MVME181 and MVME188 (not 188A) systems.
2013-05-17Fix comments telling that the `serial mode' bit in PSR only applies to 88110,Miod Vallat
it also exists on 88100. While there, do not allow userland to set it.
2013-05-15Initialize a teeny few more globals to reasonable values to allow for printf()Miod Vallat
to work as soon as cn_tab is initialized. Allows us to correctly printf or panic early on unrecognized systems. This used to be the case but got lost a long time ago.
2013-05-14Declare the cmmu-related variables which are set early in the kernel life,Miod Vallat
before pmap_bootstrap(), as located in .rodata. This will get them write-protected after pmap has initialized, for free.
2013-04-20Prefer the processor-specific _DYNAMIC[] tags value to find out the boundariesMiod Vallat
of the .plt whenever possible, and fallback to the old behaviour of searching for special symbols pointing to its boundaries. No functional change.
2013-04-12Double-register load and store instructions using an odd-numbered register asMiod Vallat
the low part trigger an `illegal instruction' trap on the 88110 (and I can't see this documented anywhere in the manual). Of course there is code "in the wild" which uses such constructs (libgmp is one such example). Extend double_reg_fixup() to take the trap type as an extra argument, and explicitely allow ld.d or st.d instructions with odd-numbered registers at aligned addresses if we are invoked from the `illegal instruction' trap handler, to give this code a chance to run on 88110.
2013-04-01Unbreak 1.16Miod Vallat
2013-03-28Add STRONG_ALIAS macros to be used from assembly code in libc andMartynas Venckus
libm. While at it, remove now unused workarounds for lint. Agreed by kettenis@, guenther@, matthew@.
2013-03-28Add __strong_alias macros for all architectures to be able to aliasMartynas Venckus
another symbol without weak attribute. To be used in libc and libm soon. Agreed by kettenis@, guenther@, matthew@.
2013-03-26PGSHIFT and PGOFSET are now contained inside the kernel namespace.Theo de Raadt
2013-03-25ALIGNBYTES/ALIGN/ALIGNED_POINTER can move to the MI file.Theo de Raadt
2013-03-23refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is addedTheo de Raadt
to keep definitions our of user space. The MD files now follow a consistant order -- all namespace intrusion is at the tail can be cleaned up independently. locore, bootblocks, and libkvm still see enough visibility to build. Checked on 90% of platforms...
2013-03-12Fix kernel profiling on MP systems by using per-CPU buffers and teachMartin Pieuchot
kgmon(8) to deal with them, this time without public header changes. Previously various CPUs were iterating over the same global buffer at the same time to modify it and never ended. This diff includes some ideas submited by Thor Simon to NetBSD via miod@. ok deraadt@, mikeb@, haesbaert@
2013-02-20Increase maximum text and data size limits, and double the default data sizeMiod Vallat
limit. This allows c++ memory hogs, such as pcre's pcrecpp_unittest.cc, to compile on m88k.