Changeset 14146


Ignore:
Timestamp:
Aug 5, 2010, 2:41:13 PM (9 years ago)
Author:
gb
Message:

Common struct defs, #defines in constants.h.

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

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/ppc-constants32.h

    r13627 r14146  
    7676
    7777
    78 /*  Order of CAR and CDR doesn't seem to matter much - there aren't */
    79 /*  too many tricks to be played with predecrement/preincrement addressing. */
    80 /*  Keep them in the confusing MCL 3.0 order, to avoid confusion. */
    81 
    82 typedef struct cons {
    83   LispObj cdr;
    84   LispObj car;
    85 } cons;
    8678
    8779
     
    196188/*  The objects themselves look something like this: */
    197189
    198 typedef struct lispsymbol {
    199   LispObj header;
    200   LispObj pname;
    201   LispObj vcell;
    202   LispObj fcell;
    203   LispObj package_predicate;
    204   LispObj flags;
    205   LispObj plist;
    206   LispObj binding_index;
    207 } lispsymbol;
    208 
    209 typedef struct ratio {
    210   LispObj header;
    211   LispObj numer;
    212   LispObj denom;
    213 } ratio;
    214 
    215190typedef struct double_float {
    216191  LispObj header;
     
    225200} single_float;
    226201
    227 typedef struct macptr {
    228   LispObj header;
    229   LispObj address;
    230   LispObj class;
    231   LispObj type;
    232 } macptr;
    233 
    234 typedef struct xmacptr {
    235   LispObj header;
    236   LispObj address;
    237   LispObj class;
    238   LispObj type;
    239   LispObj flags;
    240   LispObj link;
    241 } xmacptr;
    242202 
    243203
     
    266226} lisp_frame;
    267227
    268 typedef struct special_binding {
    269   struct special_binding *link;
    270   struct lispsymbol *sym;
    271   LispObj value;
    272 } special_binding;
    273 
    274 /* The GC (at least) needs to know what a
    275    package looks like, so that it can do GCTWA. */
    276 typedef struct package {
    277   LispObj header;
    278   LispObj itab;                 /* itab and etab look like (vector (fixnum . fixnum) */
    279   LispObj etab;
    280   LispObj used;
    281   LispObj used_by;
    282   LispObj names;
    283   LispObj shadowed;
    284 } package;
    285228
    286229/*
     
    321264#define fixnum_bitmask(n)  (1<<((n)+fixnumshift))
    322265
    323 /*
    324   The GC (at least) needs to know about hash-table-vectors and their flag bits.
    325 */
    326 
    327 typedef struct hash_table_vector_header {
    328   LispObj header;
    329   LispObj link;                 /* If weak */
    330   LispObj flags;                /* a fixnum; see below */
    331   LispObj gc_count;             /* gc-count kernel global */
    332   LispObj free_alist;           /* preallocated conses for finalization_alist */
    333   LispObj finalization_alist;   /* key/value alist for finalization */
    334   LispObj weak_deletions_count; /* incremented when GC deletes weak pair */
    335   LispObj hash;                 /* backpointer to hash-table */
    336   LispObj deleted_count;        /* number of deleted entries [not maintained if lock-free] */
    337   LispObj count;                /* number of valid entries [not maintained if lock-free] */
    338   LispObj cache_idx;            /* index of last cached pair */
    339   LispObj cache_key;            /* value of last cached key */
    340   LispObj cache_value;          /* last cached value */
    341   LispObj size;                 /* number of entries in table */
    342   LispObj size_reciprocal;      /* shifted reciprocal of size */
    343 } hash_table_vector_header;
    344 
    345 /*
    346   Bits (masks)  in hash_table_vector.flags:
    347 */
    348 
    349 /* GC should track keys when addresses change */
    350 #define nhash_track_keys_mask fixnum_bitmask(28)
    351 
    352 /* GC should set when nhash_track_keys_bit & addresses change */
    353 #define nhash_key_moved_mask  fixnum_bitmask(27)
    354 
    355 /* weak on key or value (need new "weak both" encoding.) */
    356 #define nhash_weak_mask       fixnum_bitmask(12)
    357 
    358 /* weak on value */
    359 #define nhash_weak_value_mask fixnum_bitmask(11)
    360 
    361 /* finalizable */
    362 #define nhash_finalizable_mask fixnum_bitmask(10)
    363 
    364 /* keys frozen, i.e. don't clobber keys, only values */
    365 #define nhash_keys_frozen_mask fixnum_bitmask(9)
    366 
    367 /* Lfun bits */
    368 
    369 #define lfbits_nonnullenv_mask fixnum_bitmask(0)
    370 #define lfbits_keys_mask fixnum_bitmask(1)
    371 #define lfbits_restv_mask fixnum_bitmask(7)
    372 #define lfbits_optinit_mask fixnum_bitmask(14)
    373 #define lfbits_rest_mask fixnum_bitmask(15)
    374 #define lfbits_aok_mask fixnum_bitmask(16)
    375 #define lfbits_lap_mask fixnum_bitmask(23)
    376 #define lfbits_trampoline_mask fixnum_bitmask(24)
    377 #define lfbits_evaluated_mask fixnum_bitmask(25)
    378 #define lfbits_cm_mask fixnum_bitmask(26)         /* combined_method */
    379 #define lfbits_nextmeth_mask fixnum_bitmask(26)   /* or call_next_method with method_mask */
    380 #define lfbits_gfn_mask fixnum_bitmask(27)        /* generic_function */
    381 #define lfbits_nextmeth_with_args_mask fixnum_bitmask(27)   /* or call_next_method_with_args with method_mask */
    382 #define lfbits_method_mask fixnum_bitmask(28)     /* method function */
    383 /* PPC only but want it defined for xcompile */
    384 #define lfbits_noname_mask fixnum_bitmask(29)
    385 
    386 
    387 /* Creole */
    388 
    389 #define doh_quantum 400
    390 #define doh_block_slots ((doh_quantum >> 2) - 3)
    391 
    392 typedef struct doh_block {
    393   struct doh_block *link;
    394   unsigned size;
    395   unsigned free;
    396   LispObj data[doh_block_slots];
    397 } doh_block, *doh_block_ptr;
    398 
    399 
    400 #define population_weak_list (0<<fixnum_shift)
    401 #define population_weak_alist (1<<fixnum_shift)
    402 #define population_termination_bit (16+fixnum_shift)
    403 #define population_type_mask ((1<<population_termination_bit)-1)
    404 
    405 #define gc_retain_pages_bit fixnum_bitmask(0)
    406 #define gc_integrity_check_bit fixnum_bitmask(2)
    407 #define egc_verbose_bit fixnum_bitmask(3)
    408 #define gc_verbose_bit fixnum_bitmask(4)
    409 #define gc_allow_stack_overflows_bit fixnum_bitmask(5)
    410 #define gc_postgc_pending fixnum_bitmask(26)
    411266
    412267#include "lisp-errors.h"
  • trunk/source/lisp-kernel/ppc-constants64.h

    r13627 r14146  
    173173/* The objects themselves look something like this: */
    174174
    175 /*  Order of CAR and CDR doesn't seem to matter much - there aren't */
    176 /*  too many tricks to be played with predecrement/preincrement addressing. */
    177 /*  Keep them in the confusing MCL 3.0 order, to avoid confusion. */
    178 
    179 typedef struct cons {
    180   LispObj cdr;
    181   LispObj car;
    182 } cons;
    183 
    184 
    185 
    186 typedef struct lispsymbol {
    187   LispObj header;
    188   LispObj pname;
    189   LispObj vcell;
    190   LispObj fcell;
    191   LispObj package_predicate;
    192   LispObj flags;
    193   LispObj plist;
    194   LispObj binding_index;
    195 } lispsymbol;
    196 
    197 typedef struct ratio {
    198   LispObj header;
    199   LispObj numer;
    200   LispObj denom;
    201 } ratio;
    202 
    203175typedef struct double_float {
    204176  LispObj header;
     
    207179
    208180
    209 typedef struct macptr {
    210   LispObj header;
    211   LispObj address;
    212   LispObj class;
    213   LispObj type;
    214 } macptr;
    215 
    216 typedef struct xmacptr {
    217   LispObj header;
    218   LispObj address;
    219   LispObj class;
    220   LispObj type;
    221   LispObj flags;
    222   LispObj link;
    223 } xmacptr;
    224  
    225181
    226182typedef struct eabi_c_frame {
     
    248204} lisp_frame;
    249205
    250 typedef struct special_binding {
    251   struct special_binding *link;
    252   struct lispsymbol *sym;
    253   LispObj value;
    254 } special_binding;
    255 
    256 /* The GC (at least) needs to know what a
    257    package looks like, so that it can do GCTWA. */
    258 typedef struct package {
    259   LispObj header;
    260   LispObj itab;                 /* itab and etab look like (vector (fixnum . fixnum) */
    261   LispObj etab;
    262   LispObj used;
    263   LispObj used_by;
    264   LispObj names;
    265   LispObj shadowed;
    266 } package;
    267206
    268207/*
     
    296235#define fixnum_bitmask(n)  (1LL<<((n)+fixnumshift))
    297236
    298 /*
    299   The GC (at least) needs to know about hash-table-vectors and their flag bits.
    300 */
    301 
    302 typedef struct hash_table_vector_header {
    303   LispObj header;
    304   LispObj link;                 /* If weak */
    305   LispObj flags;                /* a fixnum; see below */
    306   LispObj gc_count;             /* gc-count kernel global */
    307   LispObj free_alist;           /* preallocated conses for finalization_alist */
    308   LispObj finalization_alist;   /* key/value alist for finalization */
    309   LispObj weak_deletions_count; /* incremented when GC deletes weak pair */
    310   LispObj hash;                 /* backpointer to hash-table */
    311   LispObj deleted_count;        /* number of deleted entries [not maintained if lock-free] */
    312   LispObj count;                /* number of valid entries [not maintained if lock-free] */
    313   LispObj cache_idx;            /* index of last cached pair */
    314   LispObj cache_key;            /* value of last cached key */
    315   LispObj cache_value;          /* last cached value */
    316   LispObj size;                 /* number of entries in table */
    317   LispObj size_reciprocal;      /* shifted reciprocal of size */
    318 } hash_table_vector_header;
    319 
    320 /*
    321   Bits (masks)  in hash_table_vector.flags:
    322 */
    323 
    324 /* GC should track keys when addresses change */
    325 #define nhash_track_keys_mask fixnum_bitmask(28)
    326 
    327 /* GC should set when nhash_track_keys_bit & addresses change */
    328 #define nhash_key_moved_mask  fixnum_bitmask(27)
    329 
    330 /* weak on key or value (need new "weak both" encoding.) */
    331 #define nhash_weak_mask       fixnum_bitmask(12)
    332 
    333 /* weak on value */
    334 #define nhash_weak_value_mask fixnum_bitmask(11)
    335 
    336 /* finalizable */
    337 #define nhash_finalizable_mask fixnum_bitmask(10)
    338 
    339 /* keys frozen, i.e. don't clobber keys, only values */
    340 #define nhash_keys_frozen_mask fixnum_bitmask(9)
    341 
    342 /* Lfun bits */
    343 
    344 #define lfbits_nonnullenv_mask fixnum_bitmask(0)
    345 #define lfbits_keys_mask fixnum_bitmask(1)
    346 #define lfbits_restv_mask fixnum_bitmask(7)
    347 #define lfbits_optinit_mask fixnum_bitmask(14)
    348 #define lfbits_rest_mask fixnum_bitmask(15)
    349 
    350 #define lfbits_aok_mask fixnum_bitmask(16)
    351 #define lfbits_lap_mask fixnum_bitmask(23)
    352 #define lfbits_trampoline_mask fixnum_bitmask(24)
    353 #define lfbits_evaluated_mask fixnum_bitmask(25)
    354 #define lfbits_cm_mask fixnum_bitmask(26)         /* combined_method */
    355 #define lfbits_nextmeth_mask fixnum_bitmask(26)   /* or call_next_method with method_mask */
    356 #define lfbits_gfn_mask fixnum_bitmask(27)        /* generic_function */
    357 #define lfbits_nextmeth_with_args_mask fixnum_bitmask(27)   /* or call_next_method_with_args with method_mask */
    358 #define lfbits_method_mask fixnum_bitmask(28)     /* method function */
    359 /* PPC only but want it defined for xcompile */
    360 #define lfbits_noname_mask fixnum_bitmask(29)
    361 
    362 
    363 /* Creole */
    364 
    365 #define doh_quantum 400
    366 #define doh_block_slots ((doh_quantum >> 2) - 3)
    367 
    368 typedef struct doh_block {
    369   struct doh_block *link;
    370   unsigned size;
    371   unsigned free;
    372   LispObj data[doh_block_slots];
    373 } doh_block, *doh_block_ptr;
    374 
    375 
    376 #define population_weak_list (0<<fixnum_shift)
    377 #define population_weak_alist (1<<fixnum_shift)
    378 #define population_termination_bit (16+fixnum_shift)
    379 #define population_type_mask ((1<<population_termination_bit)-1)
    380 
    381 #define gc_retain_pages_bit fixnum_bitmask(0)
    382 #define gc_integrity_check_bit fixnum_bitmask(2)
    383 #define egc_verbose_bit fixnum_bitmask(3)
    384 #define gc_verbose_bit fixnum_bitmask(4)
    385 #define gc_allow_stack_overflows_bit fixnum_bitmask(5)
    386 #define gc_postgc_pending fixnum_bitmask(26)
    387237
    388238#include "lisp-errors.h"
Note: See TracChangeset for help on using the changeset viewer.