Skip to content

Commit

Permalink
Correct sysconf constants
Browse files Browse the repository at this point in the history
Only level 1 distinguishes between data and intstruction cache
  • Loading branch information
Ignition authored and andikleen committed Jan 4, 2019
1 parent 9555fd2 commit 4fda899
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clearcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ unsigned cache_size(void)
#ifdef _SC_LEVEL1_DCACHE_SIZE
cs += sysconf(_SC_LEVEL1_DCACHE_SIZE);
#endif
#ifdef _SC_LEVEL2_DCACHE_SIZE
cs += sysconf(_SC_LEVEL2_DCACHE_SIZE);
#ifdef _SC_LEVEL2_CACHE_SIZE
cs += sysconf(_SC_LEVEL2_CACHE_SIZE);
#endif
#ifdef _SC_LEVEL3_DCACHE_SIZE
cs += sysconf(_SC_LEVEL3_DCACHE_SIZE);
#ifdef _SC_LEVEL3_CACHE_SIZE
cs += sysconf(_SC_LEVEL3_CACHE_SIZE);
#endif
#ifdef _SC_LEVEL4_DCACHE_SIZE
cs += sysconf(_SC_LEVEL4_DCACHE_SIZE);
#ifdef _SC_LEVEL4_CACHE_SIZE
cs += sysconf(_SC_LEVEL4_CACHE_SIZE);
#endif
if (cs == 0) {
static int warned;
Expand Down

0 comments on commit 4fda899

Please sign in to comment.