Changeset 519
- Timestamp:
- Feb 11, 2004, 10:58:41 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/ccl/lisp-kernel/constants.s (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/lisp-kernel/constants.s
r469 r519 1 1 /* 2 Copyright (C) 1994-2001 Digitool, Inc2 Copyright (C) 2004 Clozure Associates 3 3 This file is part of OpenMCL. 4 4 … … 15 15 */ 16 16 17 18 nbits_in_word = 32 19 nbits_in_byte = 8 20 ntagbits = 3 /* But only 2 are significant to lisp */ 21 nlisptagbits = 2 22 nfixnumtagbits = 2 23 num_subtag_bits = 8 24 fixnumshift = 2 25 fixnum_shift = 2 26 fulltagmask = 7 27 tagmask = 3 28 fixnummask = 3 29 ncharcodebits = 16 30 charcode_shift = nbits_in_word-ncharcodebits 31 word_shift = 2 32 node_size = 4 33 dnode_size = 8 34 dnode_align_bits = 3 35 36 fixnumone = (1<<fixnumshift) 37 fixnum_one = fixnumone 38 fixnum1 = fixnumone 39 40 41 /* Tags. */ 42 /* There are two-bit tags and three-bit tags. */ 43 /* A FULLTAG is the value of the low three bits of a tagged object. */ 44 /* A TAG is the value of the low two bits of a tagged object. */ 45 /* A TYPECODE is either a TAG or the value of a "tag-misc" objects header-byte. */ 46 47 /* There are 4 primary TAG values. Any object which lisp can "see" can be classified */ 48 /* by its TAG. (Some headers have FULLTAGS that are congruent modulo 4 with the */ 49 /* TAGS of other objects, but lisp can't "see" headers.) */ 50 51 52 tag_fixnum = 0 /* All fixnums, whether odd or even */ 53 tag_list = 1 /* Conses and NIL */ 54 tag_misc = 2 /* Heap-consed objects other than lists: vectors, symbols, functions, floats ... */ 55 tag_imm = 3 /* Immediate-objects: characters, UNBOUND, other markers. */ 56 57 /* 58 And there are 8 FULLTAG values. Note that NIL has its own FULLTAG (congruent mod 4 to tag-list), 59 that FULLTAG-MISC is > 4 (so that code-vector entry-points can be branched to, since the low 60 two bits of the PC are ignored) and that both FULLTAG-MISC and FULLTAG-IMM have header fulltags 61 that share the same TAG. 62 Things that walk memory (and the stack) have to be careful to look at the FULLTAG of each 63 object that they see. 64 */ 65 66 fulltag_even_fixnum = 0 /* I suppose EVENP/ODDP might care; nothing else does. */ 67 fulltag_cons = 1 /* a real (non_null) cons. Shares TAG with fulltag_nil. */ 68 fulltag_nodeheader = 2 /* Header of heap_allocated object that contains lisp_object pointers */ 69 fulltag_imm = 3 /* a "real" immediate object. Shares TAG with fulltag_immheader. */ 70 fulltag_odd_fixnum = 4 /* */ 71 fulltag_nil = 5 /* NIL and nothing but. (Note that there]s still a hidden NILSYM.) */ 72 fulltag_misc = 6 /* Pointer "real" tag_misc object. Shares TAG with fulltag_nodeheader. */ 73 fulltag_immheader = 7 /* Header of heap-allocated object that contains unboxed data. */ 74 75 nil_value = 0x00002015 76 misc_bias = fulltag_misc 77 cons_bias = tag_list 78 79 /* Functions are of (conceptually) unlimited size. */ 80 _struct(_function,-misc_bias) 81 _node(header) 82 _node(codevector) 83 _ends 84 85 _struct(tsp_frame,0) 86 _node(backlink) 87 _node(type) 88 _struct_label(fixed_overhead) 89 _struct_label(data_offset) 90 _ends 91 92 /* Order of CAR and CDR doesn]t seem to matter much - there aren]t */ 93 /* too many tricks to be played with predecrement/preincrement addressing. */ 94 /* Keep them in the confusing MCL 3.0 order, to avoid confusion. */ 95 _struct(cons,-cons_bias) 96 _node(cdr) 97 _node(car) 98 _ends 99 100 misc_header_offset = -fulltag_misc 101 misc_subtag_offset = misc_header_offset+3 /* low byte of header */ 102 misc_data_offset = misc_header_offset+4 /* first word of data */ 103 misc_dfloat_offset = misc_header_offset+8 /* double-floats are doubleword-aligned */ 104 105 max_64_bit_constant_index = ((0x7fff + misc_dfloat_offset)>>3) 106 max_32_bit_constant_index = ((0x7fff + misc_data_offset)>>2) 107 max_16_bit_constant_index = ((0x7fff + misc_data_offset)>>1) 108 max_8_bit_constant_index = (0x7fff + misc_data_offset) 109 max_1_bit_constant_index = ((0x7fff + misc_data_offset)<<5) 110 111 /* T is almost adjacent to NIL: since NIL is a misaligned CONS, it spans */ 112 /* two doublewords. The arithmetic difference between T and NIL is */ 113 /* such that the least-significant bit and exactly one other bit is */ 114 /* set in the result. */ 115 116 t_offset = (8+(8-fulltag_nil)+fulltag_misc) 117 t_value = nil_value+t_offset 118 119 /* The order in which various header values are defined is significant in several ways: */ 120 /* 1) Numeric subtags precede non-numeric ones; there are further orderings among numeric subtags. */ 121 /* 2) All subtags which denote CL arrays are preceded by those that don]t, */ 122 /* with a further ordering which requires that (< header-arrayH header-vectorH ,@all-other-CL-vector-types) */ 123 /* 3) The element-size of ivectors is determined by the ordering of ivector subtags. */ 124 /* 4) All subtags are >= fulltag-immheader . */ 125 126 define([define_subtag],[ 127 subtag_$1 = $2|($3<<ntagbits)]) 128 129 define([define_imm_subtag],[ 130 define_subtag($1,fulltag_immheader,$2)]) 131 132 133 define([define_node_subtag],[ 134 define_subtag($1,fulltag_nodeheader,$2)]) 135 136 137 /*Immediate subtags. */ 138 define_subtag(character,fulltag_imm,9) 139 define_subtag(unbound,fulltag_imm,6) 140 define_subtag(illegal,fulltag_imm,10) 141 define_subtag(go_tag,fulltag_imm,12) 142 define_subtag(block_tag,fulltag_imm,24) 143 define_subtag(vsp_protect,fulltag_imm,7) 144 define_subtag(no_thread_local_binding,fulltag_imm,30) 145 unbound_marker = subtag_unbound 146 undefined = unbound_marker 147 illegal_marker = subtag_illegal 148 no_thread_local_binding_marker = subtag_no_thread_local_binding 149 /*Numeric subtags. */ 150 151 define_imm_subtag(bignum,0) 152 min_numeric_subtag = subtag_bignum 153 154 define_node_subtag(ratio,1) 155 max_rational_subtag = subtag_ratio 156 157 define_imm_subtag(single_float,1) 158 define_imm_subtag(double_float,2) 159 min_float_subtag = subtag_single_float 160 max_float_subtag = subtag_double_float 161 max_real_subtag = subtag_double_float 162 163 define_node_subtag(complex,3) 164 max_numeric_subtag = subtag_complex 165 166 167 /* CL array types. There are more immediate types than node types; all CL array subtags must be > than 168 all non-CL-array subtags. So we start by defining the immediate subtags in decreasing order, starting 169 with that subtag whose element size isn]t an integral number of bits and ending with those whose 170 element size - like all non-CL-array fulltag-immheader types - is 32 bits. */ 171 172 define_imm_subtag(bit_vector,31) 173 define_imm_subtag(double_float_vector,30) 174 define_imm_subtag(s16_vector,29) 175 define_imm_subtag(u16_vector,28) 176 define_imm_subtag(simple_general_string,27) 177 min_16_bit_ivector_subtag = subtag_simple_general_string 178 max_16_bit_ivector_subtag = subtag_s16_vector 179 max_string_subtag = subtag_simple_general_string 180 181 define_imm_subtag(simple_base_string,26) 182 define_imm_subtag(s8_vector,25) 183 define_imm_subtag(u8_vector,24) 184 min_8_bit_ivector_subtag = subtag_u8_vector 185 max_8_bit_ivector_subtag = subtag_simple_base_string 186 min_string_subtag = subtag_simple_base_string 187 188 define_imm_subtag(s32_vector,23) 189 define_imm_subtag(u32_vector,22) 190 define_imm_subtag(single_float_vector,21) 191 max_32_bit_ivector_subtag = subtag_s32_vector 192 min_cl_ivector_subtag = subtag_single_float_vector 193 194 195 define_node_subtag(vectorH,21) 196 define_node_subtag(arrayH,20) 197 define_node_subtag(simple_vector,22) 198 min_vector_subtag = subtag_vectorH 199 min_array_subtag = subtag_arrayH 200 201 /* So, we get the remaining subtags (n: (n > max-numeric-subtag) & (n < min-array-subtag)) */ 202 /* for various immediate/node object types. */ 203 204 define_imm_subtag(macptr,3) 205 min_non_numeric_imm_subtag = subtag_macptr 206 207 define_imm_subtag(dead_macptr,4) 208 define_imm_subtag(code_vector,5) 209 define_imm_subtag(creole,6) 210 211 max_non_array_imm_subtag = (19<<ntagbits)|fulltag_immheader 212 213 define_node_subtag(catch_frame,4) 214 define_node_subtag(function,5) 215 define_node_subtag(sgbuf,6) 216 define_node_subtag(symbol,7) 217 define_node_subtag(lock,8) 218 define_node_subtag(hash_vector,9) 219 define_node_subtag(pool,10) 220 define_node_subtag(weak,11) 221 define_node_subtag(package,12) 222 define_node_subtag(slot_vector,13) 223 define_node_subtag(instance,14) 224 define_node_subtag(struct,15) 225 define_node_subtag(istruct,16) 226 define_node_subtag(value_cell,17) 227 define_node_subtag(xfunction,18) 228 define_node_subtag(svar,19) 229 max_non_array_node_subtag = (19<<ntagbits)|fulltag_immheader 230 231 /* The objects themselves look something like this: */ 232 _structf(ratio) 233 _node(numer) 234 _node(denom) 235 _endstructf 236 237 _structf(single_float) 238 _word(value) 239 _endstructf 240 241 _structf(double_float) 242 _word(pad) 243 _dword(value) 244 _endstructf 245 246 _structf(symbol) 247 _node(pname) 248 _node(vcell) 249 _node(fcell) 250 _node(package_plist) 251 _node(flags) 252 _endstructf 253 254 _structf(catch_frame) 255 _node(catch_tag) /* #<unbound> -> unwind-protect, else catch */ 256 _node(link) /* backpointer to previous catch frame */ 257 _node(mvflag) /* 0 if single-valued catch, fixnum 1 otherwise */ 258 _node(csp) /* pointer to lisp_frame on csp */ 259 _node(db_link) /* head of special-binding chain */ 260 _field(regs,32) /* save7-save0 */ 261 _node(xframe) /* exception frame chain */ 262 _node(tsp_segment) /* maybe someday; padding for now */ 263 _endstructf 264 265 _structf(macptr) 266 _node(address) 267 _node(domain) 268 _node(type) 269 _endstructf 270 271 _structf(vectorH) 272 _node(logsize) 273 _node(physsize) 274 _node(data_vector) 275 _node(displacement) 276 _node(flags) 277 _endstructf 278 279 _structf(svar) /* shallow-bound special-variable info */ 280 _node(symbol) 281 _node(idx) 282 _endstructf 283 284 _struct(c_frame,0) /* PowerOpen ABI C stack frame */ 285 _node(backlink) 286 _node(crsave) 287 _node(savelr) 288 _field(unused, 8) 289 _node(savetoc) 290 _struct_label(params) 291 _node(param0) 292 _node(param1) 293 _node(param2) 294 _node(param3) 295 _node(param4) 296 _node(param5) 297 _node(param6) 298 _node(param7) 299 _struct_label(minsiz) 300 _ends 301 302 303 ifdef([PPC64],[],[ 304 _struct(eabi_c_frame,0) 305 _word(backlink) 306 _word(savelr) 307 _word(param0) 308 _word(param1) 309 _word(param2) 310 _word(param3) 311 _word(param4) 312 _word(param5) 313 _word(param6) 314 _word(param7) 315 _struct_label(minsiz) 316 _ends 317 318 /* For entry to variable-argument-list functions 319 (e.g., via callback) */ 320 _struct(varargs_eabi_c_frame,0) 321 _word(backlink) 322 _word(savelr) 323 _struct_label(va_list) 324 _word(flags) /* gpr count byte, fpr count byte, padding */ 325 _word(overflow_arg_area) 326 _word(reg_save_area) 327 _field(padding,4) 328 _struct_label(regsave) 329 _field(gp_save,8*4) 330 _field(fp_save,8*8) 331 _word(old_backlink) 332 _word(old_savelr) 333 _struct_label(incoming_stack_args) 334 _ends 335 ]) 336 337 _struct(lisp_frame,0) 338 _node(backlink) 339 _node(savefn) 340 _node(savelr) 341 _node(savevsp) 342 _ends 343 344 _struct(vector,-fulltag_misc) 345 _node(header) 346 _struct_label(data) 347 _ends 348 349 _struct(binding,0) 350 _node(link) 351 _node(sym) 352 _node(val) 353 _ends 354 355 356 /* Nilreg-relative globals. Talking the assembler into doing something reasonable here */ 357 /* is surprisingly hard. */ 358 359 symbol_extra = symbol.size-fulltag_misc 360 num_lisp_globals = 48 /* MUST UPDATE THIS !!! */ 361 362 _struct(lisp_globals,nil_value-((4096+fulltag_nil))) 363 _struct_pad((1024-num_lisp_globals)*4) 364 _node(initial_tcr) /* initial thread tcr */ 365 _node(image_name) /* --image-name argument */ 366 _node(BADfpscr_save_high) /* high word of FP reg used to save FPSCR */ 367 _node(BADfpscr_save) /* saved FPSCR */ 368 _node(batch_flag) /* -b */ 369 _node(host_platform) /* for runtime platform-specific stuff */ 370 _node(argv) /* address of argv[0] */ 371 _node(errno) /* ADDRESS of errno */ 372 _node(tenured_area) /* the tenured_area */ 373 _node(oldest_ephemeral) /* dword address of oldest ephemeral object or 0 */ 374 _node(lisp_exit_hook) /* install foreign exception_handling */ 375 _node(lisp_return_hook) /* install lisp exception_handling */ 376 _node(double_float_one) /* high half of 1.0d0 */ 377 _node(short_float_zero) /* low half of 1.0d0 */ 378 _node(doh_head) /* creole objects header */ 379 _node(metering_info) /* address of lisp_metering global */ 380 _node(in_gc) /* non-zero when GC active */ 381 _node(lexpr_return1v) /* simpler when &lexpr called for single value. */ 382 _node(lexpr_return) /* magic &lexpr return code. */ 383 _node(all_areas) /* doubly-linked list of all memory areas */ 384 _node(BAD_cs_overflow_limit) /* limit for control-stack overflow check */ 385 _node(BAD_current_ts) /* current temp-stack area */ 386 _node(BAD_current_vs) /* current value-stack area */ 387 _node(statically_linked) /* non-zero if -static */ 388 _node(heap_end) /* end of lisp heap */ 389 _node(heap_start) /* start of lisp heap */ 390 _node(gcable_pointers) /* linked-list of weak macptrs. */ 391 _node(gc_num) /* fixnum: GC call count. */ 392 _node(fwdnum) /* fixnum: GC "forwarder" call count. */ 393 _node(altivec_present) /* non-zero when AltiVec available */ 394 _node(tb_trap_call) /* CallUniversalProc]s descriptor */ 395 _node(os_trap_call) /* CallOSTrapUnivesalProc]s descriptor */ 396 _node(gc_inhibit_count) 397 _node(intflag) /* sigint pending */ 398 _node(block_tag_counter) /* counter for (immediate) block tag */ 399 _node(go_tag_counter) /* counter for (immediate) go tag */ 400 _node(exception_lock) 401 _node(BADgc_lock) 402 _node(tcr_key) /* tsd key for per-thread tcr */ 403 _node(ret1val_addr) /* address of "dynamic" subprims magic values return addr */ 404 _node(subprims_base) /* address of dynamic subprims jump table */ 405 _node(appmain) /* probably don]t really need this */ 406 _node(emulator_registers) /* where the 68K emulator stores the emulated regs */ 407 _node(tcr_lock) /* this thread]s exception frame chain */ 408 _node(kernel_imports) /* some things we need imported for us */ 409 _node(interrupt_signal) /* signal used by PROCESS-INTERRUPT */ 410 _node(tcr_count) /* tcr_id for next tcr */ 411 _node(get_tcr) /* address of get_tcr() */ 412 _ends 413 414 lisp_globals.saveTOC = lisp_globals.emulator_registers 415 lisp_globals.saveR13 = lisp_globals.appmain 416 417 418 _struct(nrs,nil_value-fulltag_nil) 419 _struct_pad(fulltag_nil) 420 _field(nilptr,16-fulltag_nil) 421 422 _struct_pad(fulltag_misc) 423 _struct_label(tsym) 424 _struct_pad(symbol_extra) /* t */ 425 426 _struct_pad(fulltag_misc) 427 _struct_label(nilsym) 428 _struct_pad(symbol_extra) /* nil */ 429 430 _struct_pad(fulltag_misc) 431 _struct_label(errdisp) 432 _struct_pad(symbol_extra) /* %err-disp */ 433 434 _struct_pad(fulltag_misc) 435 _struct_label(cmain) 436 _struct_pad(symbol_extra) /* cmain */ 437 438 _struct_pad(fulltag_misc) 439 _struct_label(eval) 440 _struct_pad(symbol_extra) /* eval */ 441 442 _struct_pad(fulltag_misc) 443 _struct_label(appevalfn) 444 _struct_pad(symbol_extra) /* apply-evaluated-function */ 445 446 _struct_pad(fulltag_misc) 447 _struct_label(error) 448 _struct_pad(symbol_extra) /* error */ 449 450 _struct_pad(fulltag_misc) 451 _struct_label(defun) 452 _struct_pad(symbol_extra) /* %defun */ 453 454 _struct_pad(fulltag_misc) 455 _struct_label(defvar) 456 _struct_pad(symbol_extra) /* %defvar */ 457 458 _struct_pad(fulltag_misc) 459 _struct_label(defconstant) 460 _struct_pad(symbol_extra) /* %defconstant */ 461 462 _struct_pad(fulltag_misc) 463 _struct_label(macrosym) 464 _struct_pad(symbol_extra) /* %macro */ 465 466 _struct_pad(fulltag_misc) 467 _struct_label(kernelrestart) 468 _struct_pad(symbol_extra) /* %kernel-restart */ 469 470 _struct_pad(fulltag_misc) 471 _struct_label(package) 472 _struct_pad(symbol_extra) /* *package* */ 473 474 _struct_pad(fulltag_misc) 475 _struct_label(total_bytes_freed) /* *total-bytes-freed* */ 476 _struct_pad(symbol_extra) 477 478 _struct_pad(fulltag_misc) 479 _struct_label(kallowotherkeys) 480 _struct_pad(symbol_extra) /* allow-other-keys */ 481 482 _struct_pad(fulltag_misc) 483 _struct_label(toplcatch) 484 _struct_pad(symbol_extra) /* %toplevel-catch% */ 485 486 _struct_pad(fulltag_misc) 487 _struct_label(toplfunc) 488 _struct_pad(symbol_extra) /* %toplevel-function% */ 489 490 _struct_pad(fulltag_misc) 491 _struct_label(callbacks) 492 _struct_pad(symbol_extra) /* %pascal-functions% */ 493 494 _struct_pad(fulltag_misc) 495 _struct_label(allmeteredfuns) 496 _struct_pad(symbol_extra) /* *all-metered-functions* */ 497 498 _struct_pad(fulltag_misc) 499 _struct_label(total_gc_microseconds) /* *total-gc-microseconds* */ 500 _struct_pad(symbol_extra) 501 502 _struct_pad(fulltag_misc) 503 _struct_label(builtin_functions) /* %builtin-functions% */ 504 _struct_pad(symbol_extra) 505 506 _struct_pad(fulltag_misc) 507 _struct_label(udf) 508 _struct_pad(symbol_extra) /* %unbound-function% */ 509 510 _struct_pad(fulltag_misc) 511 _struct_label(init_misc) 512 _struct_pad(symbol_extra) /* %init-misc */ 513 514 _struct_pad(fulltag_misc) 515 _struct_label(macro_code) 516 _struct_pad(symbol_extra) /* %macro-code% */ 517 518 _struct_pad(fulltag_misc) 519 _struct_label(closure_code) 520 _struct_pad(symbol_extra) /* %closure-code% */ 521 522 _struct_pad(fulltag_misc) 523 _struct_label(new_gcable_ptr) /* %new-gcable-ptr */ 524 _struct_pad(symbol_extra) 525 526 _struct_pad(fulltag_misc) 527 _struct_label(gc_event_status_bits) 528 _struct_pad(symbol_extra) /* *gc-event-status-bits* */ 529 530 _struct_pad(fulltag_misc) 531 _struct_label(post_gc_hook) 532 _struct_pad(symbol_extra) /* *post-gc-hook* */ 533 534 _struct_pad(fulltag_misc) 535 _struct_label(handlers) 536 _struct_pad(symbol_extra) /* %handlers% */ 537 538 539 _struct_pad(fulltag_misc) 540 _struct_label(all_packages) 541 _struct_pad(symbol_extra) /* %all-packages% */ 542 543 _struct_pad(fulltag_misc) 544 _struct_label(keyword_package) 545 _struct_pad(symbol_extra) /* *keyword-package* */ 546 547 _struct_pad(fulltag_misc) 548 _struct_label(finalization_alist) 549 _struct_pad(symbol_extra) /* %finalization-alist% */ 550 551 _struct_pad(fulltag_misc) 552 _struct_label(foreign_thread_control) 553 _struct_pad(symbol_extra) /* %foreign-thread-control */ 554 555 _ends 556 557 define([def_header],[ 558 $1 = ($2<<num_subtag_bits)|$3]) 559 560 def_header(single_float_header,single_float.element_count,subtag_single_float) 561 def_header(double_float_header,double_float.element_count,subtag_double_float) 562 def_header(one_digit_bignum_header,1,subtag_bignum) 563 def_header(two_digit_bignum_header,2,subtag_bignum) 564 def_header(three_digit_bignum_header,3,subtag_bignum) 565 def_header(symbol_header,symbol.element_count,subtag_symbol) 566 def_header(value_cell_header,1,subtag_value_cell ) 567 def_header(macptr_header,macptr.element_count,subtag_macptr) 568 def_header(vectorH_header,vectorH.element_count,subtag_vectorH) 569 570 include(errors.s) 571 572 /* Symbol bits that we care about */ 573 sym_vbit_bound = (0+fixnum_shift) 574 sym_vbit_bound_mask = (1<<sym_vbit_bound) 575 sym_vbit_const = (1+fixnum_shift) 576 sym_vbit_const_mask = (1<<sym_vbit_const) 577 578 _struct(area,0) 579 _node(pred) 580 _node(succ) 581 _node(low) 582 _node(high) 583 _node(active) 584 _node(softlimit) 585 _node(hardlimit) 586 _node(code) 587 _node(markbits) 588 _node(ndwords) 589 _node(older) 590 _node(younger) 591 _node(h) 592 _node(sofprot) 593 _node(hardprot) 594 _node(owner) 595 _node(refbits) 596 _node(nextref) 597 _ends 598 599 600 /* This is only referenced by c->lisp code that needs to save/restore C NVRs in a TSP frame. */ 601 _struct(c_reg_save,0) 602 _node(tsp_link) /* backpointer */ 603 _node(tsp_mark) /* frame type */ 604 _node(save_fpscr) /* for Cs FPSCR */ 605 _field(save_gprs,19*4) /* r13-r31 */ 606 _dword(save_fp_zero) /* for fp_zero */ 607 _dword(save_fps32conv) 608 _ends 609 610 /* Indices in %builtin-functions% */ 611 _builtin_plus = 0 /* +-2 */ 612 _builtin_minus = 1 /* --2 */ 613 _builtin_times = 2 /* *-2 */ 614 _builtin_div = 3 /* /-2 */ 615 _builtin_eq = 4 /* =-2 */ 616 _builtin_ne = 5 /* /-2 */ 617 _builtin_gt = 6 /* >-2 */ 618 _builtin_ge = 7 /* >=-2 */ 619 _builtin_lt = 8 /* <-2 */ 620 _builtin_le = 9 /* <=-2 */ 621 _builtin_eql = 10 /* eql */ 622 _builtin_length = 11 /* length */ 623 _builtin_seqtype = 12 /* sequence-type */ 624 _builtin_assq = 13 /* assq */ 625 _builtin_memq = 14 /* memq */ 626 _builtin_logbitp = 15 /* logbitp */ 627 _builtin_logior = 16 /* logior-2 */ 628 _builtin_logand = 17 /* logand-2 */ 629 _builtin_ash = 18 /* ash */ 630 _builtin_negate = 19 /* %negate */ 631 _builtin_logxor = 20 /* logxor-2 */ 632 _builtin_aref1 = 21 /* %aref1 */ 633 _builtin_aset1 = 22 /* %aset1 */ 634 635 /* FPSCR status bits */ 636 fpscr_FX = 0 637 fpscr_FEX = 1 638 fpscr_VX = 2 639 fpscr_OX = 3 640 fpscr_UX = 4 641 fpscr_ZX = 5 642 fpscr_XX = 6 643 /* FPSCR control bits */ 644 fpscr_VE = 24 645 fpscr_OE = 25 646 fpscr_UE = 26 647 fpscr_ZE = 27 648 fpscr_XE = 28 649 650 651 /* 652 This should be (a) an (UNSIGNED-BYTE 16) and (b) one less than 653 TSTACK_SOFTPROT (defined in "area.h") 654 */ 655 tstack_alloc_limit = 0xffff 656 657 /* 658 Thread context record. 659 */ 660 _struct(tcr,0) 661 _node(prev) /* in doubly-linked list */ 662 _node(next) /* in doubly-linked list */ 663 _node(lisp_fpscr) /* lisp thread's fpscr (in low word) */ 664 _node(lisp_fpscr_low) 665 _node(db_link) /* special binding chain head */ 666 _node(catch_top) /* top catch frame */ 667 _node(save_vsp) /* VSP when in foreign code */ 668 _node(save_tsp) /* TSP when in foreign code */ 669 _node(cs_area) /* cstack area pointer */ 670 _node(vs_area) /* vstack area pointer */ 671 _node(ts_area) /* tstack area pointer */ 672 _node(cs_limit) /* cstack overflow limit */ 673 _node(bytes_consed_high) 674 _node(bytes_consed_low) 675 _node(interrupt_level) 676 _node(interrupt_pending) 677 _node(xframe) /* per-thread exception frame list */ 678 _node(errno_loc) /* per-thread errno location */ 679 _node(ffi_exception) /* fpscr exception bits from ff-call */ 680 _node(osid) /* OS thread id */ 681 _node(valence) /* odd when in foreign code */ 682 _node(foreign_exception_status) 683 _node(native_thread_info) 684 _node(native_thread_id) 685 _node(last_allocptr) 686 _node(save_allocptr) 687 _node(save_allocbase) 688 _node(reset_completion) 689 _node(activate) 690 _node(suspend_count) 691 _node(suspend_context) 692 _node(pending_exception_context) 693 _node(suspend) /* semaphore for suspension notify */ 694 _node(resume) /* sempahore for resumption notify */ 695 _node(flags) 696 _node(gc_context) 697 _node(suspend_total) 698 _node(suspend_total_on_exception_entry) 699 _node(tlb_limit) 700 _node(tlb_pointer) /* Consider using tcr+N as tlb_pointer */ 701 _node(shutdown_count) 702 _ends 703 704 TCR_FLAG_BIT_FOREIGN = fixnum_shift 705 TCR_FLAG_BIT_AWAITING_PRESET = (fixnum_shift+1) 706 /* Register usage: */ 707 708 709 define([rzero],[r0]) 710 define([sp],[r1]) 711 define([rcontext],[r2]) 712 define([imm0],[r3]) 713 define([imm1],[r4]) 714 define([imm2],[r5]) 715 define([imm3],[r6]) 716 define([imm4],[r7]) 717 define([imm5],[r8]) 718 define([allocptr],[r9]) 719 define([allocbase],[r10]) 720 define([nargs],[r11]) 721 define([tsp],[r12]) /* temp-consing stack. */ 722 define([vsp],[r13]) 723 define([loc_pc],[r14]) /* code vector locative */ 724 define([fn],[r15]) 725 define([temp4],[r16]) 726 define([temp3],[r17]) 727 define([temp2],[r18]) 728 define([temp1],[r19]) 729 define([temp0],[r20]) 730 define([arg_x],[r21]) 731 define([arg_y],[r22]) 732 define([arg_z],[r23]) 733 define([save7],[r24]) 734 define([save6],[r25]) 735 define([save5],[r26]) 736 define([save4],[r27]) 737 define([save3],[r28]) 738 define([save2],[r29]) 739 define([save1],[r30]) 740 define([save0],[r31]) 741 742 define([fname],[temp3]) 743 define([nfn],[temp2]) 744 define([next_method_context],[temp1]) 745 define([first_nvr],[save7]) 746 define([nargregs],[3]) 747 748 r0 = 0 749 r1 = 1 750 r2 = 2 751 r3 = 3 752 r4 = 4 753 r5 = 5 754 r6 = 6 755 r7 = 7 756 r8 = 8 757 r9 = 9 758 r10 = 10 759 r11 = 11 760 r12 = 12 761 r13 = 13 762 r14 = 14 763 r15 = 15 764 r16 = 16 765 r17 = 17 766 r18 = 18 767 r19 = 19 768 r20 = 20 769 r21 = 21 770 r22 = 22 771 r23 = 23 772 r24 = 24 773 r25 = 25 774 r26 = 26 775 r27 = 27 776 r28 = 28 777 r29 = 29 778 r30 = 30 779 r31 = 31 780 781 /* Lisp code keeps 0.0 in fp_zero */ 782 define([fp_zero],[f31]) /* a non-volatile reg as far as FFI is concerned. */ 783 define([fp_s32conv],[f30]) /* for s32->fp conversion */ 784 785 /* registers, as used in destrucuring-bind/macro-bind */ 786 787 define([whole_reg],[temp1]) 788 define([arg_reg],[temp3]) 789 define([keyvect_reg],[temp2]) 790 define([mask_req_start],[24]) 791 define([mask_req_width],[8]) 792 define([mask_opt_start],[16]) 793 define([mask_opt_width],[8]) 794 define([mask_key_start],[8]) 795 define([mask_key_width],[8]) 796 define([mask_initopt],[7]) 797 define([mask_keyp],[6]) /* note that keyp can be true even when 0 keys. */ 798 define([mask_aok],[5]) 799 define([mask_restp],[4]) 800 801 ifdef([DARWIN],[ 802 define([STACK_ALIGN],16) 803 define([STACK_ALIGN_MASK],15) 17 ifdef([PPC64],[ 18 include(constants64.s) 804 19 ],[ 805 define([STACK_ALIGN],8) 806 define([STACK_ALIGN_MASK],7) 807 ]) 808 809 define([TCR_STATE_FOREIGN],1) 810 define([TCR_STATE_LISP],0) 811 define([TCR_STATE_EXCEPTION_WAIT],2) 812 define([TCR_STATE_EXCEPTION_RETURN],4) 813 814 define([RESERVATION_DISCHARGE],0x1004) 20 include(constants32.s) 21 ])
Note:
See TracChangeset
for help on using the changeset viewer.
