summaryrefslogtreecommitdiff
path: root/sys/arch/m68k/include
AgeCommit message (Collapse)Author
2023-01-29fix typomlelstv
2023-01-27Use proper uintNN_t integer types.tsutsui
2022-05-18fix typos in word "access" and it derivatives, mainly in comments.andvar
2022-02-13m68k: __cpu_simple_unlock audit.riastradh
- Use `cc' clobbers in asm volatile because they touch the condition codes. - Use `memory' clobbers in asm volatile so the compiler doesn't move up loads and stores in the critical section at _other_ addresses than the lock so they happen before __cpu_simple_lock or __cpu_simple_lock_try. - Not sure if we have any (or if there even are any?) multicore m68k systems out there, but __cpu_simple_unlock needs __insn_barrier either way so the compiler doesn't delay loads and stores prior to __cpu_simple_unlock so they happen after it.
2021-12-05s/from from/from/ in comment.msaitoh
2021-12-05s/expecially/especially/ in comment.msaitoh
2021-10-29Define __HAVE_STRUCT_SIGCONTEXT regardless of its current visibility.thorpej
2021-10-27Make sigcontext13 visible only to _KERNEL.thorpej
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-09-19fix various typos in comments, messages and documentation.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-05-31Include "opt_param.h" (ifdef _KERNEL_OPT) everywhere that MSGBUFSIZE issimonb
referenced since some sources include <machine/param.h>.
2021-03-24s/depreciated/deprecated/gsimonb
2020-12-20Support __HAVE_PMAP_PV_TRACK in sys/uvm/pmap based pmaps (aka common pmap)skrll
2020-12-06Don't expose register_tchristos
2020-10-04Add missing __{BEGIN,END}_DECLS in order to catch up withrin
sanitizer_linux_libcdep.cc rev 1.17: http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc#rev1.17 Fix build with HAVE_GCC=9.
2020-09-07move the __packed attribute from struct frame::F_t into the singlemrg
unaligned member inside. CTASSERT() the size is unchanged. with this, sun3 and GCC 9 appears to work.
2020-09-07pass a pointer conversion via uintptr_t *and* the desired type casts.mrg
avoids new GCC 9 warnings with C++ code.
2020-08-07Provide a pmap_segtab_deactivate for symmetry with pmap_segtab_activateskrll
and use it in pmap_deactivate Call pmap_md_xtab_{,de}activate from pmap_segtab_{,de}activate to be used for PMAP_HWPAGEWALKER and any caches ops that might be required. Provide empty (for now) pmap_md_xtab_{,de}activate functions on the platforms that use sys/uvm/pmap
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-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-03-08Remove mutex stubs for 68010 that merely fall back to C codes, andrin
do not work with kern_mutex.c rev 1.85 and later: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_mutex.c#rev1.85 http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_mutex.c#rev1.86 Fix sun2 kernel freeze during early boot stage in mutex_exit(9).
2020-02-01Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).tsutsui
Background: - All m68k ports have fixed PAGE_SIZE value in their kernels, but each port uses different PAGE_SIZE value (4096 or 8192) due to historical reasons. - Currently module(7) binaries are built per each port so all m68k kernel sources don't support run-time variable PAGE_SIZE. - MI <uvm/uvm_param.h> assumes that the port supports a variable PAGE_SIZE on module(7) builds if both MAX_PAGE_SIZE and MIN_PAGE_SIZE are defined and they have different values. - On the other hand, jemalloc(3) checks MAX_PAGE_SHIFT in src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h for internal optimization. - m68k ports share userland binaries (especially pkgsrc binaries) among all ports, so we need to define MAX_PAGE_SHIFT as 13 to support m68k ports where PAGE_SIZE==8192. (though this would affect only if static binaries built on 4k page hosts are executed on 8k page hosts) To solve these inconsistency on PAGE_SIZE definitions, we should have an independent PAGE_SIZE related definitions for userland, but it requires major reorganization. For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and PAGE_SHIFT values in <m68k/vmparam.h> only in !defined(_KERNEL) case. Discussed on source-changes-d@ and tech-kern@ with christos@ and thorpej@: https://mail-index.netbsd.org/source-changes-d/2020/01/thread1.html#012035 https://mail-index.netbsd.org/tech-kern/2020/01/thread1.html#025954 Should be pulled up to netbsd-9.
2020-02-01Use "__nothing" macro defined in <sys/cdefs.h> for empty pmap_update().tsutsui
Suggested by pgoyette@ in PR/54869.
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-11-29Nix now-unused definitions of MUTEX_GIVE/MUTEX_RECEIVE.riastradh
2019-11-29Nix mb_* on m68k.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-10-27Expose register difinitions for _STANDALONE.rin
Fix build failure in arch/luna68k/stand/boot.
2019-10-26disable -Wshadow because in c99 mode these get marked as builtins.christos
2019-10-26Hide the register definitions that should eventually be removed (or prefixedchristos
with _REG_ with #ifdef _KERNEL. This avoids conflicts with let's say PC in <termcap.h>.
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-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-03-14G/C "MAPPECOPY". It is the deadest of wood, and never actually worked inthorpej
NetBSD.
2019-02-18Refactor the 68040 writeback() from each m68k port's trap handler into athorpej
shared copy: m68040_writeback(). It is essentially a copy of the Atari version, with some minor cosmetic tweaks and one small performance optimization from the mvme68k port. Tested by rjs@ on a Quadra 950. (Thanks!)
2019-01-21Fix wrong scoping of {U,}LLONG_MAX. More cases, not just amd64.dholland
PR 53298 from Roberto E. Vargas Caballero.
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-12-19Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,maxv
but also as discussed several times in the past.
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-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>
2017-11-06Cleanup and clarify the ELFSIZE mess:christos
We now have 2 variables automatically set in elf_machdep.h: ARCH_ELFSIZE: the size for userland binaries KERN_ELFSIZE: the size for the kernel binaries DB_ELFSIZE has been deleted and KERN_ELFSIZE should have always the same values DB_ELFSIZE used to have. In sys/exec_elf.h, if ELFSIZE is not set, it is set to KERN_ELFSIZE for the kernel and ARCH_ELFSIZE for userland. These defaults should eliminate the need for most manual ELFSIZE setting.
2017-11-05The XXX comment (do not pull in the uvm headers) might have been a nice ideachristos
at the time, but now all other db_machdep files do this, so we follow suit.
2017-09-17more const.christos
2017-09-13The __fgetenv() macro operates on a fenv_t, not on a fenv_t *.phx
Fixes a segfault in fegetenv() and feholdexcept().
2017-07-02remove f_pad, conflicts with new <sys/file.h> define.christos
2017-04-12Add new macro PTRACE_BREAKPOINT_ASM in <sys/ptrace.h> MD partkamil
This macro ships with a MD-specific assembly instruction triggering a software breakpoint. Missing instruction for powerpc targets. This code is used in ATF tests (lib/libc/sys/t_ptrace_wait). Original patch by Nick Hudson, thanks!
2017-04-08Add new ptrace(2) API: PT_SETSTEP & PT_CLEARSTEPkamil
These operations allow to mark thread as a single-stepping one. This allows to i.a.: - single step and emit a signal (PT_SETSTEP & PT_CONTINUE) - single step and trace syscall entry and exit (PT_SETSTEP & PT_SYSCALL) The former is useful for debuggers like GDB or LLDB. The latter can be used to singlestep a usermode kernel. These examples don't limit use-cases of this interface. Define PT_*STEP only for platforms defining PT_STEP. Add new ATF tests setstep[1234]. These ptrace(2) operations first appeared in FreeBSD. Sponsored by <The NetBSD Foundation>