summaryrefslogtreecommitdiffstats
path: root/sys/arch/sh (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused scheduler related definitions.mpi2019-06-111-3/+1
| | | | ok visa@
* Add movstrSI12_i4 for linking -Os/-Oz kernels. Sadly however itderaadt2019-04-251-2/+2
| | | | fails and locks early in boot.
* Add intr_{disable,restore}() for sh.visa2019-03-241-1/+13
| | | | Reminded by deraadt@
* sprinle some casts to quiet compiler; ok millertderaadt2019-02-171-3/+3
|
* Add END() macro to set symbol size like every other archguenther2018-11-111-1/+3
| | | | ok deraadt@
* Provide an MD 64-bit byteswapping function build on 32-bit swapsnaddy2018-10-051-2/+11
| | | | | | | | | | | | | as we do on arm and i386. Copied from arm. If there are no MD byteswapping functions, MI macros are used. These are wrapped by static inline functions to prevent multiple evaluation of their argument. If there are MD functions, they are used directly and therefore we must implicitly guarantee that they are safe from multiple evaluation. Defining an MD function to an MI macro breaks this promise. ok deraadt@
* Unify the MD byteswapping code as much as possible across architectures.naddy2018-10-021-21/+26
| | | | | | | Use inline functions instead of GNU C statement expressions, and make them available to userland. With clues from guenther@. ok guenther@ kettenis@
* Unify and bump some of the NMBCLUSTERS defines. Some archs had it set toclaudio2018-09-141-2/+2
| | | | | | | | | 4MB which is far too low especially when the platform is able to run MP. New limits are, amd64 = 256M; arm64, mips64, sparc64 = 64M; alpha, arm, hppa, i386, powerpc = 32M; m88k, sh = 8M Still rather conservative numbers but much better than before. At least some hangs of arm64 build boxes was caused by this. OK kettenis@, visa@
* Move from sendsig() to its callers the initsiginfo() calls andguenther2018-07-101-4/+3
| | | | | | | | instead of passing sendsig() the code+type+val, pass a siginfo_t* to copy from. Eliminate the indirection through struct emul for sendsig(); we no longer have a SunOS4-compat version of sendsig() ok deraadt@
* Implement MAP_STACK option for mmap(). Synchronous faults (pagefault andderaadt2018-04-121-3/+3
| | | | | | | | | | | | | | syscall) confirm the stack register points at MAP_STACK memory, otherwise SIGSEGV is delivered. sigaltstack() and pthread_attr_setstack() are modified to create a MAP_STACK sub-region which satisfies alignment requirements. Observe that MAP_STACK can only be set/cleared by mmap(), which zeroes the contents of the region -- there is no mprotect() equivalent operation, so there is no MAP_STACK-adding gadget. This opportunistic software-emulation of a stack protection bit makes stack-pivot operations during ROPchain fragile (kind of like removing a tool from the toolbox). original discussion with tedu, uvm work by stefan, testing by mortimer ok kettenis
* Do not panic from ddb(4) when a lock requirement isn't fulfilled.mpi2018-03-201-3/+1
| | | | | | | | | | | Extend the logic already present for panic() to any DDB-related operation such that if ddb(4) is entered because of a fault or other trap it is still possible to call 'boot reboot'. While here stop printing splassert() messages as well, to not fill the buffer. ok visa@, deraadt@
* #define _MAX_PAGE_SHIFT in MD _types.h as the maximum pagesize an archderaadt2018-03-051-1/+2
| | | | | | | | | | needs (looking at you sgi, but others required this before). This is for the circumstances we need pagesize known at compile time, not getpagesize() runtime. Use it for malloc storage sizes, for shm, and to set pthread stack default sizes. The stack sizes were a mess, and pushing them towards page-aligned is healthy move (which will also be needed by the coming stack register checker) ok guenther kettenis, discussion with stefan
* Remove almost unused `flags' argument of suser().mpi2018-02-192-5/+5
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* Move landisk to MI mutex.mpi2018-02-113-150/+3
| | | | ok dlg@
* Delete unnecessary <sys/file.h> includesguenther2017-12-301-2/+1
| | | | ok millert@ krw@
* fcntl(F_SETFL) invokes the FIONBIO and FIOASYNC ioctls internally, soguenther2017-12-141-1/+9
| | | | | | | the memory devices (/dev/null, /dev/zero, etc) need to permit them. problem noted, tweak, and testing by jeremy@ ok deraadt@
* use %lx to print the frame address if resolving of the symbol name failsjasper2017-11-031-2/+6
| | | | as discussed with and ok mpi@
* Move mutex, condvar, and thread-specific data routes, pthread_once, andguenther2017-09-051-5/+1
| | | | | | | | pthread_exit from libpthread to libc, along with low-level bits to support them. Major bump to both libc and libpthread. Requested by libressl team. Ports testing by naddy@ ok kettenis@
* Fix typo in comments: s/return/returns/ in "a function that never return."tom2017-08-171-2/+2
|
* kill RCSID macros; discussed with millertderaadt2017-06-291-4/+1
|
* Unbreak profiling assembly functions in userland by defining thempi2017-06-231-2/+2
| | | | | | correct prologue if compiled with -DPROF. ok deraadt@
* Fix the remaining ';;'s in sys/tom2017-06-221-2/+2
|
* Kill db_sym_t.mpi2017-05-302-4/+4
| | | | ok deraadt@, kettenis@, jasper@
* Fix kernel build on armv7 and sh.visa2017-05-182-4/+4
| | | | Pointed out by deraadt@
* Rename Debugger() into db_enter().mpi2017-04-302-4/+4
| | | | | | | Using a name with the 'db_' prefix makes it invisible from the dynamic profiler. ok deraadt@, kettenis@, visa@
* Hook up mutex(9) to witness(4).visa2017-04-202-8/+9
|
* Provide mips64 with kernel-facing TCB_{GET,SET} macros that store itguenther2017-04-131-3/+1
| | | | | | | in struct mdproc. With that, all archs have those and the __HAVE_MD_TCB macro can be unifdef'ed as always defined. ok kettenis@ visa@ jsing@
* Split up fork1():guenther2017-02-121-15/+14
| | | | | | | | | | | | | | | | | - FORK_THREAD handling is a totally separate function, thread_fork(), that is only used by sys___tfork() and which loses the flags, func, arg, and newprocp parameters and gains tcb parameter to guarantee the new thread's TCB is set before the creating thread returns - fork1() loses its stack and tidptr parameters Common bits factor out: - struct proc allocation and initialization moves to thread_new() - maxthread handling moves to fork_check_maxthread() - setting the new thread running moves to fork_thread_start() The MD cpu_fork() function swaps its unused stacksize parameter for a tcb parameter. luna88k testing by aoyama@, alpha testing by dlg@ ok mpi@
* In exec_elf.c: expand ELFNAME(), ELFNAME2(), and ELFNAMEEND() exceptguenther2017-02-081-3/+1
| | | | | | | | | | | | | | | | | | | | | | leaving out the size, so that ELFNAME2(exec,makecmds) becomes exec_elf_makecmds instead of exec_elf{32,64}_makecmds and then delete the ELFNAME2() and ELFNAMEEND() macros. Move the prototypes for functions local to exec_elf.c to there from exec_elf.h. Simplify the SMALL_KERNEL conditionals around the ELF coredump code. Change exec_conf.c to use the size-generic names and macros Remove exec_elf{32,64}.c and just build exec_elf.c; delete the _KERN_DO_ELF and _KERN_DO_ELF64 #defines. ok jca@, encouragement from deraadt@ and tom@
* p_comm is the process's command and isn't per thread, so move it fromguenther2017-01-212-11/+6
| | | | | | struct proc to struct process. ok deraadt@ kettenis@
* Change pmap_proc_iflush() to take a process instead of a procguenther2016-10-191-2/+2
| | | | | | powerpc: rename second argument of pmap_proc_iflush() to match other archs ok kettenis@
* struct process has a pointer to the vmspace now, so simplify the ASID searchguenther2016-10-191-10/+4
| | | | ok deraadt@ jca@
* Various printf claim to report the PID, so actually report that and not the TIDguenther2016-10-081-2/+2
| | | | Build testing assistance from deraadt@
* Make a move towards ending 4 decades of kernel snooping.deraadt2016-09-251-2/+6
| | | | | | | | | | | | | | | Add sysctl kern.allowkmem (default 0) which controls the ability to open /dev/mem or /dev/kmem at securelevel > 0. Over 15 years we converted 99% of utilities in the tree to operate on sysctl-nodes (either by themselves or via code hiding in the guts of -lkvm). pstat -d and -v & procmap are affected and continued use of them will require kern.allowkmem=1 in /etc/sysctl.conf. acpidump (and it's buddy sendbug) are affected, but we'll work out a solution soon. There will be some impact in ports. ok kettenis guenther
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-6/+4
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* Increase the number of mbufs on most architectures. This is basedbluhm2016-09-031-2/+2
| | | | | | | on a guess how much memory a typical machine has. If the value is too high, users may run out of kernel memory. Then we will have to adjust this again. OK claudio@ deraadt@
* remove #define for /dev/mem minors. let the raw magic of the hardcodedtedu2016-08-161-14/+10
| | | | numbers serve as a warning not to touch them.
* normalize some commentstedu2016-08-151-6/+1
|
* consistently set ipls on pmap pools.dlg2016-06-071-3/+5
| | | | | | this is a step toward making ipls unconditionaly on pools. ok deraadt@ kettenis@
* Remove the non ELF macrosderaadt2016-05-272-32/+3
| | | | ok millert
* Place a cpu-dependent trap/illegal instruction over the remainder of thederaadt2016-05-231-1/+13
| | | | | | | | | sigtramp page, so that it will generate a nice kernel fault if touched. While here, move most of the sigtramps to the .rodata segment, because they are not executed in the kernel. Also some preparation for sliding the actual sigtramp forward (will need some gdb changes) ok mlarkin kettenis
* hand-massage sendsig() and sys_sigreturn() to be much more similar.deraadt2016-05-211-17/+11
| | | | ok guenther kettenis
* Save and restore 'gbr' register when enter/leaving the kernel, and useguenther2016-05-186-7/+32
| | | | | | it for the TCB pointer. Eliminate __cerror. "looks good" kettenis@, testing and ok deraadt@
* delete SROP mitigation debug code; it worksderaadt2016-05-111-2/+1
|
* SROP mitigation. sendsig() stores a (per-process ^ &sigcontext) cookiederaadt2016-05-103-13/+32
| | | | | | | | inside the sigcontext. sigreturn(2) checks syscall entry was from the exact PC addr in the (per-process ASLR) sigtramp, verifies the cookie, and clears it to prevent sigcontext reuse. not yet tested on landisk, sparc, *88k, socppc. ok kettenis
* G/C DDB_REGS.mpi2016-04-271-2/+1
|
* Sync no-argument function declaration and definition by adding (void).tobiasu2016-03-0510-35/+35
| | | | | | Covers all of landisk/sh, per naddy's suggestion. ok on previous diff deraadt@ naddy@
* Rename kdb_trap() into db_ktrap().mpi2016-02-273-7/+7
| | | | | | | | The goal is to include it in the list of functions that must not be instrumented. All ddb(8) functions should be in this list and have their names start with 'db_'. ok visa@, deraadt@
* Make alpha and sh 2038-safe. Now that we have 64-bit time_t, we don'tmmcc2016-02-261-2/+2
| | | | | | | need to ignore the hardware clock when it reports a year > 2037. Irony noted. both ok millert, alpha ok deraadt
* intr_barrier for sh/landisk; tobiasu noticed the need as wellderaadt2016-01-152-2/+9
|