Changeset 15702


Ignore:
Timestamp:
Feb 11, 2013, 6:24:11 AM (6 years ago)
Author:
gb
Message:

Deja vu: sigreturn can return on FreeBSD too.

On all platforms where USE_ALTSTACK is defined, allocate the altstack
as a separate memory region. I have not seen the reported FreeBSD/AVX
problems since making this change, but of course that isn't conclusive.

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

Legend:

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

    r15473 r15702  
    7777
    7878#include "os-darwin.h"
    79 #define SEPARATE_ALTSTACK 1
     79
  • trunk/source/lisp-kernel/platform-darwinx8664.h

    r15473 r15702  
    8686
    8787
    88 #define SEPARATE_ALTSTACK 1
     88
  • trunk/source/lisp-kernel/platform-freebsdx8664.h

    r15700 r15702  
    6262#define IS_MAYBE_INT_TRAP(info,xp) ((xp->uc_mcontext.mc_trapno == T_PROTFLT) && ((xp->uc_mcontext.mc_err & 7) == 2))
    6363#define IS_PAGE_FAULT(info,xp) (xp->uc_mcontext.mc_trapno == T_PAGEFLT)
    64 #define SIGRETURN(context) freebsd_sigreturn(context)
     64#define SIGRETURN(context) do {freebsd_sigreturn(context); \
     65    Bug(context,"sigreturn returned"); \
     66  } while (0)
    6567
    6668/* AVX stuff.  Funky, because some of this isn't defined until
     
    7375
    7476#include "os-freebsd.h"
     77
  • trunk/source/lisp-kernel/platform-linuxarm.h

    r15470 r15702  
    4949
    5050#define PROTECT_CSTACK 1
    51 #define SEPARATE_ALTSTACK 1
     51
  • trunk/source/lisp-kernel/thread_manager.c

    r15577 r15702  
    13721372      condemn_area_holding_area_lock(cs);
    13731373    }
    1374     /* On some platforms - currently just linuxarm - we have to
    1375        allocate a separate alternate signal stack (rather than just
    1376        using a few pages of the thread's main stack.)  Disable and
    1377        free that alternate stack here.
     1374    /* If we use the sigaltstack mechanism, we always keep the
     1375       altstack separate from other stacks now.
    13781376    */
    1379 #ifdef SEPARATE_ALTSTACK
     1377#ifdef USE_ALTSTACK
    13801378    {
    13811379      stack_t new, current;
  • trunk/source/lisp-kernel/x86-asmutils64.s

    r15500 r15702  
    164164_exportfn(C(freebsd_sigreturn))
    165165        __(movl $417,%eax)      /* SYS_sigreturn */
    166         __(syscall)                             
     166        __(syscall)     
     167        __(ret)                 
    167168       
    168169_exportfn(C(get_vector_registers))
  • trunk/source/lisp-kernel/x86-exceptions.c

    r15701 r15702  
    15791579#ifdef FREEBSD
    15801580  if (AVX_CONTEXT_PRESENT(context)) {
    1581     AVX_CONTEXT_PTR(context) = fp;
     1581    AVX_CONTEXT_PTR(context) = (natural)fp;
    15821582  }
    15831583#endif
     
    23772377  stack.ss_size = SIGSTKSZ*8;
    23782378  stack.ss_flags = 0;
    2379 #ifdef SEPARATE_ALTSTACK
    23802379  stack.ss_sp = mmap(NULL,stack.ss_size, PROT_READ|PROT_WRITE|PROT_EXEC,MAP_ANON|MAP_PRIVATE,-1,0);
    2381 #else
    2382   stack.ss_sp = a->low;
    2383   a->low += SIGSTKSZ*8;
    2384   mmap(stack.ss_sp,stack.ss_size, PROT_READ|PROT_WRITE|PROT_EXEC,MAP_FIXED|MAP_ANON|MAP_PRIVATE,-1,0);
    2385 #endif
    23862380#ifdef LINUX
    23872381  /* The ucontext pushed on the altstack may not contain the (largish)
Note: See TracChangeset for help on using the changeset viewer.