Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/i386/include/ucontext.h

[BACK] Up to [FreeBSD] / src / sys / i386 / include

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Jan 21 17:45:27 2012 UTC (2 weeks, 6 days ago) by kib
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +11 -3 lines
SVN rev 230426 on 2012-01-21 17:45:27Z by kib

Add support for the extended FPU states on amd64, both for native
64bit and 32bit ABIs.  As a side-effect, it enables AVX on capable
CPUs.

In particular:

- Query the CPU support for XSAVE, list of the supported extensions
  and the required size of FPU save area. The hw.use_xsave tunable is
  provided for disabling XSAVE, and hw.xsave_mask may be used to
  select the enabled extensions.

- Remove the FPU save area from PCB and dynamically allocate the
  (run-time sized) user save area on the top of the kernel stack,
  right above the PCB. Reorganize the thread0 PCB initialization to
  postpone it after BSP is queried for save area size.

- The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as
  well. FPU state is only useful for suspend, where it is saved in
  dynamically allocated suspfpusave area.

- Use XSAVE and XRSTOR to save/restore FPU state, if supported and
  enabled.

- Define new mcontext_t flag _MC_HASFPXSTATE, indicating that
  mcontext_t has a valid pointer to out-of-struct extended FPU
  state. Signal handlers are supplied with stack-allocated fpu
  state. The sigreturn(2) and setcontext(2) syscall honour the flag,
  allowing the signal handlers to inspect and manipilate extended
  state in the interrupted context.

- The getcontext(2) never returns extended state, since there is no
  place in the fixed-sized mcontext_t to place variable-sized save
  area. And, since mcontext_t is embedded into ucontext_t, makes it
  impossible to fix in a reasonable way.  Instead of extending
  getcontext(2) syscall, provide a sysarch(2) facility to query
  extended FPU state.

- Add ptrace(2) support for getting and setting extended state; while
  there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries.

- Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to
  consumers, making it opaque. Internally, struct fpu_kern_ctx now
  contains a space for the extended state. Convert in-kernel consumers
  of fpu_kern KPI both on i386 and amd64.

First version of the support for AVX was submitted by Tim Bird
<tim.bird am sony com> on behalf of Sony. This version was written
from scratch.

Tested by:	pho (previous version), Yamagi Burmeister <lists yamagi org>
MFC after:	1 month

Revision 1.12.4.3: download - view: text, markup, annotated - select for diffs
Tue Jan 3 09:27:23 2012 UTC (5 weeks, 4 days ago) by kib
Branches: RELENG_9
Diff to: previous 1.12.4.2: preferred, colored; branchpoint 1.12: preferred, colored; next MAIN 1.13: preferred, colored
Changes since revision 1.12.4.2: +4 -3 lines
SVN rev 229372 on 2012-01-03 09:27:23Z by kib

MFC r229104:
Make the comment in i386/include/ucontext.h identical to the one in
amd64/include/ucontext.h. The later is better worded.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sat Dec 31 14:44:42 2011 UTC (5 weeks, 6 days ago) by kib
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +4 -3 lines
SVN rev 229104 on 2011-12-31 14:44:42Z by kib

Make the comment in i386/include/ucontext.h identical to the one in
amd64/include/ucontext.h. The later is better worded.

Requested by:	deischen
MFC after:	3 days

Revision 1.12.4.2: download - view: text, markup, annotated - select for diffs
Fri Dec 30 20:35:13 2011 UTC (6 weeks ago) by kib
Branches: RELENG_9
Diff to: previous 1.12.4.1: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.4.1: +3 -3 lines
SVN rev 229023 on 2011-12-30 20:35:13Z by kib

MFC r227399:
Attempt to improve formatting and content of several comments for
amd64 and i386 MD code.

Revision 1.12.4.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (3 months ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.12.4.1: preferred, colored; next MAIN 1.12.4.2: preferred, colored
Changes since revision 1.12.4.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.13: download - view: text, markup, annotated - select for diffs
Wed Nov 9 18:25:50 2011 UTC (3 months ago) by kib
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +3 -3 lines
SVN rev 227399 on 2011-11-09 18:25:50Z by kib

Attempt to improve formatting and content of several comments for
amd64 and i386 MD code.

Based on suggestions by:	bde
MFC after:	1 week

Revision 1.12.4.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.11.12.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 3 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.11: preferred, colored; next MAIN 1.12: preferred, colored
Changes since revision 1.11: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.12.2.1.6.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 3 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.12.2.1: preferred, colored; next MAIN 1.12.4.1: preferred, colored
Changes since revision 1.12.2.1: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.12.2.1.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.12.2.1: preferred, colored; next MAIN 1.12.4.1: preferred, colored
Changes since revision 1.12.2.1: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.11.10.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (2 years ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.11: preferred, colored; next MAIN 1.12: preferred, colored
Changes since revision 1.11: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.12.2.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.12.2.1: preferred, colored; next MAIN 1.12.4.1: preferred, colored
Changes since revision 1.12.2.1: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.12.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
CVS tags: RELENG_8_2_BP, RELENG_8_1_BP, RELENG_8_0_BP
Branch point for: RELENG_8_2, RELENG_8_1, RELENG_8_0
Diff to: previous 1.12: preferred, colored; next MAIN 1.13: preferred, colored
Changes since revision 1.12: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.11.8.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.11: preferred, colored; next MAIN 1.12: preferred, colored
Changes since revision 1.11: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.12: download - view: text, markup, annotated - select for diffs
Wed Apr 1 12:44:17 2009 UTC (2 years, 10 months ago) by kib
Branches: MAIN
CVS tags: RELENG_9_BP, RELENG_8_BP
Branch point for: RELENG_9, RELENG_8
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +6 -1 lines
SVN rev 190616 on 2009-04-01 12:44:17Z by kib

Add all segment registers for the amd64 CPU to struct reg and mcontext.
To keep these structures ABI-compatible, half the size of r_trapno,
r_err, mc_trapno, mc_flags.

Add fsbase and gsbase to mcontext on both amd64 and i386.
Add flags to amd64 mcontext to indicate that it contains valid segments
or bases.

In collaboration with:	pho
Discussed with:	peter
Reviewed by:	jhb

Revision 1.11.6.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.11: preferred, colored; next MAIN 1.12: preferred, colored
Changes since revision 1.11: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.10.26.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.10: preferred, colored; next MAIN 1.11: preferred, colored
Changes since revision 1.10: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Sep 12 03:34:05 2005 UTC (6 years, 5 months ago) by obrien
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_4_BP, RELENG_7_3_BP, RELENG_7_2_BP, RELENG_7_1_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0, RELENG_7
Branch point for: RELENG_7_4, RELENG_7_3, RELENG_7_2, RELENG_7_1
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +42 -42 lines
MFamd64: use register_t's.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Mon Dec 2 19:58:55 2002 UTC (9 years, 2 months ago) by deischen
Branches: MAIN
CVS tags: RELENG_6_BP, RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3, RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2, RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0, RELENG_6, RELENG_5_BP, RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5, RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4, RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3, RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2, RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1, RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0, RELENG_5
Branch point for: RELENG_6_4
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +6 -4 lines
Align the FPU state in the ucontext and sigcontext to 16 bytes
to accomodate the new SSE/XMM floating point save/restore
instructions.

This commit is mostly from bde and includes some style nits.

Approved by:	re (jhb)

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sat Nov 16 06:35:52 2002 UTC (9 years, 2 months ago) by deischen
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +3 -10 lines
Add getcontext, setcontext, and swapcontext as system calls.
Previously these were libc functions but were requested to
be made into system calls for atomicity and to coalesce what
might be two entrances into the kernel (signal mask setting
and floating point trap) into one.

A few style nits and comments from bde are also included.

Tested on alpha by: gallatin

Revision 1.8: download - view: text, markup, annotated - select for diffs
Fri Oct 25 19:10:56 2002 UTC (9 years, 3 months ago) by peter
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +28 -0 lines
Split 4.x and 5.x signal handling so that we can keep 4.x signal
handling clean and functional as 5.x evolves.  This allows some of the
nasty bandaids in the 5.x codepaths to be unwound.

Encapsulate 4.x signal handling under COMPAT_FREEBSD4 (there is an
anti-foot-shooting measure in place, 5.x folks need this for a while) and
finish encapsulating the older stuff under COMPAT_43.  Since the ancient
stuff is required on alpha (longjmp(3) passes a 'struct osigcontext *'
to the current sigreturn(2), instead of the 'ucontext_t *' that sigreturn
is supposed to take), add a compile time check to prevent foot shooting
there too.  Add uniform COMPAT_43 stubs for ia64/sparc64/powerpc.

Tested on: i386, alpha, ia64.  Compiled on sparc64 (a few days ago).
Approved by: re

Revision 1.7: download - view: text, markup, annotated - select for diffs
Fri Oct 4 14:50:55 2002 UTC (9 years, 4 months ago) by deischen
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +6 -6 lines
Add another temporary hack to allow running older i386 binaries.
This will be removed when new versions of syscalls sigreturn()
and sigaction() are added (mini is working on this but is in
the middle of a move).

This should fix the problem of cvsupd dying.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Sep 16 19:25:41 2002 UTC (9 years, 4 months ago) by mini
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +19 -5 lines
Add kernel support needed for the KSE-aware libpthread:
	- Maintain fpu state across signals.
	- Save and restore FPU state properly in ucontext_t's.

Reviewed by:	deischen, julian
Approved by:	-arch

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Jan 10 02:32:30 2002 UTC (10 years, 1 month ago) by deischen
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +5 -2 lines
Use a spare slot in the machine context for a flags word to indicate
whether the machine context is valid and whether the FPU state is
valid (saved).

Mark the machine context valid before copying it out when sending a
signal.

Approved by:	-arch

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Oct 11 20:33:09 1999 UTC (12 years, 4 months ago) by luoqi
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7, RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6, RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5, RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4, RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3, RELENG_4_2_0_RELEASE, RELENG_4_1_1_RELEASE, RELENG_4_1_0_RELEASE, RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10, RELENG_4_0_0_RELEASE, RELENG_4, PRE_SMPNG, KSE_PRE_MILESTONE_2, KSE_MILESTONE_2
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +1 -3 lines
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

Revision 1.3: download - view: text, markup, annotated - select for diffs
Thu Oct 7 12:40:34 1999 UTC (12 years, 4 months ago) by marcel
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +20 -3 lines
Simplification of the signal trampoline and other cleanups.

o  Remove unused defines from genassym.c that were needed
   by the trampoline.
o  Add load_gs_param function to support.s that catches
   a fault when %gs is loaded with an invalid descriptor.
   The function returns EFAULT in that case.
o  Remove struct trapframe from mcontext_t and replace it
   with the list of registers.
o  Modify sendsig and sigreturn accordingly.

This commit contains a patch by bde.

Reviewed by: luoqi, jdp

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon Oct 4 19:33:55 1999 UTC (12 years, 4 months ago) by marcel
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +15 -8 lines
Re-introduction of sigcontext.

struct sigcontext and ucontext_t/mcontext_t are defined in such
a way that both (ie struct sigcontext and ucontext_t) can be
passed on to sigreturn. The signal handler is still given a
ucontext_t for maximum flexibility.

For backward compatibility sigreturn restores the state for the
alternate signal stack from sigcontext.sc_onstack and not from
ucontext_t.uc_stack. A good way to determine which value the
application has set and thus which value to use, is still open
for discussion.

NOTE: This change should only affect those binaries that use
      sigcontext and/or ucontext_t. In the source tree itself
      this is only doscmd. Recompilation is required for those
      applications.

This commit also fixes a lot of style bugs without hopefully
adding new ones.

NOTE: struct sigaltstack.ss_size now has type size_t again. For
      some reason I changed that into unsigned int.

Parts submitted by: bde
sigaltstack bug found by: bde

Revision 1.1: download - view: text, markup, annotated - select for diffs
Wed Sep 29 15:06:24 1999 UTC (12 years, 4 months ago) by marcel
Branches: MAIN
sigset_t change (part 3 of 5)
-----------------------------

By introducing a new sigframe so that the signal handler operates
on the new siginfo_t and on ucontext_t instead of sigcontext, we
now need two version of sendsig and sigreturn.

A flag in struct proc determines whether the process expects an
old sigframe or a new sigframe. The signal trampoline handles
which sigreturn to call. It does this by testing for a magic
cookie in the frame.

The alpha uses osigreturn to implement longjmp. This means that
osigreturn is not only used for compatibility with existing
binaries. To handle the new sigset_t, setjmp saves it in
sc_reserved (see NOTE).

the struct sigframe has been moved from frame.h to sigframe.h
to handle the complex header dependencies that was caused by
the new sigframe.

NOTE: For the i386, the size of jmp_buf has been increased to hold
      the new sigset_t. On the alpha this has been prevented by
      using sc_reserved in sigcontext.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options