1. 14 Jan, 2022 3 commits
  2. 28 Dec, 2021 1 commit
  3. 06 Dec, 2021 1 commit
  4. 01 Sep, 2020 1 commit
  5. 03 Dec, 2019 1 commit
    • John Baldwin's avatar
      Use uintptr_t instead of register_t * for the stack base. · 31174518
      John Baldwin authored
      - Use ustringp for the location of the argv and environment strings
        and allow destp to travel further down the stack for the stackgap
        and auxv regions.
      - Update the Linux copyout_strings variants to move destp down the
        stack as was done for the native ABIs in r263349.
      - Stop allocating a space for a stack gap in the Linux ABIs.  This
        used to hold translated system call arguments, but hasn't been used
        since r159992.
      
      Reviewed by:	kib
      Tested on:	md64 (amd64, i386, linux64), i386 (i386, linux)
      Sponsored by:	DARPA
      Differential Revision:	https://reviews.freebsd.org/D22501
      31174518
  6. 27 Nov, 2017 1 commit
    • Pedro F. Giffuni's avatar
      sys/compat: further adoption of SPDX licensing ID tags. · 7f2d13d6
      Pedro F. Giffuni authored
      Mainly focus on files that use BSD 2-Clause license, however the tool I
      was using misidentified many licenses so this was mostly a manual - error
      prone - task.
      
      The Software Package Data Exchange (SPDX) group provides a specification
      to make it easier for automated tools to detect and summarize well known
      opensource licenses. We are gradually adopting the specification, noting
      that the tags are considered only advisory and do not, in any way,
      superceed or replace the license texts.
      7f2d13d6
  7. 24 Aug, 2016 1 commit
  8. 21 Jan, 2012 1 commit
    • Konstantin Belousov's avatar
      Add support for the extended FPU states on amd64, both for native · 8c6f8f3d
      Konstantin Belousov authored
      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
      8c6f8f3d
  9. 01 Apr, 2011 1 commit
    • Konstantin Belousov's avatar
      Add support for executing the FreeBSD 1/i386 a.out binaries on amd64. · 7332c129
      Konstantin Belousov authored
      In particular:
      - implement compat shims for old stat(2) variants and ogetdirentries(2);
      - implement delivery of signals with ancient stack frame layout and
        corresponding sigreturn(2);
      - implement old getpagesize(2);
      - provide a user-mode trampoline and LDT call gate for lcall $7,$0;
      - port a.out image activator and connect it to the build as a module
        on amd64.
      
      The changes are hidden under COMPAT_43.
      
      MFC after:   1 month
      7332c129
  10. 23 Nov, 2010 1 commit
  11. 19 Oct, 2010 1 commit
  12. 03 Apr, 2010 1 commit
  13. 25 Mar, 2010 1 commit
  14. 01 Apr, 2009 1 commit
  15. 19 Oct, 2008 1 commit
  16. 05 Oct, 2006 1 commit
  17. 06 Dec, 2005 1 commit
  18. 14 Oct, 2005 1 commit
    • David Xu's avatar
      1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, most · 9104847f
      David Xu authored
         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
      9104847f
  19. 05 Apr, 2005 1 commit
    • Peter Wemm's avatar
      Fix 32 bit signals on amd64. It turns out that I was sign extending · 50860ac0
      Peter Wemm authored
      the register values coming back from sigreturn(2).  Normally this wouldn't
      matter because the 32 bit environment would truncate the upper 32 bits
      and re-save the truncated values at the next trap.  However, if we got
      a fast second signal and it was pending while we were returning from
      sigreturn(2) in the signal trampoline, we'd never have had a chance to
      truncate the bogus values in 32 bit mode, and the new sendsig would get
      an EFAULT when trying to write to the bogus user stack address.
      50860ac0
  20. 14 Apr, 2004 1 commit
  21. 21 Feb, 2004 1 commit
  22. 08 Nov, 2003 2 commits
  23. 30 Oct, 2003 1 commit
  24. 14 May, 2003 1 commit
    • Peter Wemm's avatar
      Add BASIC i386 binary support for the amd64 kernel. This is largely · d85631c4
      Peter Wemm authored
      stolen from the ia64/ia32 code (indeed there was a repocopy), but I've
      redone the MD parts and added and fixed a few essential syscalls.  It
      is sufficient to run i386 binaries like /bin/ls, /usr/bin/id (dynamic)
      and p4.  The ia64 code has not implemented signal delivery, so I had
      to do that.
      
      Before you say it, yes, this does need to go in a common place.  But
      we're in a freeze at the moment and I didn't want to risk breaking ia64.
      I will sort this out after the freeze so that the common code is in a
      common place.
      
      On the AMD64 side, this required adding segment selector context switch
      support and some other support infrastructure.  The %fs/%gs etc code
      is hairy because loading %gs will clobber the kernel's current MSR_GSBASE
      setting.  The segment selectors are not used by the kernel, so they're only
      changed at context switch time or when changing modes.  This still needs
      to be optimized.
      
      Approved by:	re (amd64/* blanket)
      d85631c4