Changeset 13734
- Timestamp:
- May 22, 2010, 7:48:43 PM (15 years ago)
- File:
-
- 1 edited
-
branches/arm/lisp-kernel/ARM-notes.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/arm/lisp-kernel/ARM-notes.txt
r13687 r13734 220 220 fault handler and unprotect pages there.) 221 221 222 223 - consing & pc-lusering 224 225 The magic consing sequence (that pc_luser_xp() and maybe handle_alloc_trap() 226 will have to recognize) is basically: 227 228 1: decrement allocptr by an amount that'll leave it tagged as either 229 tag_misc or tag_cons. 230 231 a) CONSes: 232 (sub allocptr allocptr (:$ (- arm::cons.size arm::fulltag-cons))) 233 234 b) UVECTORs whose aligned size is known and <= 64K 235 (sub allocptr allocptr (:$ (logand (- size arm::fulltag-misc) #xff))) 236 (sub allocptr allocptr (:$ (logandc2 (- size arm::fulltag-misc)) #xff)) 237 238 Note that the second instruction above can be omitted if (<= size 256); 239 if two instructions are used to decrement allocptr, they should be 240 done in this order. 241 242 c) UVECTORs whose size is > 64K or computed; this should be preceded 243 something which loads (- size arm::fulltag-misc) into some imm reg REG: 244 245 (sub allocptr allocptr REG) 246 247 After this instruction (after the first in case (b)), allocptr is tagged 248 and the entire sequence needs to be completed or restarted by pc_luser_xp(). 249 250 2: Load (:@ rcontext (:$ arm::tcr.allocbase)) into some available GPR. 251 We can't afford to dedicate a register to contain allocbase, and 252 tcr.allobase can ordinarily change on any instruction boundardy so we 253 can only do this after decrementing and tagging allocptr in step 1 above. 254 255 (ldr reg2 (:@ rcontext (:$ arm::tcr.allocbase))) 256 257 "reg2" can't be the same register used in 1c and shouldn't conflict with 258 anything used to contain headers/CAR/CDR values, but can otherwise be 259 any GPR. 260 261 3: Compare allocptr to the register holding allocbase; do a uuo-alloc-trap 262 if allocptr is U< allocbase. (We could encode the "lo" condition in 263 uuo-alloc-trap if we wanted to>) 264 265 (cmp allocptr reg2) 266 (uuo-alloc-trap (:? lo)) 267 268 If the trap is taken, the handler should be able to determine the size 269 and tag of the allocation and resume execution at the next instruction 270 with allocptr pointing at zeroed memory. The register used to hold 271 allocbase won't change, but its value may or may not have anything to 272 do with tcr.allocbase at this point. 273 274 4: Initialize the object; if a UVECTOR, set its header. If a CONS, set 275 its CAR and CDR. 276 277 (str header (:@ allocptr (:$ arm::misc-header-offset))) 278 279 or 280 281 (str Rcar (:@ allocptr (:$ arm::cons.car))) 282 (str Rcdr (:@ allocptr (:$ arm::cons.cdr))) 283 284 5: Copy allocptr to the destination register. (In the CONS case, this may 285 have been one of Rcar/Rcdr); 286 287 (mov dest allocptr) 288 289 6: Clear the low 3 bits of allocptr. 290 291 (bic allocptr allocptr (:$ arm::fulltagmask)) 292 293 This is basically the same sequence as is used on the PPC; the differences 294 are: 295 296 a) We might decrement allocptr twice in (1b) 297 b) We don't use a dedicated register to contain allocbase, and have 298 to load it from the TCR into a temp register after allocptr's been 299 decremented. 300 c) We don't exactly have conditional traps, so we have to do a compare 301 followed by a conditional UUO. 302 303
Note:
See TracChangeset
for help on using the changeset viewer.
