History log of /freebsd-10.0-release/sys/i386/svr4/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


187948 31-Jan-2009 obrien

Change some movl's to mov's. Newer GAS no longer accept 'movl' instructions
for moving between a segment register and a 32-bit memory location.

Looked at by: jhb


177145 13-Mar-2008 kib

Since version 4.3, gcc changed its behaviour concerning the i386/amd64
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


151467 19-Oct-2005 rwatson

Use svr4_si_{addr,code,errno,signo,trap} in preference to si_{...}.

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.


151366 15-Oct-2005 davidxu

Fix compiling.


151316 14-Oct-2005 davidxu

1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, most
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


139790 06-Jan-2005 imp

/* -> /*- for copyright notices, minor format tweaks as necessary


124141 05-Jan-2004 obrien

Attempt to make the proper changes here for the proc.h commit:

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.


116145 10-Jun-2003 obrien

Use __FBSDID().


114983 13-May-2003 jhb

- Merge struct procsig with struct sigacts.
- 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)


113800 21-Apr-2003 obrien

Assembly files put thru the C preprocessor need to have C style comments.


113623 17-Apr-2003 jhb

Add some missing proc mutex unlocks.


112888 31-Mar-2003 jeff

- Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with
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.


107849 14-Dec-2002 alfred

SCARGS removal take II.


107839 13-Dec-2002 alfred

Backout removal SCARGS, the code freeze is only "selectively" over.


107838 13-Dec-2002 alfred

Remove SCARGS.

Reviewed by: md5


102965 05-Sep-2002 bde

Include <sys/systm.h> for the definition of offsetof() instead of depending
on the definition being misplaced in <sys/types.h>. The definition probably
belongs in <sys/stddef.h>.


93793 04-Apr-2002 bde

Moved signal handling and rescheduling from userret() to ast() so that
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


92765 20-Mar-2002 alfred

Remove __P.


89195 10-Jan-2002 bde

Clear the single-step flag for signal handlers. This fixes bogus trace
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


83641 18-Sep-2001 jhb

If we have a p variable pointing to td->td_proc already, use it instead of
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.


83366 12-Sep-2001 julian

KSE Milestone 2
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


83163 06-Sep-2001 jhb

Call sendsig() with the proc lock held and return with it held.


78962 29-Jun-2001 jhb

Add a new MI pointer to the process' trapframe p_frame instead of using
various differently named pointers buried under p_md.

Reviewed by: jake (in principle)


76166 01-May-2001 markm

Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
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)


73929 07-Mar-2001 jhb

Grab the process lock while calling psignal and before calling psignal.


73011 25-Feb-2001 jake

Remove the leading underscore from all symbols defined in x86 asm
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


72930 23-Feb-2001 peter

Activate USER_LDT by default. The new thread libraries are going to
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


71495 24-Jan-2001 jhb

- Proc locking.
- Use FreeBSD stackgap_init() semantics.
- Adjust some #ifdef's to hide unused variables.


69379 30-Nov-2000 marcel

Don't use p->p_sigstk.ss_flags to keep state of whether the
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


67899 29-Oct-2000 phk

Remove unneeded <stddef.h> #includes.


65302 31-Aug-2000 obrien

Cleanup after repo copy of sys/svr4 to sys/compat/svr4.


60302 10-May-2000 obrien

AT&T asm syntax requires a leading '*' in front of the operand for indirect
calls and jumps.


56044 15-Jan-2000 newton

Pre-freeze cleanups: Conditionalize debugging writes on DEBUG_SVR4,
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...


56042 15-Jan-2000 newton

Include #warning about unconditionalizing VM86, which isn't supposed to work
in the svr4 emulator yet.


55651 09-Jan-2000 bde

Fixed a missing forward declaration. I don't know why I though the
declaration of `struct proc' in svr4_genassym.c was unused. It was
just misplaced.


55627 08-Jan-2000 bde

Include <stddef.h> here so that <sys/assym.h> can be unpolluted.

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.


55484 05-Jan-2000 newton

Unbreak LINT -- typedefs from signal.h are needed to make prototypes in
this file make sense.


55343 03-Jan-2000 marcel

Make offsetof equivalent with <stddef.h>. This paves the way for
further enhancements/reorganisations.

Discussed with: bde


55063 23-Dec-1999 marcel

Use genassym(1) and <sys/assym.h> to generate assembler symbols.


54305 08-Dec-1999 newton

Remove unnecessary includes

Prodded by: phk


52635 29-Oct-1999 phk

useracc() the prequel:

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.


52140 11-Oct-1999 luoqi

Add a per-signal flag to mark handlers registered with osigaction, so we
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


51793 29-Sep-1999 marcel

sigset_t change (part 4 of 5)
-----------------------------

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.


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


50377 25-Aug-1999 newton

Replace ".align 2" with "ALIGN_TEXT" as per recent discussion re: the linux
emulator.

Suggested by: bde


49270 30-Jul-1999 newton

Add $Id$ tags.
Clean-up some unused (or to-be-used) variables in svr4_getcontext()


47694 02-Jun-1999 newton

Back out last commit (did I get all of them?)

Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>


47678 01-Jun-1999 jlemon

Unifdef VM86.

Reviewed by: silence on on -current


46129 28-Apr-1999 luoqi

Enable vmspace sharing on SMP. Major changes are,
- %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>


45270 03-Apr-1999 jdp

Restore support for executing BSD/OS binaries on the i386 by passing
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


44270 25-Feb-1999 newton

Integrated a patch provided by Guido to more correctly work out the
flags returned from getcontext().

Submitted by: Guido van Rooij <guido@gvr.org>


43706 06-Feb-1999 bde

Added underscores to some names in svr4_locore.s so that it compiles
with -aout. Added translation back to elf names in asnames.h as
usual. The elf names were inconsistent in the aout case even
internally because a macro adds an underscore to just one of them.

Removed commented out code for a previous life of `svr4_esigcode'.
Didn't add an underscore to `svr4_esigcode' since it is correct for
aout although wrong for elf, like most internal names in assembler
files. These names should be in a different namespace so that gprof
can ignore them.

Fixed some disorder in asnames.h.


43412 30-Jan-1999 newton

Emulator KLD for SysVR4 executables grabbed from NetBSD.
See http://www.freebsd.org/~newton/freebsd-svr4 for limitations,
capabilities, history and TO-DO list.