summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include/mcontext.h
AgeCommit message (Collapse)Author
2019-12-27Harmonize the namespace of fast TLS base pointer getter functionskamil
Protect __lwp_getprivate_fast() with _RTLD_SOURCE, _LIBC_SOURCE and __LIBPTHREAD_SOURCE__. Include in this namespace <sys/tcl.h> and use __BEGIN_DECLS/__END_DECLS for the sake of consistency.
2018-02-15Introduce _UC_MACHINE_FP() as a macrokamil
_UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer. Don't rely on this interface as a compiler might strip frame pointer or optimize it making this interface unreliable. For hppa assume a small frame context, for larger frames FP might be located in a different register (4 instead of 3). For ia64 there is no strict frame pointer, and registers might rotate. Reuse 79 following: ./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM LOC_REG (79) Once ia64 will mature, this should be revisited. A macro can encapsulate a real function for extracting Frame Pointer on more complex CPUs / ABIs. For the remaining CPUs, reuse standard register as defined in appropriate ABI. The direct users of this macro are LLVM and GCC with Sanitizers. Proposed on tech-userlevel@. Sponsored by <The NetBSD Foundation>
2014-05-12Comments.uebayasi
2014-02-15Load and save the fpu registers (for copies to/from userspace) usingdsl
helper functions in arch/x86/x86/fpu.c They (hopefully) ensure that we write to the entire buffer and don't load values that might cause faults in kernel. Also zero out the 'pad' field of the i386 mcontext fp area that I think once contained the registers of any Weitek fpu. Dunno why it wasn't pasrt of the union. Some of these copies could be removed if the code directly copied the save area to/from userspace addresses.
2012-12-15Remove the incorrect comment about a (now deleted) pad field addeddsl
to make __fpregs be 16-byte aligned within ucontext_t. I doubt that has been true for years! Since the __fpregs field isn't accessed by fxsave it doesn't matter. There is a lot of type fubar here, at leat mark the char[] __aligned(8).
2012-05-21Calling _lwp_create() with a bogus ucontext could trigger a kernelmartin
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently discovered by YAMAMOTO Takashi and Joel Sing. To avoid this, introduce a cpu_mcontext_validate() function and move all sanity checks from cpu_setmcontext() there. Also untangle the netbsd32 compat mess slightly and add a cpu_mcontext32_validate() cousin there. Add an exhaustive atf test case, based partly on code from Joel Sing. Should finally fix the remaining open part of PR kern/43903.
2011-02-25Be nicer to software that insists on -ansi and use __inline.joerg
2011-02-24Allow storing and receiving the LWP private pointer via ucontext_tjoerg
on all platforms except VAX and IA64. Add fast access via register for AMD64, i386 and SH3 ports. Use this fast access in libpthread to replace the stack based pthread_self(). Implement skeleton support for Alpha, HPPA, PowerPC, SPARC and SPARC64, but leave it disabled. Ports that support this feature provide __HAVE____LWP_GETPRIVATE_FAST in machine/types.h and a corresponding __lwp_getprivate_fast in machine/mcontext.h. This material is based upon work partially supported by The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-02-23Fix ucontext32_t on AMD64. Add optional compile time assertions forjoerg
ucontext_t and ucontext32_t to ensure that they don't change. Provide the constants for AMD64, ARM, i386, and M68K.
2008-10-26put the contents of these header files around #ifdef __x86_64__, andmrg
#include the <i386/foo.h> in the #else clause, making these files largely bit-size independant.
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-01-04Change the way that the trap/intr/syscall frames and the __gregset_t[]dsl
indexes are defined so that only a single list of the registers is used. The code no longer relies on the two structures matching. There should be no binary change.
2006-03-29Add the netbsd32 MD bits for sparc64 and amd64 to support SA.cube
Many thanks to all who helped for that little project, notably Martin Husemann for teaching me a bit about the very special sparc64 world.
2005-12-11merge ktrace-lwp.christos
2005-05-15Optionally include saving and restoring the 64bit %gs and %fs base registerfvdl
values in the PCB. Do this in pmap_activate for now (XXX not a good place for it, but a convenient one).
2004-10-21Fix thread context switching to take the stack ABI into account.fvdl
From Wolfgang Solfrank.
2003-10-13Define mcontext32_t (if COMPAT_NETBSD32).fvdl
2003-10-08Add some accessor macros for the ucontext:thorpej
* _UC_MACHINE_PC() - access the program counter * _UC_MACHINE_INTRV() - access the integer return value register * _UC_MACHINE_SET_PC() - set the program counter (this requires special handling on some platforms).
2003-10-06SIGINFO support.fvdl
Todo: 32bit compat support (COMPAT_NETBSD32 will not compile right now, as it won't on other platforms).
2003-04-26Rename the x86_64 port to amd64, as this is the actual name used forfvdl
the processor family now. x86_64 is kept as the MACHINE_ARCH value, since it's already widely used (by e.g. the toolchain, etc), and by other operating systems.