Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
cache.c File Reference
#include <linux/notifier.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/cpu.h>
#include <asm/facility.h>

Go to the source code of this file.

Data Structures

struct  cache
 
struct  cache_dir
 
struct  cache_index_dir
 
struct  cache_info
 
union  cache_topology
 

Macros

#define CACHE_MAX_LEVEL   8
 
#define DEFINE_CACHE_ATTR(_name, _format, _value)
 

Enumerations

enum  { CACHE_SCOPE_NOTEXISTS, CACHE_SCOPE_PRIVATE, CACHE_SCOPE_SHARED, CACHE_SCOPE_RESERVED }
 
enum  { CACHE_TYPE_SEPARATE, CACHE_TYPE_DATA, CACHE_TYPE_INSTRUCTION, CACHE_TYPE_UNIFIED }
 
enum  { EXTRACT_TOPOLOGY, EXTRACT_LINE_SIZE, EXTRACT_SIZE, EXTRACT_ASSOCIATIVITY }
 
enum  { CACHE_TI_UNIFIED = 0, CACHE_TI_DATA = 0, CACHE_TI_INSTRUCTION }
 

Functions

void show_cacheinfo (struct seq_file *m)
 
 DEFINE_CACHE_ATTR (size,"%luK\n", index->cache->size >> 10)
 
 DEFINE_CACHE_ATTR (coherency_line_size,"%u\n", index->cache->line_size)
 
 DEFINE_CACHE_ATTR (number_of_sets,"%u\n", index->cache->nr_sets)
 
 DEFINE_CACHE_ATTR (ways_of_associativity,"%u\n", index->cache->associativity)
 
 DEFINE_CACHE_ATTR (type,"%s\n", cache_type_string[index->cache->type])
 
 DEFINE_CACHE_ATTR (level,"%d\n", index->cache->level)
 
 device_initcall (cache_init)
 

Variables

struct cache __attribute__
 

Macro Definition Documentation

#define CACHE_MAX_LEVEL   8

Definition at line 72 of file cache.c.

#define DEFINE_CACHE_ATTR (   _name,
  _format,
  _value 
)
Value:
static ssize_t cache_##_name##_show(struct kobject *kobj, \
struct kobj_attribute *attr, \
char *buf) \
{ \
\
index = kobj_to_cache_index_dir(kobj); \
return sprintf(buf, _format, _value); \
} \
static struct kobj_attribute cache_##_name##_attr = \
__ATTR(_name, 0444, cache_##_name##_show, NULL);

Definition at line 221 of file cache.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
CACHE_SCOPE_NOTEXISTS 
CACHE_SCOPE_PRIVATE 
CACHE_SCOPE_SHARED 
CACHE_SCOPE_RESERVED 

Definition at line 39 of file cache.c.

anonymous enum
Enumerator:
CACHE_TYPE_SEPARATE 
CACHE_TYPE_DATA 
CACHE_TYPE_INSTRUCTION 
CACHE_TYPE_UNIFIED 

Definition at line 46 of file cache.c.

anonymous enum
Enumerator:
EXTRACT_TOPOLOGY 
EXTRACT_LINE_SIZE 
EXTRACT_SIZE 
EXTRACT_ASSOCIATIVITY 

Definition at line 53 of file cache.c.

anonymous enum
Enumerator:
CACHE_TI_UNIFIED 
CACHE_TI_DATA 
CACHE_TI_INSTRUCTION 

Definition at line 60 of file cache.c.

Function Documentation

DEFINE_CACHE_ATTR ( size  ,
"%luK\n"  ,
index->cache->size >>  10 
)
DEFINE_CACHE_ATTR ( coherency_line_size  ,
"%u\n"  ,
index->cache->  line_size 
)
DEFINE_CACHE_ATTR ( number_of_sets  ,
"%u\n"  ,
index->cache->  nr_sets 
)
DEFINE_CACHE_ATTR ( ways_of_associativity  ,
"%u\n"  ,
index->cache->  associativity 
)
DEFINE_CACHE_ATTR ( type  ,
"%s\n"  ,
cache_type_string  [index->cache->type] 
)
DEFINE_CACHE_ATTR ( level  ,
"%d\n"  ,
index->cache->  level 
)
device_initcall ( cache_init  )
void show_cacheinfo ( struct seq_file m)

Definition at line 88 of file cache.c.

Variable Documentation