Changeset 7268
- Timestamp:
- Sep 21, 2007, 4:10:17 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ia32/lisp-kernel/x86-constants32.s
r7243 r7268 1 define([imm0],[eax]) 2 define([temp0],[ecx]) 3 define([temp1],[edx]) 4 define([arg_z],[ebx]) 5 define([arg_y],[esi]) 6 define([fn],[edi]) 7 8 define([rcontext],[fs]) 9 10 define([allocptr],[temp0]) 11 12 define([fp0],[xmm0]) 13 define([fp1],[xmm1]) 14 define([fp2],[xmm2]) 15 define([fp3],[xmm3]) 16 define([fp4],[xmm4]) 17 define([fp5],[xmm5]) 18 define([fp6],[xmm6]) 19 define([fp7],[xmm7]) 20 define([fpzero],[fp7]) 21 1 22 nbits_in_word = 32 2 23 nbits_in_byte = 8 … … 37 58 fulltag_immheader = 7 38 59 60 define([define_subtag],[subtag_$1 = ($2 | ($3 << ntagbits))]) 61 define([define_imm_subtag],[define_subtag($1,fulltag_immheader,$2)]) 62 define([define_node_subtag],[define_subtag($1,fulltag_nodeheader,$2)]) 63 64 define_imm_subtag(bignum,0) 65 min_numeric_subtag = subtag_bignum 66 define_node_subtag(ratio,1) 67 max_rational_subtag = subtag_ratio 68 define_imm_subtag(single_float,1) 69 define_imm_subtag(double_float,2) 70 min_float_subtag = subtag_single_float 71 max_float_subtag = subtag_double_float 72 max_real_subtag = subtag_double_float 73 define_node_subtag(complex,3) 74 max_numeric_subtag = subtag_complex 75 76 define_imm_subtag(bit_vector,31) 77 define_imm_subtag(double_float_vector,30) 78 define_imm_subtag(s16_vector,29) 79 define_imm_subtag(u16_vector,28) 80 min_16_bit_ivector_subtag = subtag_u16_vector 81 max_16_bit_ivector_subtag = subtag_s16_vector 82 define_imm_subtag(s8_vector,26) 83 define_imm_subtag(u8_vector,25) 84 min_8_bit_ivector_subtag = subtag_u8_vector 85 max_8_bit_ivector_subtag = fulltag_immheader|(27<<ntagbits) 86 define_imm_subtag(simple_base_string,24) 87 define_imm_subtag(fixnum_vector,23) 88 define_imm_subtag(s32_vector,22) 89 define_imm_subtag(u32_vector,21) 90 define_imm_subtag(single_float_vector,20) 91 max_32_bit_ivector_subtag = fulltag_immheader|(24<<ntagbits) 92 min_cl_ivector_subtag = subtag_single_float_vector 93 94 define_node_subtag(arrayH,19) 95 define_node_subtag(vectorH,20) 96 define_node_subtag(simple_vector,21) 97 min_vector_subtag = subtag_vectorH 98 min_array_subtag = subtag_arrayH 99 100 define_imm_subtag(macptr,3) 101 min_non_numeric_imm_subtag = subtag_macptr 102 103 define_imm_subtag(dead_macptr,4) 104 define_imm_subtag(xcode_vector,5) 105 define_imm_subtag(unbound,6) 106 unbound_marker = subtag_unbound 107 undefined = unbound_marker 108 109 define_imm_subtag(character,9) 110 define_imm_subtag(slot_unbound,10) 111 slot_unbound_marker = subtag_slot_unbound 112 define_imm_subtag(illegal,11) 113 illegal = subtag_illegal 114 115 define_imm_subtag(reserved_frame,29) 116 reserved_frame_marker = subtag_reserved_frame 117 define_imm_subtag(no_thread_local_binding,30) 118 no_thread_local_binding_marker = subtag_no_thread_local_binding 119 define_imm_subtag(function_boundary_marker,31) 120 function_boundary_marker = subtag_function_boundary_marker 121 122 max_non_array_imm_subtag = (18<<ntagbits)|fulltag_immheader 123 124 define_node_subtag(catch_frame,4) 125 define_node_subtag(function,5) 126 define_node_subtag(basic_stream,6) 127 define_node_subtag(symbol,7) 128 define_node_subtag(lock,8) 129 define_node_subtag(hash_vector,9) 130 define_node_subtag(pool,10) 131 define_node_subtag(weak,11) 132 define_node_subtag(package,12) 133 define_node_subtag(slot_vector,13) 134 define_node_subtag(instance,14) 135 define_node_subtag(struct,15) 136 define_node_subtag(istruct,16) 137 define_node_subtag(value_cell,17) 138 define_node_subtag(xfunction,18) 139 140 max_non_array_node_subtag = (18<<ntagbits)|fulltag_immheader 141 142 misc_header_offset = -fulltag_misc 143 misc_subtag_offset = misc_header_offset 144 misc_data_offset = misc_header_offset+node_size 145 misc_dfloat_offset = misc_data_offset+8 146 147 nil_value = (0x3000 + fulltag_cons) 148 t_value = (0x3008 + fulltag_misc) 149 t_offset = (t_value-nil_value) 150 misc_bias = fulltag_misc 151 cons_bias = fulltag_cons 152 153 _struct(cons,-cons_bias) 154 _node(cdr) 155 _node(car) 156 _ends 157 158 _structf(ratio) 159 _node(numer) 160 _node(denom) 161 _endstructf 162 163 _structf(single_float) 164 _word(value) 165 _endstructf 166 167 _structf(double_float) 168 _word(pad) 169 _dword(value) 170 _endstructf 171 172 _structf(macptr) 173 _node(address) 174 _node(domain) 175 _node(type) 176 _endstructf 177 178 _structf(catch_frame) 179 _node(catch_tag) /* #<unbound> -> unwind-protect, else catch */ 180 _node(link) /* backpointer to previous catch frame */ 181 _node(mvflag) /* 0 if single-valued catch, fixnum 1 otherwise */ 182 _node(esp) /* saved lisp esp */ 183 _node(ebp) /* saved lisp ebp */ 184 _node(foreign_sp) /* necessary? */ 185 _node(db_link) /* head of special-binding chain */ 186 _node(_save3) /* saved nvrs (probably won't have any on IA-32 */ 187 _node(_save2) 188 _node(_save1) 189 _node(_save0) 190 _node(xframe) /* exception frame chain */ 191 _node(pc) /* TRA of catch exit or cleanup form */ 192 _endstructf 193 194 _struct(_function,-misc_bias) 195 _node(header) 196 _node(codevector) 197 _ends 198 199 _struct(tsp_frame,0) 200 _node(backlink) 201 _node(type) 202 _struct_label(fixed_overhead) 203 _struct_label(data_offset) 204 _ends 205 206 _structf(symbol) 207 _node(pname) 208 _node(vcell) 209 _node(fcell) 210 _node(package_predicate) 211 _node(flags) 212 _node(plist) 213 _node(binding_index) 214 _endstructf 215 216 _structf(vectorH) 217 _node(logsize) 218 _node(physsize) 219 _node(data_vector) 220 _node(displacement) 221 _node(flags) 222 _endstructf 223 224 _structf(arrayH) 225 _node(rank) 226 _node(physsize) 227 _node(data_vector) 228 _node(displacement) 229 _node(flags) 230 _struct_label(dim0) 231 _endstructf 232 233 _struct(lisp_frame,0) 234 _node(backlink) 235 _node(savera0) 236 _ends 237 238 _struct(vector,-fulltag_misc) 239 _node(header) 240 _struct_label(data) 241 _ends 242 243 _struct(binding,0) 244 _node(link) 245 _node(sym) 246 _node(val) 247 _ends 248 249 symbol_extra = symbol.size-fulltag_misc 250 251 _struct(nrs,0x3008) 252 _struct_pad(fulltag_misc) 253 _struct_label(tsym) 254 _struct_pad(symbol_extra) /* t */ 255 256 _struct_pad(fulltag_misc) 257 _struct_label(nilsym) 258 _struct_pad(symbol_extra) /* nil */ 259 260 _struct_pad(fulltag_misc) 261 _struct_label(errdisp) 262 _struct_pad(symbol_extra) /* %err-disp */ 263 264 _struct_pad(fulltag_misc) 265 _struct_label(cmain) 266 _struct_pad(symbol_extra) /* cmain */ 267 268 _struct_pad(fulltag_misc) 269 _struct_label(eval) 270 _struct_pad(symbol_extra) /* eval */ 271 272 _struct_pad(fulltag_misc) 273 _struct_label(appevalfn) 274 _struct_pad(symbol_extra) /* apply-evaluated-function */ 275 276 _struct_pad(fulltag_misc) 277 _struct_label(error) 278 _struct_pad(symbol_extra) /* error */ 279 280 _struct_pad(fulltag_misc) 281 _struct_label(defun) 282 _struct_pad(symbol_extra) /* %defun */ 283 284 _struct_pad(fulltag_misc) 285 _struct_label(defvar) 286 _struct_pad(symbol_extra) /* %defvar */ 287 288 _struct_pad(fulltag_misc) 289 _struct_label(defconstant) 290 _struct_pad(symbol_extra) /* %defconstant */ 291 292 _struct_pad(fulltag_misc) 293 _struct_label(macrosym) 294 _struct_pad(symbol_extra) /* %macro */ 295 296 _struct_pad(fulltag_misc) 297 _struct_label(kernelrestart) 298 _struct_pad(symbol_extra) /* %kernel-restart */ 299 300 _struct_pad(fulltag_misc) 301 _struct_label(package) 302 _struct_pad(symbol_extra) /* *package* */ 303 304 _struct_pad(fulltag_misc) 305 _struct_label(total_bytes_freed) 306 _struct_pad(symbol_extra) /* *total-bytes-freed* */ 307 308 _struct_pad(fulltag_misc) 309 _struct_label(kallowotherkeys) 310 _struct_pad(symbol_extra) /* allow-other-keys */ 311 312 _struct_pad(fulltag_misc) 313 _struct_label(toplcatch) 314 _struct_pad(symbol_extra) /* %toplevel-catch% */ 315 316 _struct_pad(fulltag_misc) 317 _struct_label(toplfunc) 318 _struct_pad(symbol_extra) /* %toplevel-function% */ 319 320 _struct_pad(fulltag_misc) 321 _struct_label(callbacks) 322 _struct_pad(symbol_extra) /* %pascal-functions% */ 323 324 _struct_pad(fulltag_misc) 325 _struct_label(allmeteredfuns) 326 _struct_pad(symbol_extra) /* *all-metered-functions* */ 327 328 _struct_pad(fulltag_misc) 329 _struct_label(total_gc_microseconds) 330 _struct_pad(symbol_extra) /* *total-gc-microseconds* */ 331 332 _struct_pad(fulltag_misc) 333 _struct_label(builtin_functions) 334 _struct_pad(symbol_extra) /* %builtin-functions% */ 335 336 _struct_pad(fulltag_misc) 337 _struct_label(udf) 338 _struct_pad(symbol_extra) /* %unbound-function% */ 339 340 _struct_pad(fulltag_misc) 341 _struct_label(init_misc) 342 _struct_pad(symbol_extra) /* %init-misc */ 343 344 _struct_pad(fulltag_misc) 345 _struct_label(macro_code) 346 _struct_pad(symbol_extra) /* %macro-code% */ 347 348 _struct_pad(fulltag_misc) 349 _struct_label(closure_code) 350 _struct_pad(symbol_extra) /* %closure-code% */ 351 352 _struct_pad(fulltag_misc) 353 _struct_label(new_gcable_ptr) 354 _struct_pad(symbol_extra) /* %new-gcable-ptr */ 355 356 _struct_pad(fulltag_misc) 357 _struct_label(gc_event_status_bits) 358 _struct_pad(symbol_extra) /* *gc-event-status-bits* */ 359 360 _struct_pad(fulltag_misc) 361 _struct_label(post_gc_hook) 362 _struct_pad(symbol_extra) /* *post-gc-hook* */ 363 364 _struct_pad(fulltag_misc) 365 _struct_label(handlers) 366 _struct_pad(symbol_extra) /* %handlers% */ 367 368 _struct_pad(fulltag_misc) 369 _struct_label(all_packages) 370 _struct_pad(symbol_extra) /* %all-packages% */ 371 372 _struct_pad(fulltag_misc) 373 _struct_label(keyword_package) 374 _struct_pad(symbol_extra) /* *keyword-package* */ 375 376 _struct_pad(fulltag_misc) 377 _struct_label(finalization_alist) 378 _struct_pad(symbol_extra) /* %finalization-alist% */ 379 380 _struct_pad(fulltag_misc) 381 _struct_label(foreign_thread_control) 382 _struct_pad(symbol_extra) /* %foreign-thread-control */ 383 384 _ends 385 386 define([def_header],[$1 = ($2<<num_subtag_bits)|$3]) 387 388 def_header(single_float_header,single_float.element_count,subtag_single_float) 389 def_header(double_float_header,double_float.element_count,subtag_double_float) 390 def_header(one_digit_bignum_header,1,subtag_bignum) 391 def_header(two_digit_bignum_header,2,subtag_bignum) 392 def_header(three_digit_bignum_header,3,subtag_bignum) 393 def_header(symbol_header,symbol.element_count,subtag_symbol) 394 def_header(value_cell_header,1,subtag_value_cell) 395 def_header(macptr_header,macptr.element_count,subtag_macptr) 396 def_header(vectorH_header,vectorH.element_count,subtag_vectorH) 397 398 include(errors.s) 399 400 /* Symbol bits that we care about */ 401 sym_vbit_bound = (0+fixnum_shift) 402 sym_vbit_bound_mask = (1<<sym_vbit_bound) 403 sym_vbit_const = (1+fixnum_shift) 404 sym_vbit_const_mask = (1<<sym_vbit_const) 405 406 _struct(area,0) 407 _node(pred) 408 _node(succ) 409 _node(low) 410 _node(high) 411 _node(active) 412 _node(softlimit) 413 _node(hardlimit) 414 _node(code) 415 _node(markbits) 416 _node(ndwords) 417 _node(older) 418 _node(younger) 419 _node(h) 420 _node(sofprot) 421 _node(hardprot) 422 _node(owner) 423 _node(refbits) 424 _node(nextref) 425 _ends 426 39 427 TCR_BIAS = 0 40 428 … … 42 430 43 431 _struct(tcr,TCR_BIAS) 44 _node(prev) /* in doubly-linked list 45 _node(next) /* in doubly-linked list 432 _node(prev) /* in doubly-linked list */ 433 _node(next) /* in doubly-linked list */ 46 434 _word(node_regs_mask) 47 _node(linear) /* our linear (non-segment-based) address. 48 _node(save_ebp) /* lisp EBP when in foreign code 435 _node(linear) /* our linear (non-segment-based) address. */ 436 _node(save_ebp) /* lisp EBP when in foreign code */ 49 437 _word(lisp_mxcsr) 50 438 _word(foreign_mxcsr) 51 _node(db_link) /* special binding chain head 52 _node(catch_top) /* top catch frame 53 _node(save_vsp) /* VSP when in foreign code 54 _node(save_tsp) /* TSP when in foreign code 55 _node(foreign_sp) /* Saved foreign SP when in lisp code 56 _node(cs_area) /* cstack area pointer 57 _node(vs_area) /* vstack area pointer 58 _node(ts_area) /* tstack area pointer 59 _node(cs_limit) /* cstack overflow limit 439 _node(db_link) /* special binding chain head */ 440 _node(catch_top) /* top catch frame */ 441 _node(save_vsp) /* VSP when in foreign code */ 442 _node(save_tsp) /* TSP when in foreign code */ 443 _node(foreign_sp) /* Saved foreign SP when in lisp code */ 444 _node(cs_area) /* cstack area pointer */ 445 _node(vs_area) /* vstack area pointer */ 446 _node(ts_area) /* tstack area pointer */ 447 _node(cs_limit) /* cstack overflow limit */ 60 448 _word(bytes_consed_low) 61 449 _word(bytes_consed_high) 62 450 _node(log2_allocation_quantum) 63 451 _node(interrupt_pending) 64 _node(xframe) /* per-thread exception frame list 65 _node(errno_loc) /* per-thread errno location 66 _node(ffi_exception) /* mxcsr exception bits from ff-call 67 _node(osid) /* OS thread id 68 _node(valence) /* odd when in foreign code 452 _node(xframe) /* per-thread exception frame list */ 453 _node(errno_loc) /* per-thread errno location */ 454 _node(ffi_exception) /* mxcsr exception bits from ff-call */ 455 _node(osid) /* OS thread id */ 456 _node(valence) /* odd when in foreign code */ 69 457 _node(foreign_exception_status) 70 458 _node(native_thread_info) … … 78 466 _node(suspend_context) 79 467 _node(pending_exception_context) 80 _node(suspend) /* semaphore for suspension notify 81 _node(resume) /* sempahore for resumption notify 468 _node(suspend) /* semaphore for suspension notify */ 469 _node(resume) /* sempahore for resumption notify */ 82 470 _node(flags) 83 471 _node(gc_context) … … 85 473 _node(unwinding) 86 474 _node(tlb_limit) 87 _node(tlb_pointer) /* Consider using tcr+N as tlb_pointer 475 _node(tlb_pointer) /* Consider using tcr+N as tlb_pointer */ 88 476 _node(shutdown_count) 89 477 _node(next_tsp) … … 92 480 _word(ldt_selector) 93 481 _ends 482 483 TCR_FLAG_BIT_FOREIGN = fixnum_shift 484 TCR_FLAG_BIT_AWAITING_PRESET = (fixnum_shift+1) 485 TCR_FLAG_BIT_ALT_SUSPEND = (fixnumshift+2) 486 TCR_FLAG_BIT_PROPAGATE_EXCEPTION = (fixnumshift+3) 487 TCR_FLAG_BIT_SUSPEND_ACK_PENDING = (fixnumshift+4) 488 TCR_FLAG_BIT_PENDING_EXCEPTION = (fixnumshift+5) 489 TCR_FLAG_BIT_FOREIGN_EXCEPTION = (fixnumshift+6) 490 491 target_most_positive_fixnum = 536870911 492 target_most_negative_fixnum = -536870912 493 494 lisp_globals_limit = 0x3000 495 496 INTERRUPT_LEVEL_BINDING_INDEX = fixnumone
Note: See TracChangeset
for help on using the changeset viewer.