Ignore:
Timestamp:
Dec 27, 2010, 2:24:42 AM (9 years ago)
Author:
gb
Message:

Some ARM implementations (the Qualcomm Snapdragon for one) will signal an
UNDEFINED-INSTRUCTION exception on a conditional UUO, even if
the condition is false; that basically means that we have to
branch around unconditional UUOs in order to run on such machines.

handle_alloc_trap() can recognize the extra branch in the consing
sequence; pc_luser_xp() needs to, but doesn't yet.

File:
1 edited

Legend:

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

    r14366 r14515  
    9797  pc program_counter = xpPC(xp);
    9898  opcode instr = *program_counter, prev_instr;
     99  int delta = -3;
    99100
    100101  if (IS_ALLOC_TRAP(instr)) {
    101102    /* The alloc trap must have been preceded by a cmp and a
    102103       load from tcr.allocbase. */
    103     prev_instr = program_counter[-3];
     104    if (IS_BRANCH_AROUND_ALLOC_TRAP(program_counter[-1])) {
     105      delta = -4;
     106    }
     107    prev_instr = program_counter[delta];
    104108
    105109    if (IS_SUB_RM_FROM_ALLOCPTR(prev_instr)) {
     
    114118      natural disp = ror(prev_instr&0xff,(prev_instr&0xf00)>>7);
    115119
    116       instr = program_counter[-4];
     120      instr = program_counter[delta-1];
    117121      if (IS_SUB_LO_FROM_ALLOCPTR(instr)) {
    118122        return -((signed_natural)(disp | (instr & 0xff)));
Note: See TracChangeset for help on using the changeset viewer.