summaryrefslogtreecommitdiff
path: root/sys/arch/sh3/include
AgeCommit message (Collapse)Author
2023-04-28fix few typos and grammar in comments.andvar
2022-07-26s/fucntion/function/ in comments.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-10-29Define __HAVE_STRUCT_SIGCONTEXT regardless of its current visibility.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-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-05-31Include "opt_param.h" (ifdef _KERNEL_OPT) everywhere that MSGBUFSIZE issimonb
referenced since some sources include <machine/param.h>.
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-03SH3_P2SEG_FUNC(f) - get a P2 address of a function.uwe
Just SH3_P1SEG_TO_P2SEG + cast, but we now define SH3_P1SEG_TO_P2SEG and SH3_P2SEG_TO_P1SEG to use arithmetic, not bitwise ops. That gives the same result for the correct P1/P2 input values, but addition can be done at link time with addends. Thus SH3_P2SEG_FUNC compiles to a constant P2 address.
2020-08-03_cpu_exception_suspend - return old SRuwe
In a typical use case we do a very short code sequence with PSL_BL set and restore the old PSL_BL value with _cpu_exception_resume that does the full read/mask/set dance. In reality we are just restoring SR to its old state as no other modifications to SR can possibly happen. So return old SR and let the caller restore it in one instruction.
2020-07-30Publicly declare st40_pmb_init().uwe
2020-07-30ST40_PMB_DA_BITS - all values for the non-continuous size field.uwe
Size field has two reserved bits in the middle. Don't depend on them being zero, they can be defined in future versions. Provide exhaustive list with all possibile "filler" bits in the middle so that we correctly report the size field value regardless of the unrelated bits.
2020-07-30Add snprintb formats. Fix PASCR name.uwe
2020-07-28_LKM -> _MODULEskrll
2020-07-25Define CPU_PRODUCT_STX7105.uwe
I'm not sure if this should rather be named CPU_PRODUCT_ST40_300, but that's probably too general. These constants don't have to be backward compatible, so we can re-do this properly later if we need to.
2020-07-25Definitions for ST40 Privileged Mapping Buffer.uwe
2020-07-11Fix doc comment for sh_clock_init.uwe
Forgot to update it back in 2006 when sh3 ports were converted to todr(9) and its second argument (struct rtc_ops) was removed.
2020-05-01Move machine dependent AUDIO_BLK_MS default value to <machine/param.h>.isaki
If the port has __AUDIO_BLK_MS in <machine/param.h>, it will be used. Otherwise the default value (currently 10 msec) defined in audio.c will be used. This mechanism is for very old ports which cannot satisfactorily handle 10 msec block. Currently hppa, m68k, sh3, sparc(!64) and vax are. For port maintainers, if general models in your port cannot satisfactorily handle 10 msec block, please consider to define your suitable longer period (40 msec would be a good first choice). But please don't be eager to make the default value shorter. <machine/param.h> was discussed in source-changes-d. It's better than ifdef storm, or adding 60+ new header files in every arch/*/include/ directories for this. Thanks mrg@, ad@, and everyone. http://mail-index.netbsd.org/source-changes-d/2020/05/01/msg012572.html
2020-04-30G/C __HAVE_AST_PERPROCskrll
2020-04-17Mark the .ident section as mergable string section to avoid redundantjoerg
entries.
2020-03-14pmap_remove_all(): Return a boolean value to indicate the behaviour. Ifad
true, all mappings have been removed, the pmap is totally cleared out, and UVM can then avoid doing the work to call pmap_remove() for each map entry. If false, either nothing has been done, or some helpful arch-specific voodoo has taken place.
2020-01-07Fix indentation. NFCIskrll
2019-12-27Harmonize the namespace of fast TLS base pointer getter functionskamil
Protect __lwp_getprivate_fast() with _RTLD_SOURCE, _LIBC_SOURCE and __LIBPTHREAD_SOURCE__. Include in this namespace <sys/tcl.h> and use __BEGIN_DECLS/__END_DECLS for the sake of consistency.
2019-12-24Introduce PT_LWPSTATUS + PT_LWPNEXT, obsolete PT_LWPINFOkamil
PT_LWPINFO is a legacy ptrace(2) operation that was originally intended to retrieve the thread (LWP) information inside a traced process. It has a number of flaws and is confused with PT_LWPINFO from FreeBSD. PT_LWPSTATUS and PT_LWPNEXT address the problems (shortly by: rename, removal of pl_event) and introduces new features: signal context (pl_sigpend, pl_sigmask), LWP name (pl_name), LWP TLS base address (pl_private). The private pointer was so far missing information for a debugger. PT_LWPSTATUS@nnn is now shipped with core(5) files and contain LWP specific information, so far missed in the core(5) files. PT_LWPSTATUS retrieves LWP information for the prompted thread. PT_LWPNEXT retrieves LWP information for the next thread, borrowing the semantics from NetBSD specific PT_LWPINFO. PT_LWPINFO is namespaced with __LEGACY_PT_LWPINFO and still available for the foreseeable future, without plans of removing it. Add ATF tests for PT_LWPSTATUS + PT_LWPNEXT. Keep ATF tests for PT_LWPINFO. Switch GDB to new API. Proposed on tech-kern@.
2019-12-01Fix false sharing problems with cpu_info. Identified with tprof(8).ad
This was a very nice win in my tests on a 48 CPU box. - Reorganise cpu_data slightly according to usage. - Put cpu_onproc into struct cpu_info alongside ci_curlwp (now is ci_onproc). - On x86, put some items in their own cache lines according to usage, like the IPI bitmask and ci_want_resched.
2019-12-01sh3: make ASTs work as expected, and fix a few things in the TLB refill path.ad
With help from uwe@ and martin@.
2019-11-30Revert previous. Looks like it requires a more extensive fix.ad
2019-11-29Nix now-unused definitions of MUTEX_GIVE/MUTEX_RECEIVE.riastradh
2019-11-29Nix mb_* on sh3.riastradh
2019-11-29Largely eliminate the MD rwlock.h header file.riastradh
This was full of definitions that have been obsolete for over a decade. The file still remains for __HAVE_RW_STUBS but that's all. Used only internally in kern_rwlock.c now, not by <sys/rwlock.h>.
2019-11-29PR port-sparc/54718 (sparc install hangs since recent scheduler changes)ad
- userret() must be called every time we return to user, it's not optional. - If clearing the AST with interrupts off, you must loop over userret().
2019-11-23cpu_need_resched():ad
- Remove all code that should be MI, leaving the bare minimum under arch/. - Make the required actions very explicit. - Pass in LWP pointer for convenience. - When a trap is required on another CPU, have the IPI set it locally. - Expunge cpu_did_resched().
2019-10-04Provide PTRACE_ILLEGAL_ASM, using an illegal slot instructionmaya
2019-09-23Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all archesskrll
to follow arm and (generic) mips. Reviewed by christos.
2019-06-18Introduce PTRACE_REG_FP() a helper macro to retrieve the frame pointerkamil
The macro is dummy for ia64 (the FP register is unknown and can change freely) and sparc/sparc64 (not stored in struct reg).
2019-05-28s/recieve/receive/msaitoh
2019-05-07Switch all users (except ia64) of custom machine/ansi.h to common_ansi.hkamil
Deduplicate the code among ports and poll definitions of types directly from a compiler. This fixes miscompilation of certain programs that instruct compilers to generate code for different types. This bug has been detected with -fshort-wchar in EFI firmware. Proposed and discussed on a mailing list (twice). Itanium uses custom !ELF fallback switch, temporarily leave it as it is.
2019-04-06Overhaul the API used to fetch and store individual memory cells inthorpej
userspace. The old fetch(9) and store(9) APIs (fubyte(), fuword(), subyte(), suword(), etc.) are retired and replaced with new ufetch(9) and ustore(9) APIs that can return proper error codes, etc. and are implemented consistently across all platforms. The interrupt-safe variants are no longer supported (and several of the existing attempts at fuswintr(), etc. were buggy and not actually interrupt-safe). Also augmement the ucas(9) API, making it consistently available on all plaforms, supporting uniprocessor and multiprocessor systems, even those that do not have CAS or LL/SC primitives. Welcome to NetBSD 8.99.37.
2019-01-21Fix wrong scoping of {U,}LLONG_MAX. More cases, not just amd64.dholland
PR 53298 from Roberto E. Vargas Caballero.
2019-01-08remove <machine/param.h> include, nothing from it is actually used herejdolecek
2019-01-07move DEV_BSIZE, DEV_BSHIFT out of MD param.h, they are same on all portsjdolecek
also move BLKDEV_IOSIZE, MAXPHYS, but allow override since some ports have different value (powerpc uses NBPG for BLKDEV_IOSIZE, sun2/sun3 have lower MAXPHYS)
2018-08-22- Cleanup for dynamic sysctl:msaitoh
- Remove unused *_NAMES macros for sysctl. - Remove unused *_MAXID for sysctls. - Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and use them on all m68k machines.
2018-07-12Remove the kernel PMC code. Sent yesterday on tech-kern@.maxv
This change: * Removes "options PERFCTRS", the associated includes, and the associated ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is good. * Removes the PMC code of ARM XSCALE. * Removes all the pmc.h files. They were all empty, except for ARM XSCALE. * Reorders the x86 PMC code not to rely on the legacy pmc.h file. The definitions are put in sysarch.h. * Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control and sys_pmc_get_info syscalls. They are marked as OBSOL in kern, netbsd32 and rump. * Removes the pmc_evid_t and pmc_ctr_t types. * Removes all the associated man pages. The sets are marked as obsolete.
2018-03-02Introduce sh3/sysarch.h and add SH3_SYNC_ICACHEuwe
2018-02-15Introduce _UC_MACHINE_FP() as a macrokamil
_UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer. Don't rely on this interface as a compiler might strip frame pointer or optimize it making this interface unreliable. For hppa assume a small frame context, for larger frames FP might be located in a different register (4 instead of 3). For ia64 there is no strict frame pointer, and registers might rotate. Reuse 79 following: ./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM LOC_REG (79) Once ia64 will mature, this should be revisited. A macro can encapsulate a real function for extracting Frame Pointer on more complex CPUs / ABIs. For the remaining CPUs, reuse standard register as defined in appropriate ABI. The direct users of this macro are LLVM and GCC with Sanitizers. Proposed on tech-userlevel@. Sponsored by <The NetBSD Foundation>