Changeset 15370


Ignore:
Timestamp:
May 21, 2012, 7:22:51 AM (7 years ago)
Author:
gb
Message:

Define assembly lisp-globals in lisp_globals.s, not in *constants.s
Provide _rnode and support, so that the lisp_globals structure can
have its elements defined in predecremented descending order.
Make managed_static_dnodes/_refbits new globals so that they can
be used on all platforms (even though the managed_static_area is only
used on x86 at the moment.
When disabling the EGC, set lisp_global(OLDSPACE_DNODE_COUNT) to 0
(not effectively to lisp_global(MANAGED_STATIC_DNODES), since the
new write barrier code doesn't overload a single set of refbits.

Hopefully, that's it for these changes.
(We'll see if the code even compiles on other platforms.)

-

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

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/arm-constants.s

    r15257 r15370  
    548548lisp_globals_limit = -fulltag_nil
    549549
    550 num_lisp_globals = 49            /* MUST UPDATE THIS !!! */
    551        
    552         _struct(lisp_globals,-(fulltag_nil+dnode_size+(num_lisp_globals*node_size)))
    553          _node(weakvll)                 /* all populations as of last GC */
    554          _node(initial_tcr)             /* initial thread tcr */
    555          _node(image_name)              /* --image-name argument */
    556          _node(BADfpscr_save_high)      /* high word of FP reg used to save FPSCR */
    557          _node(unwind_resume)           /* _Unwind_Resume */
    558          _node(batch_flag)              /* -b */
    559          _node(host_platform)           /* for runtime platform-specific stuff */
    560          _node(argv)                    /* address of argv`0' */
    561          _node(ref_base)                        /* start of oldest pointer-bearing area */
    562          _node(tenured_area)            /* the tenured_area */
    563          _node(oldest_ephemeral)        /* dword address of oldest ephemeral object or 0 */
    564          _node(lisp_exit_hook)          /* install foreign exception_handling */
    565          _node(lisp_return_hook)        /* install lisp exception_handling */
    566          _node(double_float_one)        /* high half of 1.0d0 */
    567          _node(short_float_zero)        /* low half of 1.0d0 */
    568          _node(objc2_end_catch)         /* objc_end_catch() */
    569          _node(metering_info)           /* address of lisp_metering global */
    570          _node(in_gc)                   /* non-zero when GC active */
    571          _node(lexpr_return1v)          /* simpler when &lexpr called for single value. */
    572          _node(lexpr_return)            /* magic &lexpr return code. */
    573          _node(all_areas)               /* doubly-linked list of all memory areas */
    574          _node(kernel_path)             /* real executable name */
    575          _node(objc2_begin_catch)       /* objc_begin_catch */
    576          _node(stack_size)              /* from command-line */
    577          _node(statically_linked)       /* non-zero if -static */
    578          _node(heap_end)                /* end of lisp heap */
    579          _node(heap_start)              /* start of lisp heap */
    580          _node(gcable_pointers)         /* linked-list of weak macptrs. */
    581          _node(gc_num)                  /* fixnum: GC call count. */
    582          _node(fwdnum)                  /* fixnum: GC "forwarder" call count. */
    583          _node(float_abi)         /* non-zero when hard-float */
    584          _node(oldspace_dnode_count)    /* dynamic dnodes older than g0 start */
    585          _node(refbits)                 /* EGC refbits */
    586          _node(gc_inhibit_count)
    587          _node(intflag)                 /* sigint pending */
    588          _node(BAD_block_tag_counter)   /* counter for (immediate) block tag */
    589          _node(deleted_static_pairs)           
    590          _node(exception_lock)
    591          _node(area_lock)
    592          _node(tcr_key)                 /* tsd key for per-thread tcr */
    593          _node(ret1val_addr)            /* address of "dynamic" subprims magic values return addr */
    594          _node(subprims_base)           /* address of dynamic subprims jump table */
    595          _node(saveR13)                 /* probably don't really need this */
    596          _node(saveTOC)                 /* where the 68K emulator stores the  emulated regs */
    597          _node(objc_2_personality)      /* exception "personality routine" address for ObjC 2.0 */
    598          _node(kernel_imports)          /* some things we need imported for us */
    599          _node(interrupt_signal)        /* signal used by PROCESS-INTERRUPT */
    600          _node(tcr_count)               /* tcr_id for next tcr */
    601          _node(get_tcr)                 /* address of get_tcr() */
    602         _ends
    603 
    604550/* extended type codes, for UUOs.  Shouldn't conflict with defined subtags */
    605551
  • trunk/source/lisp-kernel/arm-exceptions.c

    r15158 r15370  
    509509      if (selector & GC_TRAP_FUNCTION_PURIFY) {
    510510        purify_from_xp(xp, 0L);
    511         lisp_global(OLDSPACE_DNODE_COUNT) = area_dnode(managed_static_area->active, managed_static_area->low);
     511        lisp_global(OLDSPACE_DNODE_COUNT) = 0;
    512512        gc_from_xp(xp, 0L);
    513513      }
  • trunk/source/lisp-kernel/lisp_globals.h

    r15366 r15370  
    2727#define KERNEL_IMPORTS (-4)     /* some things we need to have imported for us. */
    2828#define OBJC_2_PERSONALITY (-5) /* A good listener.  Doesn't say much */
    29 #ifdef X86
    30 #define MANAGED_STATIC_REFBITS (-6) /* refs from managed_static to dynamic */
    31 #define MANAGED_STATIC_DNODES (-7) /* ndnodes in managed_static_area */
    32 #else
    3329#define SAVETOC (-6)            /* Saved TOC register, for some platforms */
    3430#define SAVER13 (-7)            /* Saved (global) r13, on some platforms */
    35 #endif
    3631#define SUBPRIMS_BASE (-8)      /* where the dynamic subprims wound up */
    3732#define RET1VALN (-9)           /* magic multiple-values return address */
     
    8176#define INITIAL_TCR (-48)       /* initial thread tcr */
    8277#define WEAKVLL (-49)           /* all populations as of last GC */
     78#define MANAGED_STATIC_REFBITS (-50) /* refs from managed_static to dynamic */
     79#define MANAGED_STATIC_DNODES (-51) /* ndnodes in managed_static_area */
    8380
    84 #define MIN_KERNEL_GLOBAL WEAKVLL
     81
     82
     83#define MIN_KERNEL_GLOBAL MANAGED_STATIC_DNODES
    8584
    8685/* These are only non-zero when an image is being saved or loaded */
  • trunk/source/lisp-kernel/lisp_globals.s

    r15197 r15370  
    153153         _struct_pad(nrs_symbol_extra)  /* %foreign-thread-control */
    154154        _ends
     155
     156num_lisp_globals = 49            /* MUST UPDATE THIS !!!   */
     157       
     158        _struct(lisp_globals,lisp_globals_limit)
     159         _rnode(get_tcr)                /* address of get_tcr() for callbacks */
     160         _rnode(tcr_count)              /* next tcr's tcr_id */
     161         _rnode(interrupt_signal)  /* signal to use for PROCESS-INTERRUPT */
     162         _rnode(kernel_imports) /* some things we need to have imported for us. */
     163         _rnode(objc_2_personality) /* A good listener.  Doesn't say much */
     164         _rnode(savetoc)        /* Saved TOC register, for some platforms */
     165         _rnode(saver13)        /* Saved (global) r13, on some platforms */
     166         _rnode(subprims_base)  /* where the dynamic subprims wound up */
     167         _rnode(ret1valn)               /* magic multiple-values return address */
     168         _rnode(tcr_key)        /* tsd key for per-thread tcr */
     169         _rnode(tcr_area_lock)       /* all_areas/tcr queue lock */
     170         _rnode(exception_lock) /* serialize exception handling */
     171         _rnode(static_conses)
     172         _rnode(default_allocation_quantum)
     173         _rnode(intflag)
     174         _rnode(gc_inhibit_count)
     175         _rnode(refbits)
     176         _rnode(oldspace_dnode_count) /* count of dynamic dnodes older than generation 0 */
     177         __ifdef(`PPC')
     178          _rnode(altivec_present)   /* non-zero if AltiVec present. */
     179         __else
     180          _rnode(float_abi)         /* non zero when hard-float ABI in effect */
     181         __endif
     182         _rnode(fwdnum)            /* fixnum: GC "forwarder" call count. */
     183         _rnode(gc_num)            /* fixnum: GC call count. */
     184         _rnode(gcable_pointers)   /* linked-list of weak macptrs. */
     185         _rnode(heap_start)        /* start of lisp heap */
     186         _rnode(heap_end)          /* end of lisp heap */
     187         _rnode(statically_linked)        /* non-zero if -static */
     188         _rnode(stack_size)        /* from the command line */
     189         _rnode(objc_2_begin_catch)  /* address of ObjC 2.0 objc_begin_catch() */
     190         _rnode(kernel_path)       /* real executable name */
     191         _rnode(all_areas)         /* doubly-linked list of stack & heap areas */
     192         _rnode(lexpr_return)      /* magic &lexpr cleanup code */
     193         _rnode(lexpr_return1v)    /* single-value &lexpr cleanup code */
     194         _rnode(in_gc)             /* non-zero when lisp addresses may be invalid */
     195         _rnode(free_static_conses)     /* length of freelist */
     196         _rnode(objc_2_end_cactch)          /* address of ObjC 2.0 objc_end_catch() */
     197         _rnode(short_float_zero)  /* low half of 1.0d0 */
     198         _rnode(double_float_one)  /* high half of 1.0d0 */
     199         _rnode(static_cons_area)       /* static_cons_area */
     200         _rnode(lisp_exit_hook) /* install foreign exception handling */
     201         _rnode(oldest_ephemeral)  /* doubleword address of oldest ephemeral object or 0 */
     202         _rnode(tenured_area)      /* the tenured area */
     203         _rnode(ref_base)          /* start of oldest pointer-bearing area */
     204         _rnode(argv)              /* pointer to &argv[0] */
     205         _rnode(host_platform)  /* for platform-specific initialization */
     206         _rnode(batch_flag)     /* -b arg */
     207         _rnode(unwind_resume)  /* address of _Unwind_Resume from libobjc */
     208         _rnode(weak_gc_method) /* weak GC algorithm */
     209         _rnode(image_name)     /* --image-name arg */
     210         _rnode(initial_tcr)    /* initial thread tcr */
     211         _rnode(weakvll)           /* all populations as of last GC */
     212         _rnode(managed_static_refbits) /* refs from managed_static to dynamic */
     213         _rnode(managed_static_dnodes) /* ndnodes in managed_static_area */
     214        _ends
     215
     216/* Traditional name, differs from C */
     217        .set lisp_globals.ret1val_addr,lisp_globals.ret1valn
     218       
  • trunk/source/lisp-kernel/m4macros.m4

    r15111 r15370  
    253253/*  _field(name,size)   */
    254254define(`_field',`_struct_label($1) _struct_pad($2)')
     255/* predecrement */
     256define(`_rfield',`_struct_pad(-$2) _struct_label($1)')
    255257
    256258define(`_halfword', `_field($1, 2)')
     
    258260define(`_dword',`_field($1, 8)')
    259261define(`_node', `_field($1, node_size)')
     262define(`_rnode', `_rfield($1, node_size)')
     263
    260264
    261265define(`_ends',`ifdef(`_struct_fixed_size_name',`
  • trunk/source/lisp-kernel/memory.c

    r15366 r15370  
    781781      /* Everything's in the dynamic area */
    782782      lisp_global(OLDEST_EPHEMERAL) = 0;
    783       lisp_global(OLDSPACE_DNODE_COUNT) = area_dnode(managed_static_area->active,managed_static_area->low);
     783      lisp_global(OLDSPACE_DNODE_COUNT) = 0;
    784784
    785785    }
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r15366 r15370  
    21102110    egc_control(true, NULL);
    21112111  } else {
    2112     lisp_global(OLDSPACE_DNODE_COUNT) = area_dnode(managed_static_area->active,managed_static_area->low);
    2113   }
    2114 #ifdef X86
     2112    lisp_global(OLDSPACE_DNODE_COUNT) = 0;
     2113  }
    21152114  lisp_global(MANAGED_STATIC_REFBITS) = (LispObj)managed_static_refbits;
    21162115  lisp_global(MANAGED_STATIC_DNODES) = (LispObj)managed_static_area->ndnodes;
    2117 #endif
    21182116  atexit(lazarus);
    21192117#ifdef ARM
     
    27432741    egc_control(true, NULL);
    27442742  } else {
    2745     lisp_global(OLDSPACE_DNODE_COUNT) = area_dnode(managed_static_area->active,managed_static_area->low);
     2743    lisp_global(OLDSPACE_DNODE_COUNT) = 0;
    27462744  }
    27472745
  • trunk/source/lisp-kernel/ppc-constants.s

    r13337 r15370  
    184184')
    185185
    186 num_lisp_globals = 49            /* MUST UPDATE THIS !!! */
    187186       
    188         _struct(lisp_globals,lisp_globals_limit-(num_lisp_globals*node_size))
    189          _node(weakvll)                 /* all populations as of last GC */
    190          _node(initial_tcr)             /* initial thread tcr */
    191          _node(image_name)              /* --image-name argument */
    192          _node(BADfpscr_save_high)      /* high word of FP reg used to save FPSCR */
    193          _node(unwind_resume)           /* _Unwind_Resume */
    194          _node(batch_flag)              /* -b */
    195          _node(host_platform)           /* for runtime platform-specific stuff */
    196          _node(argv)                    /* address of argv`0' */
    197          _node(ref_base)                        /* start of oldest pointer-bearing area */
    198          _node(tenured_area)            /* the tenured_area */
    199          _node(oldest_ephemeral)        /* dword address of oldest ephemeral object or 0 */
    200          _node(lisp_exit_hook)          /* install foreign exception_handling */
    201          _node(lisp_return_hook)        /* install lisp exception_handling */
    202          _node(double_float_one)        /* high half of 1.0d0 */
    203          _node(short_float_zero)        /* low half of 1.0d0 */
    204          _node(objc2_end_catch)         /* objc_end_catch() */
    205          _node(metering_info)           /* address of lisp_metering global */
    206          _node(in_gc)                   /* non-zero when GC active */
    207          _node(lexpr_return1v)          /* simpler when &lexpr called for single value. */
    208          _node(lexpr_return)            /* magic &lexpr return code. */
    209          _node(all_areas)               /* doubly-linked list of all memory areas */
    210          _node(kernel_path)             /* real executable name */
    211          _node(objc2_begin_catch)       /* objc_begin_catch */
    212          _node(stack_size)              /* from command-line */
    213          _node(statically_linked)       /* non-zero if -static */
    214          _node(heap_end)                /* end of lisp heap */
    215          _node(heap_start)              /* start of lisp heap */
    216          _node(gcable_pointers)         /* linked-list of weak macptrs. */
    217          _node(gc_num)                  /* fixnum: GC call count. */
    218          _node(fwdnum)                  /* fixnum: GC "forwarder" call count. */
    219          _node(altivec_present)         /* non-zero when AltiVec available */
    220          _node(oldspace_dnode_count)    /* dynamic dnodes older than g0 start */
    221          _node(refbits)                 /* EGC refbits */
    222          _node(gc_inhibit_count)
    223          _node(intflag)                 /* sigint pending */
    224          _node(BAD_block_tag_counter)   /* counter for (immediate) block tag */
    225          _node(deleted_static_pairs)           
    226          _node(exception_lock)
    227          _node(area_lock)
    228          _node(tcr_key)                 /* tsd key for per-thread tcr */
    229          _node(ret1val_addr)            /* address of "dynamic" subprims magic values return addr */
    230          _node(subprims_base)           /* address of dynamic subprims jump table */
    231          _node(saveR13)                 /* probably don't really need this */
    232          _node(saveTOC)                 /* where the 68K emulator stores the  emulated regs */
    233          _node(objc_2_personality)      /* exception "personality routine" address for ObjC 2.0 */
    234          _node(kernel_imports)          /* some things we need imported for us */
    235          _node(interrupt_signal)        /* signal used by PROCESS-INTERRUPT */
    236          _node(tcr_count)               /* tcr_id for next tcr */
    237          _node(get_tcr)                 /* address of get_tcr() */
    238         _ends
    239        
  • trunk/source/lisp-kernel/ppc-exceptions.c

    r14876 r15370  
    516516      if (selector & GC_TRAP_FUNCTION_PURIFY) {
    517517        purify_from_xp(xp, 0L);
    518         lisp_global(OLDSPACE_DNODE_COUNT) = area_dnode(managed_static_area->active, managed_static_area->low);
     518        lisp_global(OLDSPACE_DNODE_COUNT) = 0;
    519519        gc_from_xp(xp, 0L);
    520520      }
  • trunk/source/lisp-kernel/x86-constants.s

    r15366 r15370  
    6666define(`seen_aok_bit',`28')       
    6767       
    68 num_lisp_globals = 49            /* MUST UPDATE THIS !!!   */
    69        
    70         _struct(lisp_globals,lisp_globals_limit-(num_lisp_globals*node_size))
    71          _node(weakvll)                 /* all populations as of last GC */
    72          _node(initial_tcr)             /* initial thread tcr */
    73          _node(image_name)              /* --image-name argument */
    74          _node(weak_gc_method)          /* for weak vector marking */
    75          _node(unwind_resume)           /* _Unwind_Resume */
    76          _node(batch_flag)              /* -b */
    77          _node(host_platform)           /* for runtime platform-specific stuff   */
    78          _node(argv)                    /* address of argv`0'   */
    79          _node(ref_base)                /* start of oldest pointer-bearing area */
    80          _node(tenured_area)            /* the tenured_area   */
    81          _node(oldest_ephemeral)        /* dword address of oldest ephemeral object or 0   */
    82          _node(lisp_exit_hook)          /* install foreign exception_handling   */
    83          _node(lisp_return_hook)        /* install lisp exception_handling   */
    84          _node(double_float_one)        /* high half of 1.0d0   */
    85          _node(short_float_zero)        /* low half of 1.0d0   */
    86          _node(objc2_end_catch)         /* objc_end_catch()  */
    87          _node(metering_info)           /* address of lisp_metering global   */
    88          _node(in_gc)                   /* non-zero when GC active   */
    89          _node(lexpr_return1v)          /* simpler when &lexpr called for single value.   */
    90          _node(lexpr_return)            /* magic &lexpr return code.   */
    91          _node(all_areas)               /* doubly-linked list of all memory areas   */
    92          _node(kernel_path)             /* real executable name */
    93          _node(objc2_begin_catch)       /* objc_begin_catch   */
    94          _node(stack_size)              /* from the command line */
    95          _node(statically_linked)       /* non-zero if -static   */
    96          _node(heap_end)                /* end of lisp heap   */
    97          _node(heap_start)              /* start of lisp heap   */
    98          _node(gcable_pointers)         /* linked-list of weak macptrs.   */
    99          _node(gc_num)                  /* fixnum: GC call count.   */
    100          _node(fwdnum)                  /* fixnum: GC "forwarder" call count.   */
    101          _node(altivec_present)         /* non-zero when AltiVec available   */
    102          _node(oldspace_dnode_count)    /* dynamic dnodes older than g0 start   */
    103          _node(refbits)                 /* EGC refbits   */
    104          _node(gc_inhibit_count)
    105          _node(intflag)                 /* sigint pending   */
    106          _node(default_allocation_quantum)      /* for per-thread allocation   */
    107          _node(deleted_static_pairs)           
    108          _node(exception_lock)
    109          _node(area_lock)
    110          _node(tcr_key)                 /* tsd key for per-thread tcr   */
    111          _node(ret1val_addr)            /* address of "dynamic" subprims magic values return addr   */
    112          _node(subprims_base)           /* address of dynamic subprims jump table   */
    113         __ifdef(`X86')
    114          _node(managed_static_dnodes)   /* ndnodes of managed_static_area */
    115          _node(managed_static_refbits)  /* refs from managed_static to dynamic */
    116         __else               
    117          _node(saveR13)                 /* probably don't really need this   */
    118          _node(saveTOC)                 /* where the 68K emulator stores the  emulated regs   */
    119         __endif       
    120          _node(objc_2_personality)              /* exception "personality routine" address for ObjC 2.0 */
    121          _node(kernel_imports)          /* some things we need imported for us   */
    122          _node(interrupt_signal)        /* signal used by PROCESS-INTERRUPT   */
    123          _node(tcr_count)               /* tcr_id for next tcr   */
    124          _node(get_tcr)                 /* address of get_tcr()  */
    125         _ends
    12668       
    12769       
  • trunk/source/lisp-kernel/x86-exceptions.c

    r15366 r15370  
    358358      if (selector & GC_TRAP_FUNCTION_PURIFY) {
    359359        purify_from_xp(xp, 1);
    360         lisp_global(OLDSPACE_DNODE_COUNT) = area_dnode(managed_static_area->active, managed_static_area->low);
     360        lisp_global(OLDSPACE_DNODE_COUNT) = 0;
    361361        gc_from_xp(xp, 0L);
    362362      }
Note: See TracChangeset for help on using the changeset viewer.