Changeset 8475


Ignore:
Timestamp:
Feb 12, 2008, 3:02:15 PM (12 years ago)
Author:
gb
Message:

get impurify() working on x86-64.

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

Legend:

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

    r8408 r8475  
    616616}
    617617
     618void
     619release_readonly_area()
     620{
     621  area *a = readonly_area;
     622  munmap(a->low,align_to_power_of_2(a->active-a->low, log2_page_size));
     623  a->active = a->low;
     624  a->ndnodes = 0;
     625  pure_space_active = pure_space_start;
     626}
  • trunk/source/lisp-kernel/x86-exceptions.c

    r8471 r8475  
    157157  area *a = active_dynamic_area;
    158158  Boolean egc_was_enabled = (a->older != NULL);
     159 
    159160  natural gc_previously_deferred = gc_deferred;
    160161
     
    219220      full_gc_deferred = 0;
    220221    }
    221     if (selector & GC_TRAP_FUNCTION_PURIFY) {
    222       purify_from_xp(xp, 0L);
    223       gc_from_xp(xp, 0L);
    224     }
    225     if (selector & GC_TRAP_FUNCTION_SAVE_APPLICATION) {
    226       OSErr err;
    227       extern OSErr save_application(unsigned);
    228       area *vsarea = tcr->vs_area;
     222    if (selector > GC_TRAP_FUNCTION_GC) {
     223      if (selector & GC_TRAP_FUNCTION_IMPURIFY) {
     224        impurify_from_xp(xp, 0L);
     225        /*        nrs_GC_EVENT_STATUS_BITS.vcell |= gc_integrity_check_bit; */
     226        gc_from_xp(xp, 0L);
     227        release_readonly_area();
     228      }
     229      if (selector & GC_TRAP_FUNCTION_PURIFY) {
     230        purify_from_xp(xp, 0L);
     231        gc_from_xp(xp, 0L);
     232      }
     233      if (selector & GC_TRAP_FUNCTION_SAVE_APPLICATION) {
     234        OSErr err;
     235        extern OSErr save_application(unsigned);
     236        area *vsarea = tcr->vs_area;
    229237       
    230       nrs_TOPLFUNC.vcell = *((LispObj *)(vsarea->high)-1);
    231       err = save_application(arg);
    232       if (err == noErr) {
    233         _exit(0);
     238        nrs_TOPLFUNC.vcell = *((LispObj *)(vsarea->high)-1);
     239        err = save_application(arg);
     240        if (err == noErr) {
     241          _exit(0);
     242        }
     243        fatal_oserr(": save_application", err);
    234244      }
    235       fatal_oserr(": save_application", err);
    236     }
    237     switch (selector) {
    238     case GC_TRAP_FUNCTION_SET_HONS_AREA_SIZE:
    239       xpGPR(xp, Iimm0) = 0;
    240       break;
    241     case GC_TRAP_FUNCTION_FREEZE:
    242       a->active = (BytePtr) align_to_power_of_2(a->active, log2_page_size);
    243       tenured_area->static_dnodes = area_dnode(a->active, a->low);
    244       xpGPR(xp, Iimm0) = tenured_area->static_dnodes << dnode_shift;
    245       break;
    246     default:
    247       break;
     245      switch (selector) {
     246      case GC_TRAP_FUNCTION_SET_HONS_AREA_SIZE:
     247        xpGPR(xp, Iimm0) = 0;
     248        break;
     249      case GC_TRAP_FUNCTION_FREEZE:
     250        a->active = (BytePtr) align_to_power_of_2(a->active, log2_page_size);
     251        tenured_area->static_dnodes = area_dnode(a->active, a->low);
     252        xpGPR(xp, Iimm0) = tenured_area->static_dnodes << dnode_shift;
     253        break;
     254      default:
     255        break;
     256      }
    248257    }
    249258    if (egc_was_enabled) {
  • trunk/source/lisp-kernel/x86-gc.c

    r8472 r8475  
    17821782  }
    17831783}
     1784
    17841785void
    17851786purify_headerless_range(LispObj *start, LispObj *end, BytePtr low, BytePtr high, area *to)
     
    20582059 
    20592060
    2060 
    2061 void
    2062 impurify_xp(ExceptionInformation *xp, LispObj low, LispObj high, int delta)
     2061void
     2062impurify_gcable_ptrs(LispObj low, LispObj high, signed_natural delta)
     2063{
     2064  LispObj *prev = &(lisp_global(GCABLE_POINTERS)), next;
     2065
     2066  while ((*prev) != (LispObj)NULL) {
     2067    impurify_noderef(prev, low, high, delta);
     2068    next = *prev;
     2069    prev = &(((xmacptr *)ptr_from_lispobj(untag(next)))->link);
     2070  }
     2071}
     2072
     2073
     2074void
     2075impurify_xp(ExceptionInformation *xp, LispObj low, LispObj high, signed_natural delta)
    20632076{
    20642077  natural *regs = (natural *) xpGPRvector(xp);
     
    20852098
    20862099void
    2087 impurify_headerless_range(LispObj *start, LispObj *end, LispObj low, LispObj high, int delta)
     2100impurify_headerless_range(LispObj *start, LispObj *end, LispObj low, LispObj high, signed_natural delta)
    20882101{
    20892102  while (start < end) {
     
    20952108
    20962109void
    2097 impurify_range(LispObj *start, LispObj *end, LispObj low, LispObj high, int delta)
     2110impurify_range(LispObj *start, LispObj *end, LispObj low, LispObj high, signed_natural delta)
    20982111{
    20992112  LispObj header;
     
    21672180
    21682181void
    2169 impurify_tcr_tlb(TCR *tcr,  LispObj low, LispObj high, int delta)
     2182impurify_tcr_tlb(TCR *tcr,  LispObj low, LispObj high, signed_natural delta)
    21702183{
    21712184  unsigned n = tcr->tlb_limit;
     
    21762189
    21772190void
    2178 impurify_tcr_xframes(TCR *tcr, LispObj low, LispObj high, int delta)
     2191impurify_tcr_xframes(TCR *tcr, LispObj low, LispObj high, signed_natural delta)
    21792192{
    21802193  xframe_list *xframes;
     
    21922205
    21932206void
    2194 impurify_tstack_area(area *a, LispObj low, LispObj high, int delta)
     2207impurify_tstack_area(area *a, LispObj low, LispObj high, signed_natural delta)
    21952208{
    21962209  LispObj
     
    22122225}
    22132226void
    2214 impurify_vstack_area(area *a, LispObj low, LispObj high, int delta)
     2227impurify_vstack_area(area *a, LispObj low, LispObj high, signed_natural delta)
    22152228{
    22162229  LispObj
     
    22232236
    22242237void
    2225 impurify_areas(LispObj low, LispObj high, int delta)
     2238impurify_areas(LispObj low, LispObj high, signed_natural delta)
    22262239{
    22272240  area *next_area;
     
    22392252     
    22402253    case AREA_CSTACK:
    2241 #ifdef PPC
    2242       impurify_cstack_area(next_area, low, high, delta);
    2243 #endif
    22442254      break;
    22452255     
     
    22652275      oldhigh = a->high, newhigh;
    22662276    unsigned n = ro_limit - ro_base;
    2267     int delta = oldfree-ro_base;
     2277    signed_natural delta = oldfree-ro_base;
    22682278    TCR *other_tcr;
    22692279
     
    22902300        other_tcr = other_tcr->next;
    22912301      } while (other_tcr != tcr);
     2302
     2303      impurify_gcable_ptrs(ptr_to_lispobj(ro_base), ptr_to_lispobj(ro_limit), delta);
    22922304      lisp_global(IN_GC) = 0;
    22932305    }
Note: See TracChangeset for help on using the changeset viewer.