Author: ian
Date: Fri May 15 18:07:58 2015
New Revision: 282983
URL: https://svnweb.freebsd.org/changeset/base/282983

Log:
  Retrieve the cache parms in the proper arch-specific way.
  
  Submitted by: Michal Meloun <mel...@miracle.cz>

Modified:
  head/sys/arm/arm/cpuinfo.c

Modified: head/sys/arm/arm/cpuinfo.c
==============================================================================
--- head/sys/arm/arm/cpuinfo.c  Fri May 15 18:04:49 2015        (r282982)
+++ head/sys/arm/arm/cpuinfo.c  Fri May 15 18:07:58 2015        (r282983)
@@ -131,8 +131,17 @@ cpuinfo_init(void)
        cpuinfo.security_ext = (cpuinfo.id_pfr1 >> 4) & 0xF;
 
        /* L1 Cache sizes */
-       cpuinfo.dcache_line_size = 1 << (CPU_CT_DMINLINE(cpuinfo.ctr ) + 2);
+       if (CPU_CT_FORMAT(cpuinfo.ctr) == CPU_CT_ARMV7) {
+               cpuinfo.dcache_line_size =
+                   1 << (CPU_CT_DMINLINE(cpuinfo.ctr) + 2);
+               cpuinfo.icache_line_size =
+                   1 << (CPU_CT_IMINLINE(cpuinfo.ctr) + 2);
+       } else {
+               cpuinfo.dcache_line_size =
+                   1 << (CPU_CT_xSIZE_LEN(CPU_CT_DSIZE(cpuinfo.ctr)) + 3);
+               cpuinfo.icache_line_size =
+                   1 << (CPU_CT_xSIZE_LEN(CPU_CT_ISIZE(cpuinfo.ctr)) + 3);
+       }
        cpuinfo.dcache_line_mask = cpuinfo.dcache_line_size - 1;
-       cpuinfo.icache_line_size= 1 << (CPU_CT_IMINLINE(cpuinfo.ctr ) + 2);
        cpuinfo.icache_line_mask = cpuinfo.icache_line_size - 1;
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to