Ignore:
Timestamp:
Oct 12, 2010, 11:52:12 AM (9 years ago)
Author:
gb
Message:

platform-linuxarm.h: since this is platform-specific anyway, reference
special-purpose registers/values in the machine context directly (may
be a little clearer than pretending that they were in the gpr vector.)

arm-excepions.[ch]: fix several bugs in pc_luser_xp() and the macros
that it uses, especially in the consus interruptus case. It's ...
better, but still needs work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/arm-exceptions.c

    r14330 r14354  
    15741574      } else {
    15751575        update_bytes_allocated(tcr, (void *) ptr_from_lispobj(cur_allocptr + disp));
    1576         xpGPR(xp, allocptr) = VOID_ALLOCPTR - disp;
     1576        xpGPR(xp, allocptr) = VOID_ALLOCPTR + disp;
     1577        instr = program_counter[-1];
     1578        if (IS_COMPARE_ALLOCPTR_TO_RM(instr)){
     1579          xpGPR(xp,RM_field(instr)) = VOID_ALLOCPTR;
     1580        } else {
     1581          Bug(NULL, "unexpected instruction preceding alloc trap.");
     1582        }
     1583        /* Clear the carry bit, so that the trap will be taken. */
     1584        xpPSR(xp) &= ~PSR_C_MASK;
    15771585      }
    15781586    } else {
    1579       /* If we're already past the alloc_trap, finish allocating
    1580          the object. */
    1581       if (allocptr_tag == fulltag_cons) {
    1582         finish_allocating_cons(xp);
     1587      /* we may be before or after the alloc trap.  If before, set
     1588         allocptr to VOID_ALLOCPTR and back up to the start of the
     1589         instruction sequence; if after, finish the allocation. */
     1590      Boolean before_alloc_trap = false;
     1591
     1592      if (IS_COMPARE_ALLOCPTR_TO_RM(instr)) {
     1593        before_alloc_trap = true;
     1594        --program_counter;
     1595        instr = *program_counter;
     1596      }
     1597      if (IS_LOAD_RD_FROM_ALLOCBASE(instr)) {
     1598        before_alloc_trap = true;
     1599        --program_counter;
     1600        instr = *program_counter;
     1601      }
     1602      if (IS_SUB_HI_FROM_ALLOCPTR(instr)) {
     1603        before_alloc_trap = true;
     1604        --program_counter;
     1605      }
     1606      if (before_alloc_trap) {
     1607        xpPC(xp) = program_counter;
     1608        xpGPR(xp,allocptr) = VOID_ALLOCPTR;
    15831609      } else {
    1584         if (allocptr_tag == fulltag_misc) {
    1585           finish_allocating_uvector(xp);
     1610        /* If we're already past the alloc_trap, finish allocating
     1611           the object. */
     1612        if (allocptr_tag == fulltag_cons) {
     1613          finish_allocating_cons(xp);
    15861614        } else {
    1587           Bug(xp, "what's being allocated here ?");
     1615          if (allocptr_tag == fulltag_misc) {
     1616            finish_allocating_uvector(xp);
     1617          } else {
     1618            Bug(xp, "what's being allocated here ?");
     1619          }
    15881620        }
     1621        /* Whatever we finished allocating, reset allocptr/allocbase to
     1622           VOID_ALLOCPTR */
     1623        xpGPR(xp,allocptr) = VOID_ALLOCPTR;
    15891624      }
    1590       /* Whatever we finished allocating, reset allocptr/allocbase to
    1591          VOID_ALLOCPTR */
    1592       xpGPR(xp,allocptr) = VOID_ALLOCPTR;
    15931625    }
    15941626    return;
Note: See TracChangeset for help on using the changeset viewer.