Changeset 15700


Ignore:
Timestamp:
Feb 8, 2013, 2:55:24 PM (6 years ago)
Author:
gb
Message:

try to deal with avx extensions in FreeBSD 9.1

Location:
trunk/source/lisp-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/platform-freebsdx8632.h

    r15147 r15700  
    6060#define SIGRETURN(context) freebsd_sigreturn(context)
    6161
     62#define AVX_CONTEXT_PRESENT(xp) ((xp)->uc_mcontext.mc_trapno & 4)
     63#define AVX_CONTEXT_PTR(xp) (((xp)->uc_mcontext.mc_fpstate[130]))
     64#define AVX_CONTEXT_SIZE(xp) ((natural)((xp)->uc_mcontext.mc_fpstate[131]))
     65
    6266#include "os-freebsd.h"
  • trunk/source/lisp-kernel/platform-freebsdx8664.h

    r15147 r15700  
    6464#define SIGRETURN(context) freebsd_sigreturn(context)
    6565
     66/* AVX stuff.  Funky, because some of this isn't defined until
     67   fbsd 9.1 headers; if we built on an older OS version, we still need
     68   to know about this if we run on 9.1+ */
     69
     70#define AVX_CONTEXT_PRESENT(xp) ((xp)->uc_mcontext.mc_trapno & 4)
     71#define AVX_CONTEXT_PTR(xp) (((xp)->uc_mcontext.mc_fpstate[66]))
     72#define AVX_CONTEXT_SIZE(xp) ((natural)((xp)->uc_mcontext.mc_fpstate[67]))
     73
    6674#include "os-freebsd.h"
  • trunk/source/lisp-kernel/x86-exceptions.c

    r15572 r15700  
    15061506#endif
    15071507
     1508
     1509#ifdef FREEBSD
     1510typedef void *FPREGS;
     1511#endif
     1512
     1513LispObj *
     1514copy_avx(ExceptionInformation *xp, LispObj *current, FPREGS *destptr)
     1515{
     1516  natural sp;
     1517
     1518  *destptr = (FPREGS)AVX_CONTEXT_PTR(xp);
     1519
     1520  if (AVX_CONTEXT_PRESENT(xp)) {
     1521    sp = (natural)current;
     1522    sp -= AVX_CONTEXT_SIZE(xp);
     1523    sp = truncate_to_power_of_2(sp,6);
     1524    memcpy((void *)sp,(void *)AVX_CONTEXT_PTR(xp),AVX_CONTEXT_SIZE(xp));
     1525    current = (LispObj *)sp;
     1526    *destptr = (FPREGS)current;
     1527  }
     1528  return current;
     1529}
     1530
     1531
    15081532#ifdef DARWIN
    15091533LispObj *
     
    15521576#ifdef LINUX
    15531577  dest->uc_mcontext.fpregs = (fpregset_t)fp;
     1578#endif
     1579#ifdef FREEBSD
     1580  if (AVX_CONTEXT_PRESENT(context)) {
     1581    AVX_CONTEXT_PTR(context) = fp;
     1582  }
    15541583#endif
    15551584  dest->uc_stack.ss_sp = 0;
     
    16641693#ifdef LINUX
    16651694  foreign_rsp = copy_fpregs(context, foreign_rsp, &fpregs);
     1695#endif
     1696#ifdef FREEBSD
     1697  foreign_rsp = copy_avx(context, foreign_rsp, &fpregs);
    16661698#endif
    16671699#ifdef DARWIN
Note: See TracChangeset for help on using the changeset viewer.