Changeset 13958 for branches


Ignore:
Timestamp:
Jul 13, 2010, 5:58:35 AM (9 years ago)
Author:
gb
Message:

Get the kernel to compile/link/run enough to complain about a missing
image on ios.

Location:
branches/arm/lisp-kernel
Files:
1 added
4 edited

Legend:

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

    r13941 r13958  
    117117_exportfn(C(enable_fp_exceptions))
    118118        __(.long 0)
    119         __(blr)
     119        __(bx lr)
    120120_endfn
    121121       
    122122_exportfn(C(disable_fp_exceptions))
    123123        __(.long 0)
    124         __(blr)
     124        __(bx lr)
    125125_endfn
    126126
     
    131131        __endif
    132132       
    133 _exportfn(save_fp_context)
     133_exportfn(C(save_fp_context))
     134        __(uuo_debug_trap(al))
    134135_endfn         
    135 _exportfn(restore_fp_context)
     136_exportfn(C(restore_fp_context))
     137        __(uuo_debug_trap(al))
    136138_endfn         
    137 _exportfn(put_vector_registers)
     139_exportfn(C(put_vector_registers))
     140        __(uuo_debug_trap(al))
    138141_endfn         
    139 _exportfn(get_vector_registers)
     142_exportfn(C(get_vector_registers))
     143        __(uuo_debug_trap(al))
    140144_endfn         
    141145
     146        __ifdef(`DARWIN')
     147_exportfn(C(__aeabi_uldivmod))
     148        __(bx lr)
     149_endfn               
     150        __endif
    142151       
    143 
    144152        _endfile
  • branches/arm/lisp-kernel/arm-exceptions.c

    r13924 r13958  
    18481848{
    18491849  kern_return_t kret;
    1850   MCONTEXT_T mc = UC_MCONTEXT(pseudosigcontext);
     1850  _STRUCT_MCONTEXT *mc = UC_MCONTEXT(pseudosigcontext);
    18511851
    18521852  /* Set the thread's FP state from the pseudosigcontext */
    18531853  kret = thread_set_state(thread,
    1854                           ARM_FLOAT_STATE,
     1854                          ARM_VFP_STATE,
    18551855                          (thread_state_t)&(mc->__fs),
    1856                           ARM_FLOAT_STATE_COUNT);
     1856                          ARM_VFP_STATE_COUNT);
    18571857
    18581858  MACH_CHECK_ERROR("setting thread FP state", kret);
     
    19071907  kern_return_t result;
    19081908  ExceptionInformation *pseudosigcontext;
    1909   MCONTEXT_T mc;
     1909  _STRUCT_MCONTEXT *mc;
    19101910  natural stackp, backlink;
    19111911
     
    19201920    Bug(NULL, "Exception thread can't obtain thread state, Mach result = %d", result);
    19211921  }
    1922   stackp = ts.__r1;
     1922  stackp = ts.__sp;
    19231923  backlink = stackp;
    1924   stackp = TRUNC_DOWN(stackp, C_REDZONE_LEN, C_STK_ALIGN);
     1924
    19251925  stackp -= sizeof(*pseudosigcontext);
    19261926  pseudosigcontext = (ExceptionInformation *) ptr_from_lispobj(stackp);
    19271927
    1928   stackp = TRUNC_DOWN(stackp, sizeof(*mc), C_STK_ALIGN);
    1929   mc = (MCONTEXT_T) ptr_from_lispobj(stackp);
     1928  mc = (_STRUCT_MCONTEXT *) ptr_from_lispobj(stackp);
    19301929  memmove(&(mc->__ss),&ts,sizeof(ts));
    19311930
    1932   thread_state_count = PPC_FLOAT_STATE_COUNT;
     1931  thread_state_count = ARM_VFP_STATE_COUNT;
    19331932  thread_get_state(thread,
    1934                    PPC_FLOAT_STATE,
     1933                   ARM_VFP_STATE,
    19351934                   (thread_state_t)&(mc->__fs),
    19361935                   &thread_state_count);
    19371936
    19381937
    1939 #ifdef PPC64
    1940   thread_state_count = PPC_EXCEPTION_STATE64_COUNT;
    1941 #else
    1942   thread_state_count = PPC_EXCEPTION_STATE_COUNT;
    1943 #endif
     1938  thread_state_count = ARM_EXCEPTION_STATE_COUNT;
    19441939  thread_get_state(thread,
    1945 #ifdef PPC64
    1946                    PPC_EXCEPTION_STATE64,
    1947 #else
    1948                    PPC_EXCEPTION_STATE,
    1949 #endif
     1940                   ARM_EXCEPTION_STATE,
    19501941                   (thread_state_t)&(mc->__es),
    19511942                   &thread_state_count);
     
    19531944
    19541945  UC_MCONTEXT(pseudosigcontext) = mc;
    1955   stackp = TRUNC_DOWN(stackp, C_PARAMSAVE_LEN, C_STK_ALIGN);
    1956   stackp -= C_LINKAGE_LEN;
    1957   *(natural *)ptr_from_lispobj(stackp) = backlink;
    19581946  if (new_stack_top) {
    19591947    *new_stack_top = stackp;
     
    19861974                   TCR *tcr)
    19871975{
    1988 #ifdef PPC64
    1989   ppc_thread_state64_t ts;
    1990 #else
    1991   ppc_thread_state_t ts;
    1992 #endif
     1976  arm_thread_state_t ts;
    19931977  ExceptionInformation *pseudosigcontext;
    19941978  int old_valence = tcr->valence;
     
    20111995  */
    20121996
    2013   ts.__srr0 = (natural) handler_address;
    2014   ts.__srr1 = (int) xpMSR(pseudosigcontext) & ~MSR_FE0_FE1_MASK;
    2015   ts.__r1 = stackp;
    2016   ts.__r3 = signum;
    2017   ts.__r4 = (natural)pseudosigcontext;
    2018   ts.__r5 = (natural)tcr;
    2019   ts.__r6 = (natural)old_valence;
     1997  ts.__pc = (natural) handler_address;
     1998  ts.__sp = stackp;
     1999  ts.__r[0] = signum;
     2000  ts.__r[1] = (natural)pseudosigcontext;
     2001  ts.__r[2] = (natural)tcr;
     2002  ts.__r[3] = (natural)old_valence;
    20202003  ts.__lr = (natural)pseudo_sigreturn;
    20212004
    20222005
    2023 #ifdef PPC64
    2024   ts.__r13 = xpGPR(pseudosigcontext,13);
    2025   thread_set_state(thread,
    2026                    PPC_THREAD_STATE64,
    2027                    (thread_state_t)&ts,
    2028                    PPC_THREAD_STATE64_COUNT);
    2029 #else
    20302006  thread_set_state(thread,
    20312007                   MACHINE_THREAD_STATE,
    20322008                   (thread_state_t)&ts,
    20332009                   MACHINE_THREAD_STATE_COUNT);
    2034 #endif
    20352010#ifdef DEBUG_MACH_EXCEPTIONS
    20362011  fprintf(dbgout,"Set up exception context for 0x%x at 0x%x\n", tcr, tcr->pending_exception_context);
     
    20432018pseudo_signal_handler(int signum, ExceptionInformation *context, TCR *tcr, int old_valence)
    20442019{
    2045   signal_handler(signum, NULL, context, tcr, old_valence);
     2020  signal_handler(signum, NULL, context, tcr, old_valence, 0);
    20462021}
    20472022
     
    20502025thread_set_fp_exceptions_enabled(mach_port_t thread, Boolean enabled)
    20512026{
    2052 #ifdef PPC64
    2053   ppc_thread_state64_t ts;
    2054 #else
    2055   ppc_thread_state_t ts;
    2056 #endif
    2057   mach_msg_type_number_t thread_state_count;
    2058 
    2059 #ifdef PPC64
    2060   thread_state_count = PPC_THREAD_STATE64_COUNT;
    2061 #else
    2062   thread_state_count = PPC_THREAD_STATE_COUNT;
    2063 #endif
    2064   thread_get_state(thread,
    2065 #ifdef PPC64
    2066                    PPC_THREAD_STATE64,  /* GPRs, some SPRs  */
    2067 #else
    2068                    PPC_THREAD_STATE,    /* GPRs, some SPRs  */
    2069 #endif
    2070                    (thread_state_t)&ts,
    2071                    &thread_state_count);
    2072   if (enabled) {
    2073     ts.__srr1 |= MSR_FE0_FE1_MASK;
    2074   } else {
    2075     ts.__srr1 &= ~MSR_FE0_FE1_MASK;
    2076   }
    2077   /*
    2078      Hack-o-rama warning (isn't it about time for such a warning?):
    2079      pthread_kill() seems to want to lose the MSR's FE0/FE1 bits.
    2080      Our handler for lisp's use of pthread_kill() pushes a phony
    2081      lisp frame on the stack and force the context to resume at
    2082      the UUO in enable_fp_exceptions(); the "saveLR" field of that
    2083      lisp frame contains the -real- address that process_interrupt
    2084      should have returned to, and the fact that it's in a lisp
    2085      frame should convince the GC to notice that address if it
    2086      runs in the tiny time window between returning from our
    2087      interrupt handler and ... here.
    2088      If the top frame on the stack is a lisp frame, discard it
    2089      and set ts.srr0 to the saveLR field in that frame.  Otherwise,
    2090      just adjust ts.srr0 to skip over the UUO.
    2091   */
    2092   {
    2093     lisp_frame *tos = (lisp_frame *)ts.__r1,
    2094       *next_frame = tos->backlink;
    2095    
    2096     if (tos == (next_frame -1)) {
    2097       ts.__srr0 = tos->savelr;
    2098       ts.__r1 = (LispObj) next_frame;
    2099     } else {
    2100       ts.__srr0 += 4;
    2101     }
    2102   }
    2103   thread_set_state(thread,
    2104 #ifdef PPC64
    2105                    PPC_THREAD_STATE64,  /* GPRs, some SPRs  */
    2106 #else
    2107                    PPC_THREAD_STATE,    /* GPRs, some SPRs  */
    2108 #endif
    2109                    (thread_state_t)&ts,
    2110 #ifdef PPC64
    2111                    PPC_THREAD_STATE64_COUNT
    2112 #else
    2113                    PPC_THREAD_STATE_COUNT
    2114 #endif
    2115                    );
    2116 
     2027  /* Likely hopeless. */
    21172028  return 0;
    21182029}
     
    21562067  }
    21572068  if ((exception == EXC_BAD_INSTRUCTION) &&
    2158       (code_vector[0] == EXC_PPC_UNIPL_INST) &&
    2159       (((code1 = code_vector[1]) == (int)pseudo_sigreturn) ||
    2160        (code1 == (int)enable_fp_exceptions) ||
    2161        (code1 == (int)disable_fp_exceptions))) {
    2162     if (code1 == (int)pseudo_sigreturn) {
    2163       kret = do_pseudo_sigreturn(thread, tcr);
    2164 #if 0
    2165       fprintf(dbgout, "Exception return in 0x%x\n",tcr);
    2166 #endif
    2167        
    2168     } else if (code1 == (int)enable_fp_exceptions) {
    2169       kret = thread_set_fp_exceptions_enabled(thread, true);
    2170     } else kret =  thread_set_fp_exceptions_enabled(thread, false);
     2069      (code_vector[0] == EXC_ARM_UNDEFINED) &&
     2070      (((code1 = code_vector[1]) == (int)pseudo_sigreturn))) {
     2071    kret = do_pseudo_sigreturn(thread, tcr);
    21712072  } else if (tcr->flags & (1<<TCR_FLAG_BIT_PROPAGATE_EXCEPTION)) {
    21722073    CLR_TCR_FLAG(tcr,TCR_FLAG_BIT_PROPAGATE_EXCEPTION);
     
    21822083      break;
    21832084     
    2184     case EXC_SOFTWARE:
    2185       if (code == EXC_PPC_TRAP) {
    2186         signum = SIGTRAP;
    2187       }
    21882085      break;
    21892086     
  • branches/arm/lisp-kernel/arm-spentry.s

    r13921 r13958  
    39363936_endfn       
    39373937
    3938 _exportfn(nthrownv)
     3938_exportfn(C(nthrownv))
    39393939        new_local_labels()
    39403940local_label(nthrownv_nextframe):
  • branches/arm/lisp-kernel/darwinarm/Makefile

    r13923 r13958  
    1919AS = /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/arm/as
    2020M4 = m4
    21 ASFLAGS = -arch arm -force_cpusubtype_ALL
     21ASFLAGS = -arch armv6
    2222M4FLAGS = -DDARWIN -DARM
    23 CDEFINES = -DDARWIN -DARM -D_REENTRANT -D_GNU_SOURCE -DDISABLE_EGC -DGC_INTEGRITY_CHECKING
     23CC = /Developer/Platforms/iPhoneOS.platform/usr/bin/llvm-gcc-4.2
     24CDEFINES = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/ -DDARWIN -DARM -D_REENTRANT -D_GNU_SOURCE -DDISABLE_EGC -DGC_INTEGRITY_CHECKING -arch armv6
    2425CDEBUG = -g
    2526COPT = #-O2
     
    2930PLATFORM_H = platform-darwinarm.h
    3031
    31 # If the linker supports a "--hash-style=" option, use traditional
    32 # Sysv hash tables.  (If it doesn't support that option, assume
    33 # that traditional hash tables will be used by default.)
    34 ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=")
    35 ifeq ($(ld_has_hash_style),)
    36 HASH_STYLE=
    37 else
    38 HASH_STYLE="-Wl,--hash-style=sysv"
    39 endif
    4032
    41 
    42 # Likewise, some versions of GAS may need a "-a32" flag, to force the
    43 # output file to be 32-bit compatible.
    44 
    45 A32 = $(shell ($(AS) --help -v 2>&1 | grep -q -e "-a32") && /bin/echo "-a32")
    4633
    4734.s.o:
    4835        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(A32) $(ASFLAGS) -o $@
    4936.c.o:
    50         $(CC) -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) -marm $(WFORMAT)  -o $@
     37        $(CC) -arch arm -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) -marm $(WFORMAT)  -o $@
    5138
    52 SPOBJ = pad.o  arm-spentry.o arm-subprims.o
     39SPOBJ = arm-spentry.o arm-subprims.o
    5340ASMOBJ = arm-asmutils.o imports.o
    5441
     
    6552        Threads.h arm-exceptions.h $(PLATFORM_H)
    6653
    67 # Subprims linked into the kernel ?
    68 # Yes:
    6954
    7055KSPOBJ = $(SPOBJ)
    71 all:    ../../armcl
     56all:    ../../darmcl
     57
     58OSLIBS = /Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/lib/gcc/arm-apple-darwin10/4.2.1/v6/libgcc.a -lSystem /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib/crt1.o /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3/Symbols/usr/lib/libgcc_s.1.dylib
    7259
    7360
    74 # No:
    75 
    76 # KSPOBJ=
    77 # all:  ../../ppccl ../../subprims.so
    78 
    79 OSLIBS = -ldl -lm -lpthread
    80 
    81 
    82 ../../armcl:    $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)
    83         $(CC)  $(CDEBUG)  -Wl,--export-dynamic $(HASH_STYLE) -o $@ -T ./armdarwin.x $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS)
     61../../darmcl:   $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)
     62        $(LD) -pagezero_size 0x8000 $(KSPOBJ) -L/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3/Symbols/usr/lib  -arch armv6 -o $@   $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS)
    8463
    8564
     
    9170
    9271cclean:
    93         $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../ppccl
     72        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../darmcl
    9473
    9574clean:  cclean
    9675        $(RM) -f $(SPOBJ)
    9776
    98 strip:  ../../ppccl
    99         strip -g ../../ppccl
     77strip:  ../../darmcl
     78        strip -g ../../darmcl
Note: See TracChangeset for help on using the changeset viewer.