aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-04-15 17:46:16 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-04-15 17:46:16 -0400
commit9b1379950e7de5e233495758fe1a92335d0e8080 (patch)
tree50193ce90f5ca9268b3a1ec09c82a0846ca1e49f
parent911e93a62a050e68d1e79f0f11edcdd68dbfc959 (diff)
Adding support for L1 cache as cluster size
-rw-r--r--litmus/litmus.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c
index c815c5ac492c..524f0e9198a6 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -561,9 +561,10 @@ static int proc_read_cluster_size(char *page, char **start,
561 int len; 561 int len;
562 if (cluster_cache_index == 2) 562 if (cluster_cache_index == 2)
563 len = snprintf(page, PAGE_SIZE, "L2\n"); 563 len = snprintf(page, PAGE_SIZE, "L2\n");
564 else 564 else if (cluster_cache_index == 3)
565 /* (cluster_cache_index == 3) */
566 len = snprintf(page, PAGE_SIZE, "L3\n"); 565 len = snprintf(page, PAGE_SIZE, "L3\n");
566 else if (cluster_cache_index == 1)
567 len = snprintf(page, PAGE_SIZE, "L1\n");
567 568
568 return len; 569 return len;
569} 570}
@@ -575,10 +576,10 @@ static int proc_write_cluster_size(struct file *file,
575{ 576{
576 int len; 577 int len;
577 /* L2, L3 */ 578 /* L2, L3 */
578 char cache_name[5]; 579 char cache_name[33];
579 580
580 if(count > 5) 581 if(count > 32)
581 len = 4; 582 len = 32;
582 else 583 else
583 len = count; 584 len = count;
584 585
@@ -595,6 +596,8 @@ static int proc_write_cluster_size(struct file *file,
595 cluster_cache_index = 2; 596 cluster_cache_index = 2;
596 else if (!strcmp(cache_name, "L3")) 597 else if (!strcmp(cache_name, "L3"))
597 cluster_cache_index = 3; 598 cluster_cache_index = 3;
599 else if (!strcmp(cache_name, "L1"))
600 cluster_cache_index = 1;
598 else 601 else
599 printk(KERN_INFO "Cluster '%s' is unknown.\n", cache_name); 602 printk(KERN_INFO "Cluster '%s' is unknown.\n", cache_name);
600 603