summaryrefslogtreecommitdiff
path: root/sys/arch/sh3
AgeCommit message (Collapse)Author
2023-04-28fix few typos and grammar in comments.andvar
2023-04-28Pass local symbols relocations in both passes and provide the kobj_relocskrll
implementation visibility of these relocations. Currently all implementations resolve local symbol relocations in the first pass and simply skip them in the second. The RISC-V implementation will make use of this visiblity.
2022-10-26ddb/db_active.h: New home for extern db_active.riastradh
This can be included unconditionally, and db_active can then be queried unconditionally; if DDB is not in the kernel, then db_active is a constant zero. Reduces need for #include opt_ddb.h, #ifdef DDB.
2022-07-26s/fucntion/function/ in comments.andvar
2022-05-24fix various typos in comments, docs and log messages.andvar
2022-02-23fix various typos in comments, mainly immediatly/immediately/,andvar
as well shared and recently fixed typos in OpenBSD code by Jonathan Grey.
2022-02-13sh3: __cpu_simple_unlock needs __insn_barrier.riastradh
No multiprocessor support here but the compiler can still reorder memory access.
2021-11-01Use "stack_t" instead of "struct sigaltstack", as the former is thethorpej
newer standardized name. NFC.
2021-10-29Define __HAVE_STRUCT_SIGCONTEXT regardless of its current visibility.thorpej
2021-10-27Use the signal trampoline version constants from <sys/signal.h>.thorpej
2021-10-27Make sigcontext13 visible only to _KERNEL. Make sigcontext visible onlythorpej
to _LIBC and _KERNEL.
2021-10-26Merge all MD __sigaction14_sigtramp.c copies into one:christos
- sparc and sparc64 were not using version 0 sigcontext when there were no arguments in the signal version. This was probably a bug. - vax is using +1 the version numbers of the other archs. - Only hppa was defining __LIBC12_SOURCE__ so it was getting a working sigcontext before. all the other ports that supported sigcontext had the compat code disabled. [pointed out by thorpej, thanks!] If we want to remove sigcontext support from userland at least now there is less work to do so.
2021-10-06s/embeded/embedded/ in comments and messages.andvar
2021-09-18Fix trailing backslashes in a macro that got misaligned.uwe
2021-09-18Fix one comment edit missed in previous.uwe
2021-09-18Do not obfuscate r0 as "reg_tmp0".uwe
Using r0 as a temp is a common choice. Some instructions _must_ use r0 as the destination (like mova or instructions with immediates). ABI uses r0 as the return register. So a helpful name is not that helpful for the former use case (temp) and is confusing for the latter two (ISA or ABI constraints). Same object code is generated.
2021-09-18Space after comma in operands. Same object code is generated.uwe
2021-09-18Support __PIC__ build, in order to avoid text relocations forrin
/usr/tests/net/in_cksum/in_cksum. Now, all the tests for in_cksum successfully pass for sh[34]. No binary changes for kernel.
2021-09-18cksum128mod: Prepare jump address by 'mova', instead of 'mov.l'.rin
Since both this 'mova' and 'and #imm' above must be used against r0, we need extra 'mov r0, r3'. However, this should still be good both for sh3 and sh4: - For sh3, 'mov.l' at odd half-word address is removed; pipeline hazard due to instruction fetch is resolved. - For sh4, data cache line is no longer assigned for this 'mov.l'. Also: - Upcoming __PIC__ support (in order to avoid text relocations when built in tests/net/in_cksum) becomes simpler; no need CALL_DATUM_LOCAL() for cksum128_tail. - Shave off 4 bytes from text. No regression is observed for sh3 (hpcsh) and sh4 (landisk).
2021-09-15For kernel mode address error, do not overwrite tf->tf_spc and tf->tf_r0rin
*before* checking pcb->pbc_onfault != NULL. Should fix part of PR port-sh3/56382 PR port-sh3/56401 i.e., DDB will no longer wrongly indicate NULL as fault PC for kernel mode address error (and 0xe == EFAULT as r0). Yes, we have another bugs that cause panics described in the two PRs, but now we can examine them more easily :).
2021-09-08Hmm, remove one more parentheses from return.rin
2021-09-08Restore braces for if/else statements which have logically single line,rin
but physically multiple lines. This is recommended by an example in style: http://cvsweb.netbsd.org/bsdweb.cgi/src/share/misc/style#rev1.58 Thanks tsutsui@ for pointing it out.
2021-09-08Redo a part of rev 1.89:rin
- Improve uniformity of panic messages. Also, use __func__ instead of hard-coded function names.
2021-09-08Redo a part of rev 1.89:rin
- Remove redundant parentheses/braces/comments. - Fix indents. No binary changes confirmed this time.
2021-09-08Revert rev 1.89:rin
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sh3/sh3/pmap.c#rev1.89 I misunderstood evaluation order of ? operator. I should have split the commit into two parts, i.e., with and without binary diffs, in order to avoid such a serious mistake. Thanks rillig@ so much for careful check!!!!
2021-09-08Misc cosmetic fixes:rin
- Remove redundant parentheses/braces/comments. - Improve uniformity of panic messages. Also, use __func__ instead of hard-coded function names. - Fix indents.
2021-09-08Turn KASSERT's added for PR port-sh3/56381 into KDASSERT's;rin
they are less likely expected to fire again.
2021-09-02Add missing NULL check for __pmap_pv_alloc() (== pool_get() withrin
PR_NOWAIT) in __pmap_pv_enter(). Then, handle this failure in pmap_enter(); return ENOMEM if PMAP_CANFAIL, and panic otherwise.
2021-09-02PR port-sh3/56381rin
pmap_enter() returns ENOMEM if __pmap_pte_alloc() fails and PMAP_CANFAIL flag is specified. In this case, remove pv via __pmap_pv_remove() if it is added to p-v map list via __pmap_pv_enter(). Otherwise, pmap becomes an inconsistent state, which results in an infinite loop in pmap_page_protect(), as reported in the PR. Also, KASSERT's are added for sure, in order to detect the infinite loops. Great thanks to chs@ for finding out this bug!!
2021-08-25- In kern_mutex.c, if MUTEX_CAS() is not defined, define it in terms ofthorpej
atomic_cas_ulong(). - For arm, ia64, m68k, mips, or1k, riscv, vax: don't define our own MUTEX_CAS(), as they either use atomic_cas_ulong() or equivalent (atomic_cas_uint() on m68k). - For alpha and sparc64, don't define MUTEX_CAS() in terms of their own _lock_cas(), which has its own memory barriers; the call sites in kern_mutex.c already have the appropriate memory barrier calls. Thus, alpha and sparc64 can use default definition. - For sh3, don't define MUTEX_CAS() in terms of its own _lock_cas(); atomic_cas_ulong() is strong-aliased to _lock_cas(), therefore defining our own MUTEX_CAS() is redundant. Per thread: https://mail-index.netbsd.org/tech-kern/2021/07/25/msg027562.html
2021-08-17fix multiplei repetitive typos in comments, messages and documentation. ↵andvar
mainly because copy paste code big amount of files are affected.
2021-08-07Merge thorpej-cfargs2.thorpej
2021-07-26Revert rename back to OFSET, since the name follows historical PGOFSET ↵andvar
definition. Noted by tsutsui.
2021-07-24Fix all remaining typos, mainly in comments but also in few definitions and ↵andvar
log messages, reported by me in PR kern/54889. Also fixed some additional typos in comments, found on review of same files or typos.
2021-07-15For cpu_switchto(), inherit PSL_IMASK field of SR between lwp's.rin
Otherwise, IPL is lost during context switch, which allows improper interrupts when, e.g., spin mutexes are hold. With this fix, full ATF is successfully completed on DIAGNOSTIC kernel (with one KASSERT in uvm_map.c, which triggers kern/51254, converted to printf). Thanks uwe@ for review and suggesting optimization. Also thanks ad@ for useful comment, and ryo@ for giving me reference manuals of SH-4!
2021-06-04Sprinkle a few VMSWAP_DEFAULT_PLAINTEXT for architectures where we do notmartin
have any spare cpu cycles to waste (encrypted swap still could be enabled by the admin in /etc/sysctl.conf).
2021-05-31Include "opt_param.h" (ifdef _KERNEL_OPT) everywhere that MSGBUFSIZE issimonb
referenced since some sources include <machine/param.h>.
2021-04-24Merge thorpej-cfargs branch:thorpej
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
2021-02-23introduce DDB_END_CMD and replace more than 20 copies of the samemrg
list of NULLs and 0. idea from rillig@. all touched ports built, several booted.
2020-11-30s/ we we / we /msaitoh
2020-11-21malloc(9) -> kmem(9)thorpej
2020-10-21make process_machdep.c included always since it provides register i/o used bychristos
sys_process_getlwpstatus.c which is always included.
2020-10-20harmonize process_machdep.c inclusion.christos
2020-10-19_KERNEL_OPT policechristos
2020-10-15Add missing 'error' declarationmartin
2020-10-15Fix the machine-dependent ptrace requests to respect LWP numbermgorny
Fix the machine-dependent ptrace register-related requests (e.g. PT_GETXMMREGS, PT_GETXSTATE on x86) to correctly respect the LWP number passed as the data argument. Before this change, these requests did not operate on the requested LWP of a multithreaded program. This change required moving ptrace_update_lwp() out of unit scope, and changing ptrace_machdep_dorequest() function to take a pointer to pointer as the second argument, consistently with ptrace_regs(). I am planning to extend the ATF ptrace() register tests in the future to check for regressions in multithreaded programs, as time permits. Reviewed by kamil.
2020-09-14apply some parens to make macros safe. fixes GCC 9 sanitizer issues.mrg
2020-08-04st40_pmb_dump - factor out.uwe
Print the WT bit as either "WT" or "CB" when C is set, as "--" otherwise. Few other minor tweaks.
2020-08-04Avoid inline RUN_P2 when accessing TLB via memory mapped arrays.uwe
Move code that needs to run from P2 into separate functions and call them via P2 pointer.
2020-08-03sh4_mmu_start - cosmetics.uwe
Split construction of the initial MMUCR value into several assignments for readability. Same object code is generated.