Changeset 13717


Ignore:
Timestamp:
May 23, 2010, 1:41:51 AM (9 years ago)
Author:
gb
Message:

Try to move platform-independent definitions to constants.h, to
lessen redundancy a bit. (Should do this on trunk, too.)

Location:
branches/arm/lisp-kernel
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/arm/lisp-kernel/arm-constants.h

    r13671 r13717  
    1818#include "constants.h"
    1919
    20 #define fn 0
    21 #define vsp 1
    22 #define arg_z 2
    23 #define arg_y 3
    24 #define arg_x 4
    25 #define temp0 5
    26 #define temp1 6
    27 #define temp2 7
    28 #define imm0 8
    29 #define imm1 9
    30 #define imm2 10
    31 #define rcontext 11
     20#define imm0    0
     21#define imm1    1
     22#define imm2    2
     23#define rcontext 3
     24#define arg_z    4
     25#define arg_y    5
     26#define arg_x    6
     27#define temp0    7
     28#define temp1    8
     29#define temp2    9
     30#define vsp      10
     31#define fn      11
    3232#define allocptr 12
    33 #define sp 13
    34 #define lr 14
    35 #define pc 15
     33#define Rsp      13
     34#define Rlr      14
     35#define Rpc      15
    3636
    3737#define fname temp1
     
    239239#define catch_frame_header make_header(subtag_catch_frame,catch_frame_element_count)
    240240
     241typedef struct lisp_frame {
     242  LispObj marker;
     243  LispObj savevsp;
     244  LispObj savefn;
     245  LispObj savelr;
     246} lisp_frame;
     247
     248
     249#define lisp_frame_marker SUBTAG(fulltag_imm,2)
    241250#define unbound SUBTAG(fulltag_imm, 6)
    242251#define undefined unbound
     
    261270
    262271#define nil_value (0x10000000+fulltag_nil)
     272
    263273
    264274#define TCR_BIAS (0)
     
    319329#define log2_heap_segment_size 16
    320330
    321 
    322 
    323 
    324 
    325 
     331#define STATIC_BASE_ADDRESS 0x0ffff000
     332
     333
     334
  • branches/arm/lisp-kernel/constants.h

    r13629 r13717  
    3434
    3535#define INTERRUPT_LEVEL_BINDING_INDEX (1)
     36
     37/*  Order of CAR and CDR doesn't seem to matter much - there aren't */
     38/*  too many tricks to be played with predecrement/preincrement addressing. */
     39/*  Keep them in the confusing MCL 3.0 order, to avoid confusion. */
     40
     41typedef struct cons {
     42  LispObj cdr;
     43  LispObj car;
     44} cons;
     45
     46
     47
     48typedef struct lispsymbol {
     49  LispObj header;
     50  LispObj pname;
     51  LispObj vcell;
     52  LispObj fcell;
     53  LispObj package_predicate;
     54  LispObj flags;
     55  LispObj plist;
     56  LispObj binding_index;
     57} lispsymbol;
     58
     59typedef struct ratio {
     60  LispObj header;
     61  LispObj numer;
     62  LispObj denom;
     63} ratio;
     64
     65typedef struct macptr {
     66  LispObj header;
     67  LispObj address;
     68  LispObj class;
     69  LispObj type;
     70} macptr;
     71
     72typedef struct xmacptr {
     73  LispObj header;
     74  LispObj address;
     75  LispObj class;
     76  LispObj type;
     77  LispObj flags;
     78  LispObj link;
     79} xmacptr;
     80 
     81
     82
     83typedef struct special_binding {
     84  struct special_binding *link;
     85  struct lispsymbol *sym;
     86  LispObj value;
     87} special_binding;
     88
     89
     90/* The GC (at least) needs to know what a
     91   package looks like, so that it can do GCTWA. */
     92typedef struct package {
     93  LispObj header;
     94  LispObj itab;                 /* itab and etab look like (vector (fixnum . fixnum) */
     95  LispObj etab;
     96  LispObj used;
     97  LispObj used_by;
     98  LispObj names;
     99  LispObj shadowed;
     100} package;
     101
     102
     103/*
     104  The GC (at least) needs to know about hash-table-vectors and their flag bits.
     105*/
     106
     107typedef struct hash_table_vector_header {
     108  LispObj header;
     109  LispObj link;                 /* If weak */
     110  LispObj flags;                /* a fixnum; see below */
     111  LispObj gc_count;             /* gc-count kernel global */
     112  LispObj free_alist;           /* preallocated conses for finalization_alist */
     113  LispObj finalization_alist;   /* key/value alist for finalization */
     114  LispObj weak_deletions_count; /* incremented when GC deletes weak pair */
     115  LispObj hash;                 /* backpointer to hash-table */
     116  LispObj deleted_count;        /* number of deleted entries [not maintained if lock-free] */
     117  LispObj count;                /* number of valid entries [not maintained if lock-free] */
     118  LispObj cache_idx;            /* index of last cached pair */
     119  LispObj cache_key;            /* value of last cached key */
     120  LispObj cache_value;          /* last cached value */
     121  LispObj size;                 /* number of entries in table */
     122  LispObj size_reciprocal;      /* shifted reciprocal of size */
     123} hash_table_vector_header;
     124
     125
     126
     127/*
     128  Bits (masks)  in hash_table_vector.flags:
     129*/
     130
     131/* GC should track keys when addresses change */
     132#define nhash_track_keys_mask fixnum_bitmask(28)
     133
     134/* GC should set when nhash_track_keys_bit & addresses change */
     135#define nhash_key_moved_mask  fixnum_bitmask(27)
     136
     137/* weak on key or value (need new "weak both" encoding.) */
     138#define nhash_weak_mask       fixnum_bitmask(12)
     139
     140/* weak on value */
     141#define nhash_weak_value_mask fixnum_bitmask(11)
     142
     143/* finalizable */
     144#define nhash_finalizable_mask fixnum_bitmask(10)
     145
     146/* keys frozen, i.e. don't clobber keys, only values */
     147#define nhash_keys_frozen_mask fixnum_bitmask(9)
     148
     149/* Lfun bits */
     150
     151#define lfbits_nonnullenv_mask fixnum_bitmask(0)
     152#define lfbits_keys_mask fixnum_bitmask(1)
     153#define lfbits_restv_mask fixnum_bitmask(7)
     154#define lfbits_optinit_mask fixnum_bitmask(14)
     155#define lfbits_rest_mask fixnum_bitmask(15)
     156#define lfbits_aok_mask fixnum_bitmask(16)
     157#define lfbits_lap_mask fixnum_bitmask(23)
     158#define lfbits_trampoline_mask fixnum_bitmask(24)
     159#define lfbits_evaluated_mask fixnum_bitmask(25)
     160#define lfbits_cm_mask fixnum_bitmask(26)         /* combined_method */
     161#define lfbits_nextmeth_mask fixnum_bitmask(26)   /* or call_next_method with method_mask */
     162#define lfbits_gfn_mask fixnum_bitmask(27)        /* generic_function */
     163#define lfbits_nextmeth_with_args_mask fixnum_bitmask(27)   /* or call_next_method_with_args with method_mask */
     164#define lfbits_method_mask fixnum_bitmask(28)     /* method function */
     165#define lfbits_noname_mask fixnum_bitmask(29)
     166
     167
     168#define population_weak_list (0<<fixnum_shift)
     169#define population_weak_alist (1<<fixnum_shift)
     170#define population_termination_bit (16+fixnum_shift)
     171#define population_type_mask ((1<<population_termination_bit)-1)
     172
     173#define gc_retain_pages_bit fixnum_bitmask(0)
     174#define gc_integrity_check_bit fixnum_bitmask(2)
     175#define egc_verbose_bit fixnum_bitmask(3)
     176#define gc_verbose_bit fixnum_bitmask(4)
     177#define gc_allow_stack_overflows_bit fixnum_bitmask(5)
     178#define gc_postgc_pending fixnum_bitmask(26)
     179
  • branches/arm/lisp-kernel/ppc-constants32.h

    r13629 r13717  
    196196/*  The objects themselves look something like this: */
    197197
    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 
    215198typedef struct double_float {
    216199  LispObj header;
     
    225208} single_float;
    226209
    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;
    242210 
    243211
     
    266234} lisp_frame;
    267235
    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;
    285236
    286237/*
     
    321272#define fixnum_bitmask(n)  (1<<((n)+fixnumshift))
    322273
    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)
    411274
    412275#include "lisp-errors.h"
  • branches/arm/lisp-kernel/ppc-constants64.h

    r13629 r13717  
    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;
     
    248220} lisp_frame;
    249221
    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;
    267222
    268223/*
     
    296251#define fixnum_bitmask(n)  (1LL<<((n)+fixnumshift))
    297252
    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)
    387253
    388254#include "lisp-errors.h"
  • branches/arm/lisp-kernel/x86-constants32.h

    r13629 r13717  
    215215#define subtag_function_boundary_marker SUBTAG(fulltag_imm,31)
    216216#define function_boundary_marker subtag_function_boundary_marker
    217 
    218 typedef struct cons {
    219     LispObj cdr;
    220     LispObj car;
    221 } cons;
    222 
    223 typedef struct lispsymbol {
    224     LispObj header;
    225     LispObj pname;
    226     LispObj vcell;
    227     LispObj fcell;
    228     LispObj package_predicate;
    229     LispObj flags;
    230     LispObj plist;
    231     LispObj binding_index;
    232 } lispsymbol;
    233 
    234 typedef struct ratio {
    235     LispObj header;
    236     LispObj numer;
    237     LispObj denom;
    238 } ratio;
    239 
    240217typedef struct double_float {
    241218    LispObj header;
     
    250227} single_float;
    251228
    252 typedef struct macptr {
    253     LispObj header;
    254     LispObj address;
    255     LispObj class;
    256     LispObj type;
    257 } macptr;
    258 
    259 typedef struct xmacptr {
    260     LispObj header;
    261     LispObj address;
    262     LispObj class;
    263     LispObj type;
    264     LispObj flags;
    265     LispObj link;
    266 } xmacptr;
    267 
    268 typedef struct special_binding {
    269     struct special_binding *link;
    270     struct lispsymbol *sym;
    271     LispObj value;
    272 } special_binding;
    273229
    274230typedef struct lisp_frame {
     
    290246} xcf;
    291247
    292 /* The GC (at least) needs to know what a
    293    package looks like, so that it can do GCTWA. */
    294 typedef struct package {
    295     LispObj header;
    296     LispObj itab;               /* itab and etab look like (vector (fixnum . fixnum) */
    297     LispObj etab;
    298     LispObj used;
    299     LispObj used_by;
    300     LispObj names;
    301     LispObj shadowed;
    302 } package;
    303248
    304249typedef struct catch_frame {
     
    329274#define fixnum_bitmask(n)  (1<<((n)+fixnumshift))
    330275
    331 /*
    332   The GC (at least) needs to know about hash-table-vectors and their flag bits.
    333 */
    334 
    335 typedef struct hash_table_vector_header {
    336   LispObj header;
    337   LispObj link;                 /* If weak */
    338   LispObj flags;                /* a fixnum; see below */
    339   LispObj gc_count;             /* gc-count kernel global */
    340   LispObj free_alist;           /* preallocated conses for finalization_alist */
    341   LispObj finalization_alist;   /* key/value alist for finalization */
    342   LispObj weak_deletions_count; /* incremented when GC deletes weak pair */
    343   LispObj hash;                 /* backpointer to hash-table */
    344   LispObj deleted_count;        /* number of deleted entries [not maintained if lock-free] */
    345   LispObj count;                /* number of valid entries [not maintained if lock-free] */
    346   LispObj cache_idx;            /* index of last cached pair */
    347   LispObj cache_key;            /* value of last cached key */
    348   LispObj cache_value;          /* last cached value */
    349   LispObj size;                 /* number of entries in table */
    350   LispObj size_reciprocal;      /* shifted reciprocal of size */
    351 } hash_table_vector_header;
    352 
    353 /*
    354   Bits (masks) in hash_table_vector.flags:
    355 */
    356 
    357 /* GC should track keys when addresses change */
    358 #define nhash_track_keys_mask fixnum_bitmask(28)
    359 
    360 /* GC should set when nhash_track_keys_bit & addresses change */
    361 #define nhash_key_moved_mask  fixnum_bitmask(27)
    362 
    363 /* weak on key or value (need new "weak both" encoding.) */
    364 #define nhash_weak_mask       fixnum_bitmask(12)
    365 
    366 /* weak on value */
    367 #define nhash_weak_value_mask fixnum_bitmask(11)
    368 
    369 /* finalizable */
    370 #define nhash_finalizable_mask fixnum_bitmask(10)
    371 
    372 /* keys frozen, i.e. don't clobber keys, only values */
    373 #define nhash_keys_frozen_mask fixnum_bitmask(9)
    374 
    375 /* Lfun bits */
    376 
    377 #define lfbits_nonnullenv_mask fixnum_bitmask(0)
    378 #define lfbits_keys_mask fixnum_bitmask(1)
    379 #define lfbits_restv_mask fixnum_bitmask(7)
    380 #define lfbits_optinit_mask fixnum_bitmask(14)
    381 #define lfbits_rest_mask fixnum_bitmask(15)
    382 #define lfbits_aok_mask fixnum_bitmask(16)
    383 #define lfbits_lap_mask fixnum_bitmask(23)
    384 #define lfbits_trampoline_mask fixnum_bitmask(24)
    385 #define lfbits_evaluated_mask fixnum_bitmask(25)
    386 #define lfbits_cm_mask fixnum_bitmask(26)         /* combined_method */
    387 #define lfbits_nextmeth_mask fixnum_bitmask(26)   /* or call_next_method with method_mask */
    388 #define lfbits_gfn_mask fixnum_bitmask(27)        /* generic_function */
    389 #define lfbits_nextmeth_with_args_mask fixnum_bitmask(27)   /* or call_next_method_with_args with method_mask */
    390 #define lfbits_method_mask fixnum_bitmask(28)     /* method function */
    391 /* PPC only but want it defined for xcompile */
    392 #define lfbits_noname_mask fixnum_bitmask(29)
    393 
    394 
    395 /* Creole */
    396 
    397 #define doh_quantum 400
    398 #define doh_block_slots ((doh_quantum >> 2) - 3)
    399 
    400 typedef struct doh_block {
    401   struct doh_block *link;
    402   unsigned size;
    403   unsigned free;
    404   LispObj data[doh_block_slots];
    405 } doh_block, *doh_block_ptr;
    406 
    407 #define population_weak_list (0<<fixnum_shift)
    408 #define population_weak_alist (1<<fixnum_shift)
    409 #define population_termination_bit (16+fixnum_shift)
    410 #define population_type_mask ((1<<population_termination_bit)-1)
    411 
    412 #define gc_retain_pages_bit fixnum_bitmask(0)
    413 #define gc_integrity_check_bit fixnum_bitmask(2)
    414 #define egc_verbose_bit fixnum_bitmask(3)
    415 #define gc_verbose_bit fixnum_bitmask(4)
    416 #define gc_allow_stack_overflows_bit fixnum_bitmask(5)
    417 #define gc_postgc_pending fixnum_bitmask(26)
    418276
    419277#include "lisp-errors.h"
  • branches/arm/lisp-kernel/x86-constants64.h

    r13629 r13717  
    256256/* The objects themselves look something like this: */
    257257
    258 /*  Order of CAR and CDR doesn't seem to matter much - there aren't */
    259 /*  too many tricks to be played with predecrement/preincrement addressing. */
    260 /*  Keep them in the confusing MCL 3.0 order, to avoid confusion. */
    261 
    262 typedef struct cons {
    263   LispObj cdr;
    264   LispObj car;
    265 } cons;
    266 
    267 
    268 
    269 typedef struct lispsymbol {
    270   LispObj header;
    271   LispObj pname;
    272   LispObj vcell;
    273   LispObj fcell;
    274   LispObj package_predicate;
    275   LispObj flags;
    276   LispObj plist;
    277   LispObj binding_index;
    278 } lispsymbol;
    279 
    280 typedef struct ratio {
    281   LispObj header;
    282   LispObj numer;
    283   LispObj denom;
    284 } ratio;
    285258
    286259typedef struct double_float {
     
    290263
    291264
    292 typedef struct macptr {
    293   LispObj header;
    294   LispObj address;
    295   LispObj class;
    296   LispObj type;
    297 } macptr;
    298 
    299 typedef struct xmacptr {
    300   LispObj header;
    301   LispObj address;
    302   LispObj class;
    303   LispObj type;
    304   LispObj flags;
    305   LispObj link;
    306 } xmacptr;
    307  
    308 
    309 
    310 typedef struct special_binding {
    311   struct special_binding *link;
    312   struct lispsymbol *sym;
    313   LispObj value;
    314 } special_binding;
    315265
    316266typedef struct lisp_frame {
     
    337287} xcf;
    338288
    339 
    340 /* The GC (at least) needs to know what a
    341    package looks like, so that it can do GCTWA. */
    342 typedef struct package {
    343   LispObj header;
    344   LispObj itab;                 /* itab and etab look like (vector (fixnum . fixnum) */
    345   LispObj etab;
    346   LispObj used;
    347   LispObj used_by;
    348   LispObj names;
    349   LispObj shadowed;
    350 } package;
    351 
    352289/*
    353290  The GC also needs to know what a catch_frame looks like.
     
    380317#define fixnum_bitmask(n)  (1LL<<((n)+fixnumshift))
    381318
    382 /*
    383   The GC (at least) needs to know about hash-table-vectors and their flag bits.
    384 */
    385 
    386 typedef struct hash_table_vector_header {
    387   LispObj header;
    388   LispObj link;                 /* If weak */
    389   LispObj flags;                /* a fixnum; see below */
    390   LispObj gc_count;             /* gc-count kernel global */
    391   LispObj free_alist;           /* preallocated conses for finalization_alist */
    392   LispObj finalization_alist;   /* key/value alist for finalization */
    393   LispObj weak_deletions_count; /* incremented when GC deletes weak pair */
    394   LispObj hash;                 /* backpointer to hash-table */
    395   LispObj deleted_count;        /* number of deleted entries [not maintained if lock-free] */
    396   LispObj count;                /* number of valid entries [not maintained if lock-free] */
    397   LispObj cache_idx;            /* index of last cached pair */
    398   LispObj cache_key;            /* value of last cached key */
    399   LispObj cache_value;          /* last cached value */
    400   LispObj size;                 /* number of entries in table */
    401   LispObj size_reciprocal;      /* shifted reciprocal of size */
    402 } hash_table_vector_header;
    403 
    404 /*
    405   Bits (masks)  in hash_table_vector.flags:
    406 */
    407 
    408 /* GC should track keys when addresses change */
    409 #define nhash_track_keys_mask fixnum_bitmask(28)
    410 
    411 /* GC should set when nhash_track_keys_bit & addresses change */
    412 #define nhash_key_moved_mask  fixnum_bitmask(27)
    413 
    414 /* weak on key or value (need new "weak both" encoding.) */
    415 #define nhash_weak_mask       fixnum_bitmask(12)
    416 
    417 /* weak on value */
    418 #define nhash_weak_value_mask fixnum_bitmask(11)
    419 
    420 /* finalizable */
    421 #define nhash_finalizable_mask fixnum_bitmask(10)
    422 
    423 /* keys frozen, i.e. don't clobber keys, only values */
    424 #define nhash_keys_frozen_mask fixnum_bitmask(9)
    425 
    426 /* Lfun bits */
    427 
    428 #define lfbits_nonnullenv_mask fixnum_bitmask(0)
    429 #define lfbits_keys_mask fixnum_bitmask(1)
    430 #define lfbits_restv_mask fixnum_bitmask(7)
    431 #define lfbits_optinit_mask fixnum_bitmask(14)
    432 #define lfbits_rest_mask fixnum_bitmask(15)
    433 #define lfbits_aok_mask fixnum_bitmask(16)
    434 #define lfbits_lap_mask fixnum_bitmask(23)
    435 #define lfbits_trampoline_mask fixnum_bitmask(24)
    436 #define lfbits_evaluated_mask fixnum_bitmask(25)
    437 #define lfbits_cm_mask fixnum_bitmask(26)         /* combined_method */
    438 #define lfbits_nextmeth_mask fixnum_bitmask(26)   /* or call_next_method with method_mask */
    439 #define lfbits_gfn_mask fixnum_bitmask(27)        /* generic_function */
    440 #define lfbits_nextmeth_with_args_mask fixnum_bitmask(27)   /* or call_next_method_with_args with method_mask */
    441 #define lfbits_method_mask fixnum_bitmask(28)     /* method function */
    442 /* PPC only but want it defined for xcompile */
    443 #define lfbits_noname_mask fixnum_bitmask(29)
    444 
    445 /*
    446   known values of an "extended" (gcable) macptr's flags word:
    447 */
    448 
    449 
    450 /* Creole */
    451 
    452 #define doh_quantum 400
    453 #define doh_block_slots ((doh_quantum >> 2) - 3)
    454 
    455 typedef struct doh_block {
    456   struct doh_block *link;
    457   unsigned size;
    458   unsigned free;
    459   LispObj data[doh_block_slots];
    460 } doh_block, *doh_block_ptr;
    461 
    462 
    463 #define population_weak_list (0<<fixnum_shift)
    464 #define population_weak_alist (1<<fixnum_shift)
    465 #define population_termination_bit (16+fixnum_shift)
    466 #define population_type_mask ((1<<population_termination_bit)-1)
    467 
    468 #define gc_retain_pages_bit fixnum_bitmask(0)
    469 #define gc_integrity_check_bit fixnum_bitmask(2)
    470 #define egc_verbose_bit fixnum_bitmask(3)
    471 #define gc_verbose_bit fixnum_bitmask(4)
    472 #define gc_allow_stack_overflows_bit fixnum_bitmask(5)
    473 #define gc_postgc_pending fixnum_bitmask(26)
     319
    474320
    475321#include "lisp-errors.h"
Note: See TracChangeset for help on using the changeset viewer.