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.

File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.