306
306
* We end up here when a BIF called from native signals an
307
* exceptional condition, and RESCHEDULE cannot occur.
307
* exceptional condition.
308
308
* HP was just read from P.
309
309
* NSP has not been saved in P.
310
310
* TEMP_LR contains a copy of LR
357
356
mov r0, #HIPE_MODE_SWITCH_RES_TRAP
359
357
str NSP, [P, #P_NSP]
360
358
str r1, [P, #P_ARITY]
361
359
str TEMP_LR, [P, #P_NRA]
365
* We end up here when a BIF called from native signals an
366
* exceptional condition, and RESCHEDULE can occur.
367
* r2 contains the address of the nbif which failed.
368
* HP was just read from P.
369
* NSP has not been saved in P.
370
* TEMP_ARG0 is the first actual parameter, if NR_ARG_REGS > 0.
371
* TEMP_ARG1 is the second actual parameter (if defined), if NR_ARG_REGS > 1.
372
* TEMP_ARG2 is the third actual parameter (if defined), if NR_ARG_REGS > 2.
374
.global nbif_1_hairy_exception
375
nbif_1_hairy_exception:
377
b .nbif_hairy_exception
378
.global nbif_2_hairy_exception
379
nbif_2_hairy_exception:
381
b .nbif_hairy_exception
382
.global nbif_3_hairy_exception
383
nbif_3_hairy_exception:
386
.nbif_hairy_exception:
387
ldr r0, [P, #P_FREASON]
388
cmp r0, #FREASON_RESCHEDULE
389
bne .nbif_simple_exception2
390
/* handle reschedule */
391
str r2, [P, #P_NCALLEE]
392
str TEMP_ARG0, [P, #P_ARG0]
393
str TEMP_ARG1, [P, #P_ARG1]
394
str TEMP_ARG2, [P, #P_ARG2]
395
mov r0, #HIPE_MODE_SWITCH_RES_RESCHEDULE
399
363
* nbif_stack_trap_ra: trap return address for maintaining
400
364
* the gray/white stack boundary