summaryrefslogblamecommitdiff
path: root/user/haveged/fix-cpu-cache-size-detection.patch
blob: 07da2b46d94bbd3333a540d74592615cae6a91b8 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                              
Some ARM cpus does not report the cache size or say it is -1

diff --git a/src/havegetune.c b/src/havegetune.c
index f1a99f2..de39c53 100644
--- a/src/havegetune.c
+++ b/src/havegetune.c
@@ -795,6 +795,8 @@ static int vfs_configInfoCache(
          ctype = vfs_configFile(pAnchor, path, vfs_configType);
          strcpy(path+plen, "size");
          size  = vfs_configFile(pAnchor, path, vfs_configInt);
+	 if (size == -1)
+		 size = ctype == 'I' ? GENERIC_ICACHE : GENERIC_DCACHE;
          cfg_cacheAdd(pAnchor, SRC_VFS_INDEX,  pArgs[1], level, ctype, size);
          }
      }