Changeset 14169


Ignore:
Timestamp:
Aug 11, 2010, 11:40:32 AM (9 years ago)
Author:
gb
Message:

Lots more changes, most of which have to do with Mach exception handling
on ARM.

Location:
trunk/source/lisp-kernel
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/arm-asmutils.s

    r14119 r14169  
    128128
    129129_exportfn(C(pseudo_sigreturn))
    130         __(.long 0)
     130        __(uuo_pseudo_sigreturn())
    131131        __(b C(pseudo_sigreturn))
    132132_endfn
     
    147147
    148148        __ifdef(`DARWIN')
     149/* divide the 64-bit unsigned integer in r0/r1 by the 64-bit unsigned
     150   integer in r2/r3; return the 64-bit quotient in r0/r1 and the 64-bit
     151   remainder in r2/r3.  Implement this in terms of the libgcc function:
     152
     153   unsigned long long __udivti3 (unsigned long long a,
     154                                 unsigned long long b,
     155                                 unsigned long long *c)
     156*/       
    149157_exportfn(C(__aeabi_uldivmod))
    150         __(bx lr)
     158        __(stmdb sp!,{r7,lr})
     159        __(mov r7,sp)
     160        __(sub sp,sp,#8)
     161        __(mov ip,sp)
     162        __(push1(ip,sp))
     163        __(push1(ip,sp))
     164        __(bl C(__udivmoddi4))
     165        __(add sp,sp,#8)
     166        __(ldmia sp!,{r2,r3})
     167        __(ldmia sp!,{r7,pc})
    151168_endfn               
    152169        __endif
  • trunk/source/lisp-kernel/arm-exceptions.c

    r14119 r14169  
    20182018  pseudosigcontext = (ExceptionInformation *) ptr_from_lispobj(stackp);
    20192019
     2020  stackp -= sizeof(*mc);
    20202021  mc = (_STRUCT_MCONTEXT *) ptr_from_lispobj(stackp);
    20212022  memmove(&(mc->__ss),&ts,sizeof(ts));
     
    20942095  ts.__r[3] = (natural)old_valence;
    20952096  ts.__lr = (natural)pseudo_sigreturn;
     2097  ts.__cpsr = xpPSR(pseudosigcontext);
    20962098
    20972099
     
    21472149                      mach_msg_type_number_t code_count)
    21482150{
    2149   int signum = 0, code = *code_vector, code1;
     2151  int signum = 0, code = *code_vector;
    21502152  TCR *tcr = TCR_FROM_EXCEPTION_PORT(exception_port);
    21512153  kern_return_t kret;
     
    21582160    CLR_TCR_FLAG(tcr,TCR_FLAG_BIT_PENDING_EXCEPTION);
    21592161  }
     2162  /* On the ARM, code_vector[1] contains the undefined instruction
     2163     in this case, not its address.  */
    21602164  if ((exception == EXC_BAD_INSTRUCTION) &&
    21612165      (code_vector[0] == EXC_ARM_UNDEFINED) &&
    2162       (((code1 = code_vector[1]) == (int)pseudo_sigreturn))) {
     2166      (code_vector[1] == PSEUDO_SIGRETURN_UUO)) {
    21632167    kret = do_pseudo_sigreturn(thread, tcr);
    21642168  } else if (tcr->flags & (1<<TCR_FLAG_BIT_PROPAGATE_EXCEPTION)) {
  • trunk/source/lisp-kernel/arm-exceptions.h

    r14119 r14169  
    9393#define IS_DEFERRED_SUSPEND(i)       (((i)&0x0fffffff) == 0x07f005f0)
    9494
     95#define PSEUDO_SIGRETURN_UUO         (0xe7fffef1)
    9596
    9697OSStatus
  • trunk/source/lisp-kernel/arm-macros.s

    r14119 r14169  
    2828/* Load a 16-bit constant into $1 */
    2929define(`movc16',`
     30        __ifdef(`DARWIN')
     31        __(mov $1,#$2&0xff)
     32        __(orr $1,$1,#$2&0xff00)
     33        __else
    3034        __(movw $1,#$2)
     35        __endif
    3136        ')
    3237       
  • trunk/source/lisp-kernel/arm-uuo.s

    r14119 r14169  
    105105/* This should never be generated (never be a legal instruction in a code
    106106   vector); it should only be used by purify/impurify. */
    107 define(`forward_marker',`uuo(al,uuo_format_unary,0xfff)')
    108            
     107define(`forward_marker',`UUO(al,uuo_format_unary,0xfff)')
     108/* Used by Mach exception return */
     109define(`uuo_pseudo_sigreturn',`UUO(al,uuo_format_unary,0xffe)')
Note: See TracChangeset for help on using the changeset viewer.