Ignore:
Timestamp:
Jan 12, 2010, 3:03:22 PM (11 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, 5, master
Children:
61df726
Parents:
29a3d72
Message:

add support for lpc32xx

Location:
c/src/lib/libbsp/arm/shared/abort
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/shared/abort/abort.c

    r29a3d72 r39c8fdb  
    6464{
    6565    char *mode;
    66     uint32_t prev_sp,prev_lr,cpsr,tmp;
     66    uint32_t prev_sp,prev_lr,cpsr,arm_switch_reg;
    6767    int i;
    6868
     
    7272    if(!mode) mode="unknown";
    7373
    74     asm volatile ("     MRS  %[cpsr], cpsr \n"
    75               " ORR  %[tmp], %[spsr], #0xc0 \n"
    76               " MSR  cpsr_c, %[tmp] \n"
     74    asm volatile (ARM_SWITCH_TO_ARM
     75              " MRS  %[cpsr], cpsr \n"
     76              " ORR  %[arm_switch_reg], %[spsr], #0xc0 \n"
     77              " MSR  cpsr_c, %[arm_switch_reg] \n"
    7778              " MOV  %[prev_sp], sp \n"
    7879              " MOV  %[prev_lr], lr \n"
    7980              " MSR  cpsr_c, %[cpsr] \n"
    80               : [prev_sp] "=&r" (prev_sp), [prev_lr] "=&r" (prev_lr),
    81                 [cpsr] "=&r" (cpsr), [tmp] "=&r" (tmp)
     81              ARM_SWITCH_BACK
     82              : [arm_switch_reg] "=&r" (arm_switch_reg), [prev_sp] "=&r" (prev_sp), [prev_lr] "=&r" (prev_lr),
     83                [cpsr] "=&r" (cpsr)
    8284              : [spsr] "r" (spsr)
    8385              : "cc");
  • c/src/lib/libbsp/arm/shared/abort/simple_abort.c

    r29a3d72 r39c8fdb  
    5757{
    5858  char *mode;
    59   uint32_t prev_sp,prev_lr,cpsr,tmp;
     59  uint32_t prev_sp,prev_lr,cpsr,arm_switch_reg;
    6060  int i, j;
    6161
     
    6666
    6767  asm volatile (
    68     THUMB_TO_ARM
     68    ARM_SWITCH_TO_ARM
    6969    "mrs %[cpsr], cpsr\n"
    70     "orr %[tmp], %[spsr], #0xc0\n"
    71     "msr cpsr_c, %[tmp]\n"
     70    "orr %[arm_switch_reg], %[spsr], #0xc0\n"
     71    "msr cpsr_c, %[arm_switch_reg]\n"
    7272    "mov %[prev_sp], sp\n"
    7373    "mov %[prev_lr], lr\n"
    7474    "msr cpsr_c, %[cpsr]\n"
    75     ARM_TO_THUMB
     75    ARM_SWITCH_BACK
    7676    : [prev_sp] "=&r" (prev_sp), [prev_lr] "=&r" (prev_lr),
    77       [cpsr] "=&r" (cpsr), [tmp] "=&r" (tmp)
     77      [cpsr] "=&r" (cpsr), [arm_switch_reg] "=&r" (arm_switch_reg)
    7878    : [spsr] "r" (spsr)
    7979    : "cc"
Note: See TracChangeset for help on using the changeset viewer.