source: trunk/source/lisp-kernel/arm-constants.s @ 15111

Last change on this file since 15111 was 15111, checked in by gb, 8 years ago

ARM-specific changes, mostly.

When running lisp code (in almost all cases), keep the constant 0.0d0
in the d7 register (and therefore 0.0s0 in s14 and s15). We use d7 as
a vector header when saving non-volatile FPRs on the stack; we
actually only modify s14, so we now restore s14 after it's been used
this way. The value used in the header in lisp and kernel code is
loaded from PC-relative memory, which means that we no longer use
fmsr/fmdrr or similar instructions.

When starting a lisp thread or entering one via a callback, initialize
d7.

This all basically means that we can get 0.0[d|s]0 into an FPR (or
exploit the fact that it's already in one) a bit easier, and that's
generally a good thing. It's an ABI change, which means that the
FASL and image versions (for the ARM port only) changed; new binaries
are included in this commit.

The kernel changes to support the use of d7 are mostly pretty obvious.
In working on them, I noticed that "local labels" and "macro labels"
were in the same namespace, and we were only avoiding conflicts by
accident. For 10 years or so. (I also noticed that GAS doesn't fully
support PC-relative operands, so did that by hand.)

File size: 23.2 KB
Line 
1/*   Copyright (C) 2009 Clozure Associates */
2/*   Copyright (C) 1994-2001 Digitool, Inc */
3/*   This file is part of Clozure CL. */
4
5/*   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public */
6/*   License , known as the LLGPL and distributed with Clozure CL as the */
7/*   file "LICENSE".  The LLGPL consists of a preamble and the LGPL, */
8/*   which is distributed with Clozure CL as the file "LGPL".  Where these */
9/*   conflict, the preamble takes precedence. */
10
11/*   Clozure CL is referenced in the preamble as the "LIBRARY." */
12
13/*   The LLGPL is also available online at */
14/*   http://opensource.franz.com/preamble.html */
15
16
17       
18nbits_in_word = 32
19nbits_in_byte = 8
20ntagbits = 3    /* But only 2 are significant to lisp */
21nlisptagbits = 2
22nfixnumtagbits = 2
23num_subtag_bits = 8
24fixnumshift = 2
25fixnum_shift = 2
26fulltagmask = 7
27tagmask = 3
28fixnummask = 3
29subtag_mask = 0xff       
30ncharcodebits = 24              /* arguably, we're only using the low 8 */
31charcode_shift = nbits_in_word-ncharcodebits
32word_shift = 2
33node_size = 4
34dnode_size = 8
35dnode_align_bits = 3
36dnode_shift = dnode_align_bits
37bitmap_shift = 5
38
39
40fixnumone = (1<<fixnumshift)
41fixnum_one = fixnumone
42fixnum1 = fixnumone
43
44/* registers.  These assignments may not be viable. */
45
46define(`imm0',`r0')             /* even, so ldrd/strd can use imm0/imm1 */
47define(`imm1',`r1')
48define(`imm2',`r2')
49/* rcontext = r3 can be used as an imm reg in certain contexts
50   (its value must be easily recovered, but that value never changes
51   during a thread's lifetime.)
52*/       
53define(`rcontext',`r3')         
54define(`arg_z',`r4')
55define(`arg_y',`r5')
56define(`arg_x',`r6')
57define(`temp0',`r7')
58define(`temp1',`r8')
59define(`temp2',`r9')
60define(`vsp',`r10')
61define(`fn',`r11')
62define(`allocptr',`r12')
63define(`sp',`r13')
64define(`lr',`r14')
65define(`pc',`r15')
66
67                                               
68nargregs = 3
69               
70define(`fname',`temp1')
71define(`nfn',`temp2')
72define(`next_method_context',`temp1')
73define(`nargs',`imm2')
74define(`allocbase',`temp0')     /* while consing */
75
76define(`double_float_zero',`d7')
77define(`single_float_zero',`s14')
78                       
79/* ARM conditions */
80eq = 0
81ne = 1
82cs = 2
83hs = cs       
84cc = 3
85lo = cc       
86mi = 4
87pl = 5
88vs = 6
89vc = 7
90hi = 8
91ls = 9
92ge = 10
93lt = 11
94gt = 12
95le = 13
96al = 14
97
98/* Tags. */
99/* There are two-bit tags and three-bit tags. */
100/* A FULLTAG is the value of the low three bits of a tagged object. */
101/* A TAG is the value of the low two bits of a tagged object. */
102/* A TYPECODE is either a TAG or the value of a "tag-misc" objects header-byte. */
103
104/* There are 4 primary TAG values.  Any object which lisp can "see" can be classified */
105/* by its TAG.  (Some headers have FULLTAGS that are congruent modulo 4 with the */
106/* TAGS of other objects, but lisp can't "see" headers.) */
107
108
109tag_fixnum = 0  /* All fixnums, whether odd or even */
110tag_list = 1    /* Conses and NIL */
111tag_misc = 2    /* Heap-consed objects other than lists: vectors, symbols, functions, floats ... */
112tag_imm = 3     /* Immediate-objects: characters, UNBOUND, other markers. */
113
114
115/*  And there are 8 FULLTAG values.  Note that NIL has its own FULLTAG (congruent mod 4 to tag-list), */
116/*  that FULLTAG-MISC is > 4 (so that code-vector entry-points can be branched to, since the low */
117/*  two bits of the PC are ignored) and that both FULLTAG-MISC and FULLTAG-IMM have header fulltags */
118/*  that share the same TAG. */
119/*  Things that walk memory (and the stack) have to be careful to look at the FULLTAG of each */
120/*  object that they see. */
121
122
123fulltag_even_fixnum = 0 /* I suppose EVENP/ODDP might care; nothing else does. */
124fulltag_nil = 1 /* NIL and nothing but.  (Note that there's still a hidden NILSYM.) */
125fulltag_nodeheader = 2  /* Header of heap_allocated object that contains lisp_object pointers */
126fulltag_imm = 3 /* a "real" immediate object.  Shares TAG with fulltag_immheader. */
127fulltag_odd_fixnum = 4  /* */
128fulltag_cons = 5        /* a real (non_null) cons.  Shares TAG with fulltag_nil. */
129fulltag_misc = 6        /* Pointer "real" tag_misc object.  Shares TAG with fulltag_nodeheader. */
130fulltag_immheader = 7   /* Header of heap-allocated object that contains unboxed data. */
131
132nil_value = (0x04000000+fulltag_nil)
133misc_bias = fulltag_misc
134cons_bias = fulltag_cons   
135       
136unsigned_byte_24_mask = 0xe0000003 /* bits that should be clear in a boxed */
137                                   /* (UNSIGNED-BYTE 24) */
138           
139
140/* Functions are of (conceptually) unlimited size. */
141        _struct(_function,-misc_bias)
142         _node(header)
143         _node(entrypoint)      /* codevector & ~tagmask */
144         _node(codevector)
145        _ends
146
147        _struct(tsp_frame,0)
148         _node(backlink)
149         _node(type)
150         _struct_label(fixed_overhead)
151         _struct_label(data_offset)
152        _ends
153
154/* Order of CAR and CDR doesn't seem to matter much - there aren't */
155/* too many tricks to be played with predecrement/preincrement addressing. */
156/* Keep them in the confusing MCL 3.0 order, to avoid confusion. */
157        _struct(cons,-cons_bias)
158         _node(cdr)
159         _node(car)
160        _ends
161       
162misc_header_offset = -fulltag_misc
163misc_subtag_offset = misc_header_offset         /* low byte of header */
164misc_data_offset = misc_header_offset+4         /* first word of data */
165misc_dfloat_offset = misc_header_offset+8               /* double-floats are doubleword-aligned */
166
167max_64_bit_constant_index = ((0x0fff + misc_dfloat_offset)>>3)
168max_32_bit_constant_index = ((0x0fff + misc_data_offset)>>2)
169max_16_bit_constant_index = ((0x0fff + misc_data_offset)>>1)
170max_8_bit_constant_index = (0x0fff + misc_data_offset)
171max_1_bit_constant_index = ((0x0fff + misc_data_offset)<<5)
172
173/* T is almost adjacent to NIL: since NIL is a misaligned CONS, it spans */
174/* two doublewords.  The arithmetic difference between T and NIL is */
175/* such that the least-significant bit and exactly one other bit is */
176/* set in the result. */
177
178t_offset = ((dnode_size-fulltag_nil)+fulltag_misc)
179t_value = nil_value+t_offset
180
181/* The order in which various header values are defined is significant in several ways: */
182/* 1) Numeric subtags precede non-numeric ones; there are further orderings among numeric subtags. */
183/* 2) All subtags which denote CL arrays are preceded by those that don't, */
184/*    with a further ordering which requires that (< header-arrayH header-vectorH ,@all-other-CL-vector-types) */
185/* 3) The element-size of ivectors is determined by the ordering of ivector subtags. */
186/* 4) All subtags are >= fulltag-immheader . */
187
188define(`define_subtag',`
189subtag_$1 = $2|($3<<ntagbits)')
190       
191define(`define_imm_subtag',`
192        define_subtag($1,fulltag_immheader,$2)')
193
194       
195define(`define_node_subtag',`
196        define_subtag($1,fulltag_nodeheader,$2)')
197
198               
199/*Immediate subtags. */
200        define_subtag(stack_alloc_marker,fulltag_imm,1)
201        define_subtag(lisp_frame_marker,fulltag_imm,2)
202        define_subtag(character,fulltag_imm,9)
203        define_subtag(unbound,fulltag_imm,6)
204        define_subtag(illegal,fulltag_imm,10)
205        define_subtag(go_tag,fulltag_imm,12)
206        define_subtag(block_tag,fulltag_imm,24)
207        define_subtag(vsp_protect,fulltag_imm,7)
208        define_subtag(no_thread_local_binding,fulltag_imm,30)
209unbound_marker = subtag_unbound
210undefined = unbound_marker
211illegal_marker = subtag_illegal
212no_thread_local_binding_marker = subtag_no_thread_local_binding
213lisp_frame_marker = subtag_lisp_frame_marker
214stack_alloc_marker = subtag_stack_alloc_marker       
215       
216
217/*Numeric subtags. We want to keep these small, so that things like
218  NUMBERP can do LOGBITP of a bitmask that fits in a machine word/fixnum,
219  but we don't want to assume that all small typecodes are numbers.
220  Trying to enforce that assumption has wasted a few typecodes, and it's
221  not like we have so many that we can afford to do that.
222*/       
223
224        define_imm_subtag(bignum,0)
225        define_node_subtag(ratio,1)
226        define_imm_subtag(single_float,1)
227        define_imm_subtag(double_float,2)
228        define_node_subtag(complex,3)
229
230
231
232/* CL array types.  There are more immediate types than node types; all CL array subtags must be > than */
233/* all non-CL-array subtags.  So we start by defining the immediate subtags in decreasing order, starting */
234/* with that subtag whose element size isn't an integral number of bits and ending with those whose */
235/* element size - like all non-CL-array fulltag-immheader types - is 32 bits. */
236
237        define_imm_subtag(bit_vector,31)
238        define_imm_subtag(double_float_vector,30)
239        define_imm_subtag(s16_vector,29)
240        define_imm_subtag(u16_vector,28)
241min_16_bit_ivector_subtag = subtag_u16_vector
242max_16_bit_ivector_subtag = subtag_s16_vector
243        define_imm_subtag(s8_vector,26)
244        define_imm_subtag(u8_vector,25)
245min_8_bit_ivector_subtag = subtag_u8_vector
246max_8_bit_ivector_subtag = fulltag_immheader|(27<<ntagbits)
247        define_imm_subtag(simple_base_string,24)
248        define_imm_subtag(fixnum_vector,23)
249        define_imm_subtag(s32_vector,22)
250        define_imm_subtag(u32_vector,21)
251        define_imm_subtag(single_float_vector,20)
252max_32_bit_ivector_subtag = fulltag_immheader|(24<<ntagbits)
253min_cl_ivector_subtag = subtag_single_float_vector
254
255
256        define_node_subtag(vectorH,20)
257        define_node_subtag(arrayH,19)
258        define_node_subtag(simple_vector,21)
259min_vector_subtag = subtag_vectorH
260min_array_subtag = subtag_arrayH
261
262/* So, we get the remaining subtags (n: (n > max-numeric-subtag) & (n < min-array-subtag)) */
263/* for various immediate/node object types. */
264
265        define_imm_subtag(macptr,3)
266        define_imm_subtag(dead_macptr,4)
267        define_imm_subtag(code_vector,5)
268        define_imm_subtag(creole,6)
269
270max_non_array_imm_subtag = (18<<ntagbits)|fulltag_immheader
271        define_node_subtag(pseudofunction,0)
272        define_node_subtag(catch_frame,4)
273        define_node_subtag(function,5)
274        define_node_subtag(basic_stream,6)
275        define_node_subtag(symbol,7)
276        define_node_subtag(lock,8)
277        define_node_subtag(hash_vector,9)
278        define_node_subtag(pool,10)
279        define_node_subtag(weak,11)
280        define_node_subtag(package,12)
281        define_node_subtag(slot_vector,13)
282        define_node_subtag(instance,14)
283        define_node_subtag(struct,15)
284        define_node_subtag(istruct,16)
285        define_node_subtag(value_cell,17)
286        define_node_subtag(xfunction,18)
287max_non_array_node_subtag = (18<<ntagbits)|fulltag_immheader
288       
289/* The objects themselves look something like this: */
290        _structf(ratio)
291         _node(numer)
292         _node(denom)
293        _endstructf
294
295        _structf(single_float)
296         _word(value)
297        _endstructf
298
299        _structf(double_float)
300         _word(pad)
301         _dword(value)
302        _endstructf
303
304        _structf(symbol)
305         _node(pname)
306         _node(vcell)
307         _node(fcell)
308         _node(package_predicate)
309         _node(flags)
310         _node(plist)
311         _node(binding_index)
312        _endstructf
313
314        _structf(catch_frame)
315         _node(link)            /* backpointer to previous catch frame */
316         _node(mvflag)          /* 0 if single-valued catch, fixnum 1 otherwise */
317         _node(catch_tag)       /* #<unbound> -> unwind-protect, else catch */
318         _node(db_link)         /* head of special-binding chain */
319         _node(xframe)          /* exception frame chain */
320         _node(last_lisp_frame) /* from TCR */
321         _node(code_vector)     /* of fn in lisp_frame, or 0 */
322        _endstructf
323
324        _structf(macptr)
325         _node(address)
326         _node(domain)
327         _node(type)
328        _endstructf
329
330        _structf(vectorH)
331         _node(logsize)
332         _node(physsize)
333         _node(data_vector)
334         _node(displacement)
335         _node(flags)
336        _endstructf
337
338        _structf(arrayH)
339         _node(rank)
340         _node(physsize)
341         _node(data_vector)
342         _node(displacement)
343         _node(flags)
344         _struct_label(dim0)
345        _endstructf
346       
347       
348               
349        _struct(lisp_frame,0)
350         _node(marker)
351         _node(savevsp) 
352         _node(savefn) 
353         _node(savelr) 
354        _ends
355       
356
357
358        _struct(vector,-fulltag_misc)
359         _node(header)
360         _struct_label(data)
361        _ends
362
363        _struct(binding,0)
364         _node(link)
365         _node(sym)
366         _node(val)
367        _ends
368
369/* Indices in %builtin-functions% */
370_builtin_plus = 0       /* +-2 */
371_builtin_minus = 1      /* --2 */
372_builtin_times = 2      /* *-2 */
373_builtin_div = 3        /* /-2 */
374_builtin_eq = 4         /* =-2 */
375_builtin_ne = 5         /* /-2 */
376_builtin_gt = 6         /* >-2 */
377_builtin_ge = 7         /* >=-2 */
378_builtin_lt = 8         /* <-2 */
379_builtin_le = 9         /* <=-2 */
380_builtin_eql = 10       /* eql */
381_builtin_length = 11    /* length */
382_builtin_seqtype = 12   /* sequence-type */
383_builtin_assq = 13      /* assq */
384_builtin_memq = 14      /* memq */
385_builtin_logbitp = 15   /* logbitp */
386_builtin_logior = 16    /* logior-2 */
387_builtin_logand = 17    /* logand-2 */
388_builtin_ash = 18       /* ash */
389_builtin_negate = 19    /* %negate */
390_builtin_logxor = 20    /* logxor-2 */
391_builtin_aref1 = 21     /* %aref1 */
392_builtin_aset1 = 22     /* %aset1 */
393
394
395symbol_extra = symbol.size-fulltag_misc
396       
397        _struct(nrs,0)
398         _struct_pad(dnode_size-fulltag_nil)
399
400         _struct_pad(fulltag_misc)
401         _struct_label(tsym)
402         _struct_pad(symbol_extra)      /* t */
403
404         _struct_pad(fulltag_misc)
405         _struct_label(nilsym)
406         _struct_pad(symbol_extra)      /* nil */
407
408         _struct_pad(fulltag_misc)
409         _struct_label(errdisp)
410         _struct_pad(symbol_extra)      /* %err-disp */
411
412         _struct_pad(fulltag_misc)
413         _struct_label(cmain)
414         _struct_pad(symbol_extra)      /* cmain */
415
416         _struct_pad(fulltag_misc)
417         _struct_label(eval)
418         _struct_pad(symbol_extra)      /* eval */
419 
420         _struct_pad(fulltag_misc)
421         _struct_label(appevalfn)
422         _struct_pad(symbol_extra)      /* apply-evaluated-function */
423
424         _struct_pad(fulltag_misc)
425         _struct_label(error)
426         _struct_pad(symbol_extra)      /* error */
427
428         _struct_pad(fulltag_misc)
429         _struct_label(defun)
430         _struct_pad(symbol_extra)      /* %defun */
431
432         _struct_pad(fulltag_misc)
433         _struct_label(defvar)
434         _struct_pad(symbol_extra)      /* %defvar */
435
436         _struct_pad(fulltag_misc)
437         _struct_label(defconstant)
438         _struct_pad(symbol_extra)      /* %defconstant */
439
440         _struct_pad(fulltag_misc)
441         _struct_label(macrosym)
442         _struct_pad(symbol_extra)      /* %macro */
443
444         _struct_pad(fulltag_misc)
445         _struct_label(kernelrestart)
446         _struct_pad(symbol_extra)      /* %kernel-restart */
447
448         _struct_pad(fulltag_misc)
449         _struct_label(package)
450         _struct_pad(symbol_extra)      /* *package* */
451
452         _struct_pad(fulltag_misc)
453         _struct_label(total_bytes_freed)               /* *total-bytes-freed* */
454         _struct_pad(symbol_extra)
455
456         _struct_pad(fulltag_misc)
457         _struct_label(kallowotherkeys)
458         _struct_pad(symbol_extra)      /* allow-other-keys */
459
460         _struct_pad(fulltag_misc)
461         _struct_label(toplcatch)
462         _struct_pad(symbol_extra)      /* %toplevel-catch% */
463
464         _struct_pad(fulltag_misc)
465         _struct_label(toplfunc)
466         _struct_pad(symbol_extra)      /* %toplevel-function% */
467
468         _struct_pad(fulltag_misc)
469         _struct_label(callbacks)
470         _struct_pad(symbol_extra)      /* %pascal-functions% */
471
472         _struct_pad(fulltag_misc)
473         _struct_label(allmeteredfuns)
474         _struct_pad(symbol_extra)      /* *all-metered-functions* */
475
476         _struct_pad(fulltag_misc)
477         _struct_label(total_gc_microseconds)           /* *total-gc-microseconds* */
478         _struct_pad(symbol_extra)
479
480         _struct_pad(fulltag_misc)
481         _struct_label(builtin_functions)               /* %builtin-functions% */
482         _struct_pad(symbol_extra)               
483
484         _struct_pad(fulltag_misc)
485         _struct_label(udf)
486         _struct_pad(symbol_extra)      /* %unbound-function% */
487
488         _struct_pad(fulltag_misc)
489         _struct_label(init_misc)
490         _struct_pad(symbol_extra)      /* %init-misc */
491
492         _struct_pad(fulltag_misc)
493         _struct_label(macro_code)
494         _struct_pad(symbol_extra)      /* %macro-code% */
495
496         _struct_pad(fulltag_misc)
497         _struct_label(closure_code)
498         _struct_pad(symbol_extra)      /* %closure-code% */
499
500         _struct_pad(fulltag_misc)
501         _struct_label(new_gcable_ptr) /* %new-gcable-ptr */
502         _struct_pad(symbol_extra)
503       
504         _struct_pad(fulltag_misc)
505         _struct_label(gc_event_status_bits)
506         _struct_pad(symbol_extra)      /* *gc-event-status-bits* */
507
508         _struct_pad(fulltag_misc)
509         _struct_label(post_gc_hook)
510         _struct_pad(symbol_extra)      /* *post-gc-hook* */
511
512         _struct_pad(fulltag_misc)
513         _struct_label(handlers)
514         _struct_pad(symbol_extra)      /* %handlers% */
515
516
517         _struct_pad(fulltag_misc)
518         _struct_label(all_packages)
519         _struct_pad(symbol_extra)      /* %all-packages% */
520
521         _struct_pad(fulltag_misc)
522         _struct_label(keyword_package)
523         _struct_pad(symbol_extra)      /* *keyword-package* */
524
525         _struct_pad(fulltag_misc)
526         _struct_label(finalization_alist)
527         _struct_pad(symbol_extra)      /* %finalization-alist% */
528
529         _struct_pad(fulltag_misc)
530         _struct_label(foreign_thread_control)
531         _struct_pad(symbol_extra)      /* %foreign-thread-control */
532
533        _ends
534
535define(`def_header',`
536$1 = ($2<<num_subtag_bits)|$3')
537
538        def_header(single_float_header,single_float.element_count,subtag_single_float)
539        def_header(double_float_header,double_float.element_count,subtag_double_float)
540        def_header(one_digit_bignum_header,1,subtag_bignum)
541        def_header(two_digit_bignum_header,2,subtag_bignum)
542        def_header(three_digit_bignum_header,3,subtag_bignum)
543        def_header(symbol_header,symbol.element_count,subtag_symbol)
544        def_header(value_cell_header,1,subtag_value_cell        )
545        def_header(macptr_header,macptr.element_count,subtag_macptr)
546        def_header(vectorH_header,vectorH.element_count,subtag_vectorH)
547
548        include(errors.s)
549
550/* Symbol bits that we care about */
551sym_vbit_bound = (0+fixnum_shift)
552sym_vbit_bound_mask = (1<<sym_vbit_bound)
553sym_vbit_const = (1+fixnum_shift)
554sym_vbit_const_mask = (1<<sym_vbit_const)
555
556        _struct(area,0)
557         _node(pred)
558         _node(succ)
559         _node(low)
560         _node(high)
561         _node(active)
562         _node(softlimit)
563         _node(hardlimit)
564         _node(code)
565         _node(markbits)
566         _node(ndwords)
567         _node(older)
568         _node(younger)
569         _node(h)
570         _node(sofprot)
571         _node(hardprot)
572         _node(owner)
573         _node(refbits)
574         _node(nextref)
575        _ends
576
577
578
579
580TCR_BIAS = 0
581/* TCR_BIAS = 0x7000 */
582       
583/*  Thread context record. */
584
585        _struct(tcr,-TCR_BIAS)
586         _node(prev)            /* in doubly-linked list */
587         _node(next)            /* in doubly-linked list */
588         _node(lisp_fpscr)      /* lisp thread's fpscr (in low word) */
589         _node(pad)
590         _node(db_link)         /* special binding chain head */
591         _node(catch_top)       /* top catch frame */
592         _node(save_vsp)        /* VSP when in foreign code */
593         _node(save_tsp)        /* TSP when in foreign code */
594         _node(cs_area)         /* cstack area pointer */
595         _node(vs_area)         /* vstack area pointer */
596         _node(last_lisp_frame) /* when in foreign code */
597         _node(cs_limit)        /* cstack overflow limit */
598         _node(bytes_consed_low)
599         _node(bytes_consed_high)
600         _node(log2_allocation_quantum)
601         _node(interrupt_pending)
602         _node(xframe)          /* per-thread exception frame list */
603         _node(errno_loc)       /* per-thread  errno location */
604         _node(ffi_exception)   /* fpscr exception bits from ff-call */
605         _node(osid)            /* OS thread id */
606         _node(valence)         /* odd when in foreign code */
607         _node(foreign_exception_status)
608         _node(native_thread_info)
609         _node(native_thread_id)
610         _node(last_allocptr)
611         _node(save_allocptr)
612         _node(save_allocbase)
613         _node(reset_completion)
614         _node(activate)
615         _node(suspend_count)
616         _node(suspend_context)
617         _node(pending_exception_context)
618         _node(suspend)         /* semaphore for suspension notify */
619         _node(resume)          /* sempahore for resumption notify */
620         _node(flags)     
621         _node(gc_context)
622         _node(termination_semaphore)
623         _node(unwinding)
624         _node(tlb_limit)
625         _node(tlb_pointer)     /* Consider using tcr+N as tlb_pointer */
626         _node(shutdown_count)
627         _node(safe_ref_address)
628        _ends
629
630TCR_FLAG_BIT_FOREIGN = fixnum_shift       
631TCR_FLAG_BIT_AWAITING_PRESET = (fixnum_shift+1)
632TCR_FLAG_BIT_ALT_SUSPEND = (fixnumshift+2)
633TCR_FLAG_BIT_PROPAGATE_EXCEPTION = (fixnumshift+3)
634TCR_FLAG_BIT_SUSPEND_ACK_PENDING = (fixnumshift+4)
635TCR_FLAG_BIT_PENDING_EXCEPTION = (fixnumshift+5)
636TCR_FLAG_BIT_FOREIGN_EXCEPTION = (fixnumshift+6)
637TCR_FLAG_BIT_PENDING_SUSPEND = (fixnumshift+7) 
638TCR_FLAG_BIT_ALLOCPTR_FOREIGN = (fixnumshift+8)
639       
640r0 = 0
641r1 = 1
642r2 = 2
643r3 = 3
644r4 = 4
645r5 = 5
646r6 = 6
647r7 = 7
648r8 = 8
649r9 = 9
650r10 = 10
651r11 = 11
652r12 = 12
653r13 = 13
654sp = 13       
655r14 = 14
656lr = 14
657r15 = 15
658pc = 15
659               
660       
661       
662/* registers, as used in destrucuring-bind/macro-bind */
663
664define(`arg_reg',`arg_z')
665define(`keyvect_reg',`temp2')
666define(`mask_keyp',`(1<<25)') /*  note that keyp can be true even when 0 keys. */
667define(`mask_aok',`(1<<26)')
668define(`mask_restp',`(1<<27)')
669define(`mask_aok_seen',`(1<<30)')
670define(`mask_aok_this',`(1<<31)')       
671define(`mask_unknown_keyword_seen',`(1<<28)')               
672define(`mask_initopt',`(1<<29)')
673
674define(`STACK_ALIGN',8)
675define(`STACK_ALIGN_MASK',7)
676
677
678define(`TCR_STATE_FOREIGN',1)
679define(`TCR_STATE_LISP',0)
680define(`TCR_STATE_EXCEPTION_WAIT',2)
681define(`TCR_STATE_EXCEPTION_RETURN',4)
682
683
684lisp_globals_limit = -fulltag_nil
685
686num_lisp_globals = 49            /* MUST UPDATE THIS !!! */
687       
688        _struct(lisp_globals,-(fulltag_nil+dnode_size+(num_lisp_globals*node_size)))
689         _node(weakvll)                 /* all populations as of last GC */
690         _node(initial_tcr)             /* initial thread tcr */
691         _node(image_name)              /* --image-name argument */
692         _node(BADfpscr_save_high)      /* high word of FP reg used to save FPSCR */
693         _node(unwind_resume)           /* _Unwind_Resume */
694         _node(batch_flag)              /* -b */
695         _node(host_platform)           /* for runtime platform-specific stuff */
696         _node(argv)                    /* address of argv`0' */
697         _node(ref_base)                        /* start of oldest pointer-bearing area */
698         _node(tenured_area)            /* the tenured_area */
699         _node(oldest_ephemeral)        /* dword address of oldest ephemeral object or 0 */
700         _node(lisp_exit_hook)          /* install foreign exception_handling */
701         _node(lisp_return_hook)        /* install lisp exception_handling */
702         _node(double_float_one)        /* high half of 1.0d0 */
703         _node(short_float_zero)        /* low half of 1.0d0 */
704         _node(objc2_end_catch)         /* objc_end_catch() */
705         _node(metering_info)           /* address of lisp_metering global */
706         _node(in_gc)                   /* non-zero when GC active */
707         _node(lexpr_return1v)          /* simpler when &lexpr called for single value. */
708         _node(lexpr_return)            /* magic &lexpr return code. */
709         _node(all_areas)               /* doubly-linked list of all memory areas */
710         _node(kernel_path)             /* real executable name */
711         _node(objc2_begin_catch)       /* objc_begin_catch */
712         _node(stack_size)              /* from command-line */
713         _node(statically_linked)       /* non-zero if -static */
714         _node(heap_end)                /* end of lisp heap */
715         _node(heap_start)              /* start of lisp heap */
716         _node(gcable_pointers)         /* linked-list of weak macptrs. */
717         _node(gc_num)                  /* fixnum: GC call count. */
718         _node(fwdnum)                  /* fixnum: GC "forwarder" call count. */
719         _node(altivec_present)         /* non-zero when AltiVec available */
720         _node(oldspace_dnode_count)    /* dynamic dnodes older than g0 start */
721         _node(refbits)                 /* EGC refbits */
722         _node(gc_inhibit_count)
723         _node(intflag)                 /* sigint pending */
724         _node(BAD_block_tag_counter)   /* counter for (immediate) block tag */
725         _node(deleted_static_pairs)           
726         _node(exception_lock)
727         _node(area_lock)
728         _node(tcr_key)                 /* tsd key for per-thread tcr */
729         _node(ret1val_addr)            /* address of "dynamic" subprims magic values return addr */
730         _node(subprims_base)           /* address of dynamic subprims jump table */
731         _node(saveR13)                 /* probably don't really need this */
732         _node(saveTOC)                 /* where the 68K emulator stores the  emulated regs */
733         _node(objc_2_personality)      /* exception "personality routine" address for ObjC 2.0 */
734         _node(kernel_imports)          /* some things we need imported for us */
735         _node(interrupt_signal)        /* signal used by PROCESS-INTERRUPT */
736         _node(tcr_count)               /* tcr_id for next tcr */
737         _node(get_tcr)                 /* address of get_tcr() */
738        _ends
739
740/* extended type codes, for UUOs.  Shouldn't conflict with defined subtags */
741
742xtype_unsigned_byte_24 = 252
743xtype_array2d = 248
744xtype_array3d = 244
745xtype_integer = 4
746xtype_s64 = 8
747xtype_u64 = 12
748xtype_s32 = 16
749xtype_u32 = 20
750xtype_s16 = 24
751xtype_u16 = 28
752xtype_s8 = 32
753xtype_u8 = 36
754xtype_bit = 40                               
755                                               
756stack_alloc_limit = 0x8000                       
757                       
758INTERRUPT_LEVEL_BINDING_INDEX = fixnumone
759VOID_ALLOCPTR = 0xfffffff8
Note: See TracBrowser for help on using the repository browser.