Changeset 14141


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

Common constants here; need to remove duplicates from most platform-specific
constants.h files.

File:
1 edited

Legend:

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

    r13952 r14141  
    2424#define TCR_FLAG_BIT_FOREIGN_EXCEPTION (fixnumshift+6)
    2525#define TCR_FLAG_BIT_PENDING_SUSPEND (fixnumshift+7)
    26 #define TCR_FLAG_BIT_FOREIGN_FPE (fixnumshift+8)
    2726
    2827#define TCR_STATE_FOREIGN (1)
     
    3534
    3635#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
Note: See TracChangeset for help on using the changeset viewer.