<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/amd64/include/ucontext.h, branch stable/13</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=stable%2F13</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=stable%2F13'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-08-23T17:43:22Z</updated>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c comment pattern</title>
<updated>2023-08-23T17:43:22Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4fbf14e22d7b83de7080a8e491ba14a5785a0ff4'/>
<id>urn:sha1:4fbf14e22d7b83de7080a8e491ba14a5785a0ff4</id>
<content type='text'>
Remove /^/[*/]\s*\$FreeBSD\$.*\n/

Similar commit in current:
(cherry picked from commit 71625ec9ad2a)
</content>
</entry>
<entry>
<title>Convert machine/elf.h, machine/frame.h, machine/sigframe.h,</title>
<updated>2013-02-20T17:39:52Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2013-02-20T17:39:52Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=31a53cd03625e31cbbf63b78cf3c9b711301869a'/>
<id>urn:sha1:31a53cd03625e31cbbf63b78cf3c9b711301869a</id>
<content type='text'>
machine/signal.h and machine/ucontext.h into common x86 includes,
copying from amd64 and merging with i386.

Kernel-only compat definitions are kept in the i386/include/sigframe.h
and i386/include/signal.h, to reduce amd64 kernel namespace pollution.
The amd64 compat uses its own definitions so far.

The _MACHINE_ELF_WANT_32BIT definition is to allow the
sys/boot/userboot/userboot/elf32_freebsd.c to use i386 ELF definitions
on the amd64 compile host.  The same hack could be usefully abused by
other code too.
</content>
</entry>
<entry>
<title>Add support for the extended FPU states on amd64, both for native</title>
<updated>2012-01-21T17:45:27Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2012-01-21T17:45:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8c6f8f3d5b1439847cf3b4336b23e78c81dd035b'/>
<id>urn:sha1:8c6f8f3d5b1439847cf3b4336b23e78c81dd035b</id>
<content type='text'>
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
&lt;tim.bird am sony com&gt; on behalf of Sony. This version was written
from scratch.

Tested by:	pho (previous version), Yamagi Burmeister &lt;lists yamagi org&gt;
MFC after:	1 month
</content>
</entry>
<entry>
<title>Attempt to improve formatting and content of several comments for</title>
<updated>2011-11-09T18:25:50Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2011-11-09T18:25:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e9862e9b9eaa16ac487faba90c35e496fd9c9eda'/>
<id>urn:sha1:e9862e9b9eaa16ac487faba90c35e496fd9c9eda</id>
<content type='text'>
amd64 and i386 MD code.

Based on suggestions by:	bde
MFC after:	1 week
</content>
</entry>
<entry>
<title>Add all segment registers for the amd64 CPU to struct reg and mcontext.</title>
<updated>2009-04-01T12:44:17Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2009-04-01T12:44:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0cdf4ffabc579d70bfcf1ef443a1cdafaee4bf2f'/>
<id>urn:sha1:0cdf4ffabc579d70bfcf1ef443a1cdafaee4bf2f</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>Update the graffiti.</title>
<updated>2003-11-08T04:39:22Z</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>2003-11-08T04:39:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fcfe57d64080fe861c8dc9d41bc675338ff4ad9a'/>
<id>urn:sha1:fcfe57d64080fe861c8dc9d41bc675338ff4ad9a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rename npx* to fpu*.  I haven't done the flags/function names yet.</title>
<updated>2003-11-08T02:39:46Z</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>2003-11-08T02:39:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8b2454d833d9fa0b1655aad209d83394a1d653e2'/>
<id>urn:sha1:8b2454d833d9fa0b1655aad209d83394a1d653e2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Pull the tier-2 card one last time and break the get/setcontext and</title>
<updated>2003-10-15T02:04:52Z</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>2003-10-15T02:04:52Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=19acc770c2f909552c3967e669964fc8746fefb5'/>
<id>urn:sha1:19acc770c2f909552c3967e669964fc8746fefb5</id>
<content type='text'>
sigreturn() ABI and the signal context on the stack.

Make the trapframe (and its shadows in the ucontext and sigframe etc)
8 bytes larger in order to preserve 16 byte stack alignment for the
following C code calls.  I could have done some padding after the
trapframe was saved, but some of the C code still expects an argument of
'struct trapframe'.  Anyway, this gives me a spare field that can be used
to store things like 'partial trapframe' status or something else in
the future.

The runtime impact is fairly small, *except* for threaded apps and things
that decode contexts and the signal stack (eg: cvsup binary).  Signal
delivery isn't too badly affected because the kernel generates the
sigframe that sigreturn uses after the handler has been called.

The size of mcontext_t and struct sigframe hasn't changed.  Only
the last few fields (sc_eip etc) got moved a little and I eliminated
a spare field.  mc_len/sc_len did change location though so the
sanity checks there will still trap it.
</content>
</entry>
<entry>
<title>Use __register_t instead of register_t, otherwise &lt;sys/types.h&gt; is a</title>
<updated>2003-10-01T01:08:04Z</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>2003-10-01T01:08:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a93020d7a18ef9d51388292f32293cdcd3df0881'/>
<id>urn:sha1:a93020d7a18ef9d51388292f32293cdcd3df0881</id>
<content type='text'>
prerequisite for &lt;ucontext.h&gt; on amd64.  Oops.
</content>
</entry>
<entry>
<title>Oops.  sizeof(long) = 8, not 4.  Get the fxsave buffer inside mcontext</title>
<updated>2003-09-05T20:47:27Z</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>2003-09-05T20:47:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c896a8adbfaf8dd41ae93dec93f4b2d831abe5ac'/>
<id>urn:sha1:c896a8adbfaf8dd41ae93dec93f4b2d831abe5ac</id>
<content type='text'>
the right size.  I'm planning on *possibly* stealing the two 'spare'
variables on either side for botched alignment correction.
</content>
</entry>
</feed>
