Changeset 16083


Ignore:
Timestamp:
May 25, 2014, 8:39:48 PM (5 years ago)
Author:
gb
Message:

Propagate r15802 from trunk. Fixes ticket:1190

Location:
release/1.9/source/lisp-kernel
Files:
4 edited

Legend:

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

    r15425 r16083  
    217217_endfn                       
    218218                               
     219_exportfn(C(feature_check))
     220        .globl C(feature_check_ldrex)
     221        .globl C(feature_check_clrex)
     222        .globl C(feature_check_fpu)
     223C(feature_check_fpu):           
     224        __(fcmpd d15,d15)
     225C(feature_check_ldrex):
     226        __(ldrex r2,[sp])
     227C(feature_check_clrex):         
     228        __(.long 0xf57ff01f)    /* clrex */
     229        __(bx lr)
     230_endfn       
    219231        _endfile
    220232
  • release/1.9/source/lisp-kernel/arm-exceptions.c

    r15755 r16083  
    20532053
    20542054
     2055
     2056
     2057void
     2058early_signal_handler(int signum, siginfo_t *info, ExceptionInformation  *context)
     2059{
     2060  extern pc feature_check_fpu,feature_check_ldrex,feature_check_clrex;
     2061  extern int arm_architecture_version;
     2062 
     2063  if ((xpPC(context) == feature_check_fpu) ||
     2064      (xpPC(context) == feature_check_ldrex)) {
     2065    arm_architecture_version = 5;
     2066  } else {
     2067    arm_architecture_version = 6;
     2068  }
     2069  xpPC(context) = xpLR(context);
     2070}
  • release/1.9/source/lisp-kernel/arm-exceptions.h

    r15470 r16083  
    165165void
    166166normalize_tcr(ExceptionInformation *,TCR *, Boolean);
     167
     168void
     169install_signal_handler(int, void*, unsigned);
  • release/1.9/source/lisp-kernel/pmcl-kernel.c

    r15473 r16083  
    15801580#ifdef ARM
    15811581int
    1582 arm_architecture_version = 0;
     1582arm_architecture_version = 7;
    15831583
    15841584Boolean
     
    15871587  Boolean win = false;
    15881588#ifdef LINUX
    1589 /* It's hard to determine ARM features in general, and especially
    1590    hard to do so from user mode.  Parse /proc/cpuinfo.
    1591    According to Android's cpufeatures library, some ARMv6 chips
    1592    are reported to have archutecture version 7; check the ELF
    1593    architecture in this case.
    1594 
    1595    (In other words, we assume that we're on ARMv7 or later if
    1596    the reported architecture is > 7, or if it's = 7 and the
    1597    ELF architecture is "v7l".)
    1598 */
    1599   FILE *f = fopen("/proc/cpuinfo", "r");
    1600   char *procline = NULL, *cpuline = NULL, line[129], *workline;
    1601   size_t n;
    1602 
    1603   if (f) {
    1604     while (1) {
    1605       if (fgets(line,128,f)==NULL) {
    1606         break;
    1607       }
    1608       n = strlen(line);
    1609       if (strncmp(line,"Processor",sizeof("Processor")-1) == 0) {
    1610         procline = malloc(n+1);
    1611         strcpy(procline,line);
    1612         procline[n]='\0';
    1613       } else if (strncmp(line, "CPU architecture",sizeof("CPU architecture")-1) == 0) {
    1614         cpuline = malloc(n+1);
    1615         strcpy(cpuline,line);
    1616         cpuline[n] = '\0';
    1617       }
    1618     }
    1619     if (procline) {
    1620       win = (strstr(procline, "v7l") != NULL);
    1621       if (win) {
    1622         arm_architecture_version = 7;
    1623       } else {
    1624         win = (strstr(procline, "v6l") != NULL);
    1625         if (win) {
    1626           arm_architecture_version = 6;
    1627         } else {
    1628           if (cpuline) {
    1629             workline = index(cpuline,':');
    1630             if (workline) {
    1631               arm_architecture_version = strtol(workline+1,NULL,0);
    1632               if (arm_architecture_version >= ARM_ARCHITECTURE_min) {
    1633                 win = true;
    1634               }
    1635             }
    1636           }
    1637         }
    1638       }
    1639     }
    1640     if (procline) {
    1641       free(procline);
    1642     }
    1643     if (cpuline) {
    1644       free(cpuline);
    1645     }
    1646     fclose(f);
    1647   }
     1589  extern void feature_check(), early_signal_handler();
     1590
     1591  install_signal_handler(SIGILL, (void *)early_signal_handler,0);
     1592  feature_check();
     1593  win = arm_architecture_version >= 6;
     1594  install_signal_handler(SIGILL, NULL, 0);
     1595
    16481596#endif
    16491597  return win;
Note: See TracChangeset for help on using the changeset viewer.