summaryrefslogtreecommitdiffstats
path: root/sys/i386/svr4
Commit message (Collapse)AuthorAgeFilesLines
* Change some movl's to mov's. Newer GAS no longer accept 'movl' instructionsobrien2009-01-311-1/+1
| | | | | | for moving between a segment register and a 32-bit memory location. Looked at by: jhb
* Since version 4.3, gcc changed its behaviour concerning the i386/amd64kib2008-03-131-2/+2
| | | | | | | | | | | | | | | | | | ABI and the direction flag, that is it now assumes that the direction flag is cleared at the entry of a function and it doesn't clear once more if needed. This new behaviour conforms to the i386/amd64 ABI. Modify the signal handler frame setup code to clear the DF {e,r}flags bit on the amd64/i386 for the signal handlers. jhb@ noted that it might break old apps if they assumed DF == 1 would be preserved in the signal handlers, but that such apps should be rare and that older versions of gcc would not generate such apps. Submitted by: Aurelien Jarno <aurelien aurel32 net> PR: 121422 Reviewed by: jhb MFC after: 2 weeks
* Use svr4_si_{addr,code,errno,signo,trap} in preference to si_{...}.rwatson2005-10-191-36/+36
| | | | | | | | Fix a debugging printf to printf after a variable is first assigned, not before. These are purely build fixes, and need inspection to make sure they were what the original author of the previous changes intended.
* Fix compiling.davidxu2005-10-151-1/+1
|
* 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, mostdavidxu2005-10-141-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes in MD code are trivial, before this change, trapsignal and sendsig use discrete parameters, now they uses member fields of ksiginfo_t structure. For sendsig, this change allows us to pass POSIX realtime signal value to user code. 2. Remove cpu_thread_siginfo, it is no longer needed because we now always generate ksiginfo_t data and feed it to libpthread. 3. Add p_sigqueue to proc structure to hold shared signals which were blocked by all threads in the proc. 4. Add td_sigqueue to thread structure to hold all signals delivered to thread. 5. i386 and amd64 now return POSIX standard si_code, other arches will be fixed. 6. In this sigqueue implementation, pending signal set is kept as before, an extra siginfo list holds additional siginfo_t data for signals. kernel code uses psignal() still behavior as before, it won't be failed even under memory pressure, only exception is when deleting a signal, we should call sigqueue_delete to remove signal from sigqueue but not SIGDELSET. Current there is no kernel code will deliver a signal with additional data, so kernel should be as stable as before, a ksiginfo can carry more information, for example, allow signal to be delivered but throw away siginfo data if memory is not enough. SIGKILL and SIGSTOP have fast path in sigqueue_add, because they can not be caught or masked. The sigqueue() syscall allows user code to queue a signal to target process, if resource is unavailable, EAGAIN will be returned as specification said. Just before thread exits, signal queue memory will be freed by sigqueue_flush. Current, all signals are allowed to be queued, not only realtime signals. Earlier patch reviewed by: jhb, deischen Tested on: i386, amd64
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-062-2/+2
|
* Attempt to make the proper changes here for the proc.h commit:obrien2004-01-051-5/+5
| | | | | | | | | | | | | | Make sigaltstack as per-threaded, because per-process sigaltstack state is useless for threaded programs, multiple threads can not share same stack. The alternative signal stack is private for thread, no lock is needed, the orignal P_ALTSTACK is now moved into td_pflags and renamed to TDP_ALTSTACK. For single thread or Linux clone() based threaded program, there is no semantic changed, because those programs only have one kernel thread in every process. which left out SVR4 bits.
* Use __FBSDID().obrien2003-06-102-3/+5
|
* - Merge struct procsig with struct sigacts.jhb2003-05-131-0/+3
| | | | | | | | | | | | | | | | | - Move struct sigacts out of the u-area and malloc() it using the M_SUBPROC malloc bucket. - Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(), sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared(). - Remove the p_sigignore, p_sigacts, and p_sigcatch macros. - Add a mutex to struct sigacts that protects all the members of the struct. - Add sigacts locking. - Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now that sigacts is locked. - Several in-kernel functions such as psignal(), tdsignal(), trapsignal(), and thread_stopped() are now MP safe. Reviewed by: arch@ Approved by: re (rwatson)
* Assembly files put thru the C preprocessor need to have C style comments.obrien2003-04-211-3/+2
|
* Add some missing proc mutex unlocks.jhb2003-04-171-2/+6
|
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withjeff2003-03-311-2/+2
| | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
* SCARGS removal take II.alfred2002-12-141-3/+3
|
* Backout removal SCARGS, the code freeze is only "selectively" over.alfred2002-12-131-3/+3
|
* Remove SCARGS.alfred2002-12-131-3/+3
| | | | Reviewed by: md5
* Include <sys/systm.h> for the definition of offsetof() instead of dependingbde2002-09-051-0/+1
| | | | | on the definition being misplaced in <sys/types.h>. The definition probably belongs in <sys/stddef.h>.
* Moved signal handling and rescheduling from userret() to ast() so thatbde2002-04-041-0/+1
| | | | | | | | | | | they aren't in the usual path of execution for syscalls and traps. The main complication for this is that we have to set flags to control ast() everywhere that changes the signal mask. Avoid locking in userret() in most of the remaining cases. Submitted by: luoqi (first part only, long ago, reorganized by me) Reminded by: dillon
* Remove __P.alfred2002-03-202-4/+3
|
* Clear the single-step flag for signal handlers. This fixes bogus tracebde2002-01-101-0/+1
| | | | | | | | | | | | | | | | traps on the first instruction of signal handlers. In trap.c:syscall(), fake a trace trap if the single-step flag was set on entry to the kernel, not if it will be set on exit from the kernel. This fixes bogus trace traps after the last instruction of signal handlers. gdb-4.18 (the version in FreeBSD) still has problems with the program in the PR. These seem to be due to bugs in gdb and not in FreeBSD, and are fixed in gdb-5.1 (the distribution version). PR: 33262 Tested by: k Macy <kip_macy@yahoo.com> MFC after: 1 day
* If we have a p variable pointing to td->td_proc already, use it instead ofjhb2001-09-181-8/+8
| | | | | | needlessly repeating the indirection in several places. Half of the places used td->td_proc, and half used p. They are now consistent with each other and all use p.
* KSE Milestone 2julian2001-09-122-30/+33
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Call sendsig() with the proc lock held and return with it held.jhb2001-09-061-1/+2
|
* Add a new MI pointer to the process' trapframe p_frame instead of usingjhb2001-06-291-3/+3
| | | | | | various differently named pointers buried under p_md. Reviewed by: jake (in principle)
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-4/+6
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Grab the process lock while calling psignal and before calling psignal.jhb2001-03-071-0/+1
|
* Remove the leading underscore from all symbols defined in x86 asmjake2001-02-251-4/+4
| | | | | | | | | | | and used in C or vice versa. The elf compiler uses the same names for both. Remove asnames.h with great prejudice; it has served its purpose. Note that this does not affect the ability to generate an aout kernel due to gcc's -mno-underscores option. moral support from: peter, jhb
* Activate USER_LDT by default. The new thread libraries are going topeter2001-02-231-2/+3
| | | | | | | | depend on this. The linux ABI emulator tries to use it for some linux binaries too. VM86 had a bigger cost than this and it was made default a while ago. Reviewed by: jhb, imp
* - Proc locking.jhb2001-01-241-5/+26
| | | | | - Use FreeBSD stackgap_init() semantics. - Adjust some #ifdef's to hide unused variables.
* Don't use p->p_sigstk.ss_flags to keep state of whether themarcel2000-11-301-1/+1
| | | | | | | | | | | | | | | process is on the alternate stack or not. For compatibility with sigstack(2) state is being updated if such is needed. We now determine whether the process is on the alternate stack by looking at its stack pointer. This allows a process to siglongjmp from a signal handler on the alternate stack to the place of the sigsetjmp on the normal stack. When maintaining state, this would have invalidated the state information and causing a subsequent signal to be delivered on the normal stack instead of the alternate stack. PR: 22286
* Remove unneeded <stddef.h> #includes.phk2000-10-291-2/+0
|
* Cleanup after repo copy of sys/svr4 to sys/compat/svr4.obrien2000-08-314-10/+10
|
* AT&T asm syntax requires a leading '*' in front of the operand for indirectobrien2000-05-101-1/+1
| | | | calls and jumps.
* Pre-freeze cleanups: Conditionalize debugging writes on DEBUG_SVR4,newton2000-01-151-11/+32
| | | | | | | | | | | | | | | | | | | | | | | | | eliminate warnings, etc. Note that svr4_setcontext() and svr4_getcontext() currently don't work correctly, which makes returning from signal handlers somewhat problematic (for reference: the SysVR4 setcontext() and getcontext() syscalls behave like a low-level version of setjmp() and longjmp(), in that they save and restore process context. SysVR4 uses this to implement its signal handler trampoline: The context which is saved before a signal handler is called is restored by an implicit call to the setcontext() syscall when the signal handler returns. That currently doesn't work right in this emulator, although it used to). I'm committing this anyway, with a caveat that it's buggy, so that I can (a) note the bug for anyone who is wondering about it, and (b) get the stuff I've done to improve (but not fix) the situation in the tree before 4.0 is released. If I have time to fix it totally RSN I'll talk to Jordan to see if I can bend him into letting me commit a bugfix :-) Note that the situation now is somewhat better than it was yesterday anyway, because I've fixed the handling of svr4_sigsets which previously was causing signal handlers to not get called at all. Stay tuned for an upcoming commit to svr4_signal.c...
* Include #warning about unconditionalizing VM86, which isn't supposed to worknewton2000-01-151-0/+1
| | | | in the svr4 emulator yet.
* Fixed a missing forward declaration. I don't know why I though thebde2000-01-091-0/+1
| | | | | declaration of `struct proc' in svr4_genassym.c was unused. It was just misplaced.
* Include <stddef.h> here so that <sys/assym.h> can be unpolluted.bde2000-01-081-4/+3
| | | | | | | Include <sys/param.h> before <sys/assym.h> in case any of the magic in the former is ever needed in the latter. Removed an unused forward declaration and an unused include.
* Unbreak LINT -- typedefs from signal.h are needed to make prototypes innewton2000-01-051-0/+1
| | | | this file make sense.
* Make offsetof equivalent with <stddef.h>. This paves the way formarcel2000-01-031-5/+8
| | | | | | further enhancements/reorganisations. Discussed with: bde
* Use genassym(1) and <sys/assym.h> to generate assembler symbols.marcel1999-12-231-20/+6
|
* Remove unnecessary includesnewton1999-12-081-12/+0
| | | | Prodded by: phk
* useracc() the prequel:phk1999-10-291-1/+0
| | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument.
* Add a per-signal flag to mark handlers registered with osigaction, so weluoqi1999-10-112-16/+13
| | | | | | | | | | | | | | | can provide the correct context to each signal handler. Fix broken sigsuspend(): don't use p_oldsigmask as a flag, use SAS_OLDMASK as we did before the linuxthreads support merge (submitted by bde). Move ps_sigstk from to p_sigacts to the main proc structure since signal stack should not be shared among threads. Move SAS_OLDMASK and SAS_ALTSTACK flags from sigacts::ps_flags to proc::p_flag. Move PS_NOCLDSTOP and PS_NOCLDWAIT flags from proc::p_flag to procsig::ps_flag. Reviewed by: marcel, jdp, bde
* sigset_t change (part 4 of 5)marcel1999-09-292-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- The compatibility code and/or emulators have been updated: iBCS2 now mostly uses the older syscalls. SVR4 now properly handles all signals. This has been achieved by using the new sigset_t throughout the emulator. The Linuxulator has been severely updated. Internally the new Linux sigset_t is made the default. These are then mapped to and from the new FreeBSD sigset_t. Also, rt_sigsuspend has been implemented in the Linuxulator. Implementing this syscall basicly caused all this sigset_t changing in the first place and the syscall has been used throughout the change as a means for testing. It basicly is too much work to undo the implementation so that it can later be added again. A special note on the use of sv_sigtbl and sv_sigsize in struct sysentvec: Every signal larger than sv_sigsize is not translated and is passed on to the signal handler unmodified. Signals in the range 1 upto and including sv_sigsize are translated. The rationale is that only the system defined signals need to be translated. The emulators also have been updated so that the translation tables are only indexed for valid (system defined) signals. This change also fixes the translation bug already in the SVR4 emulator.
* $Id$ -> $FreeBSD$peter1999-08-284-4/+4
|
* Replace ".align 2" with "ALIGN_TEXT" as per recent discussion re: the linuxnewton1999-08-251-2/+2
| | | | | | emulator. Suggested by: bde
* Add $Id$ tags.newton1999-07-303-12/+10
| | | | Clean-up some unused (or to-be-used) variables in svr4_getcontext()
* Back out last commit (did I get all of them?)newton1999-06-022-0/+6
| | | | Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
* Unifdef VM86.jlemon1999-06-012-6/+0
| | | | Reviewed by: silence on on -current
* Enable vmspace sharing on SMP. Major changes are,luoqi1999-04-282-2/+13
| | | | | | | | | | | | | | | | | - %fs register is added to trapframe and saved/restored upon kernel entry/exit. - Per-cpu pages are no longer mapped at the same virtual address. - Each cpu now has a separate gdt selector table. A new segment selector is added to point to per-cpu pages, per-cpu global variables are now accessed through this new selector (%fs). The selectors in gdt table are rearranged for cache line optimization. - fask_vfork is now on as default for both UP and SMP. - Some aio code cleanup. Reviewed by: Alan Cox <alc@cs.rice.edu> John Dyson <dyson@iquest.net> Julian Elischer <julian@whistel.com> Bruce Evans <bde@zeta.org.au> David Greenman <dg@root.com>
* Restore support for executing BSD/OS binaries on the i386 by passingjdp1999-04-031-1/+1
| | | | | | | | the address of the ps_strings structure to the process via %ebx. For other kinds of binaries, %ebx is still zeroed as before. Submitted by: Thomas Stephens <tas@stephens.org> Reviewed by: jdp
OpenPOWER on IntegriCloud