Changeset 15451


Ignore:
Timestamp:
Aug 29, 2012, 12:20:20 PM (8 years ago)
Author:
gb
Message:

pmcl-kernel.c: In register_cstack_holding_area_lock(), if stack is too

small for soft/hard protected areas, just set hard/soft limits to
physical limits and don't write-protect any regions (on architectures
that want to do this.)

thread_manager.c: even foreign TCR's need to set tcr->cs_limit, so that

rmark() doesn't exhaust the stack.

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

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r15432 r15451  
    317317  BytePtr lowlimit = (BytePtr) (((((natural)bottom)-size)+4095)&~4095);
    318318  area *a = new_area((BytePtr) bottom-size, bottom, AREA_CSTACK);
    319   a->hardlimit = lowlimit+CSTACK_HARDPROT;
    320   a->softlimit = a->hardlimit+CSTACK_SOFTPROT;
     319  if (size > (CSTACK_HARDPROT + CSTACK_SOFTPROT)) {
     320    a->hardlimit = lowlimit+CSTACK_HARDPROT;
     321    a->softlimit = a->hardlimit+CSTACK_SOFTPROT;
     322  } else {
     323    a->softlimit = a->hardlimit = lowlimit;
     324  }
    321325#ifdef USE_SIGALTSTACK
    322326  setup_sigaltstack(a);
    323327#endif
    324328#ifdef PROTECT_CSTACK
    325   a->softprot=new_protected_area(a->hardlimit,a->softlimit,kSPsoftguard,CSTACK_SOFTPROT,true);
    326   a->hardprot=new_protected_area(lowlimit,a->hardlimit,kSPhardguard,CSTACK_HARDPROT,true);
     329  if (a->softlimit != a->harlimit) {
     330    a->softprot=new_protected_area(a->hardlimit,a->softlimit,kSPsoftguard,CSTACK_SOFTPROT,true);
     331    a->hardprot=new_protected_area(lowlimit,a->hardlimit,kSPhardguard,CSTACK_HARDPROT,true);
     332  }
    327333#endif
    328334  add_area_holding_area_lock(a);
  • trunk/source/lisp-kernel/thread_manager.c

    r15438 r15451  
    15461546  tcr->last_lisp_frame = (natural)(a->high);
    15471547#endif
    1548   if (!(tcr->flags & (1<<TCR_FLAG_BIT_FOREIGN))) {
    1549     TCR_AUX(tcr)->cs_limit = (LispObj)ptr_to_lispobj(a->softlimit);
    1550   }
     1548  TCR_AUX(tcr)->cs_limit = (LispObj)ptr_to_lispobj(a->softlimit);
    15511549#ifdef LINUX
    15521550#ifdef PPC
Note: See TracChangeset for help on using the changeset viewer.