Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
topology.c File Reference
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/hardirq.h>
#include <linux/topology.h>

Go to the source code of this file.

Macros

#define define_one_ro_named(_name, _func)   static DEVICE_ATTR(_name, 0444, _func, NULL)
 
#define define_one_ro(_name)   static DEVICE_ATTR(_name, 0444, show_##_name, NULL)
 
#define define_id_show_func(name)
 
#define define_siblings_show_map(name)
 
#define define_siblings_show_list(name)
 
#define define_siblings_show_func(name)   define_siblings_show_map(name); define_siblings_show_list(name)
 

Functions

 define_id_show_func (physical_package_id)
 
 define_one_ro (physical_package_id)
 
 define_id_show_func (core_id)
 
 define_one_ro (core_id)
 
 define_siblings_show_func (thread_cpumask)
 
 define_one_ro_named (thread_siblings, show_thread_cpumask)
 
 define_one_ro_named (thread_siblings_list, show_thread_cpumask_list)
 
 define_siblings_show_func (core_cpumask)
 
 define_one_ro_named (core_siblings, show_core_cpumask)
 
 define_one_ro_named (core_siblings_list, show_core_cpumask_list)
 
 device_initcall (topology_sysfs_init)
 

Macro Definition Documentation

#define define_id_show_func (   name)
Value:
static ssize_t show_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
unsigned int cpu = dev->id; \
return sprintf(buf, "%d\n", topology_##name(cpu)); \
}

Definition at line 39 of file topology.c.

#define define_one_ro (   _name)    static DEVICE_ATTR(_name, 0444, show_##_name, NULL)

Definition at line 36 of file topology.c.

#define define_one_ro_named (   _name,
  _func 
)    static DEVICE_ATTR(_name, 0444, _func, NULL)

Definition at line 33 of file topology.c.

#define define_siblings_show_func (   name)    define_siblings_show_map(name); define_siblings_show_list(name)

Definition at line 100 of file topology.c.

#define define_siblings_show_list (   name)
Value:
static ssize_t show_##name##_list(struct device *dev, \
char *buf) \
{ \
return show_cpumap(1, topology_##name(dev->id), buf); \
}

Definition at line 91 of file topology.c.

#define define_siblings_show_map (   name)
Value:
static ssize_t show_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
return show_cpumap(0, topology_##name(dev->id), buf); \
}

Definition at line 84 of file topology.c.

Function Documentation

define_id_show_func ( physical_package_id  )
define_id_show_func ( core_id  )
define_one_ro ( physical_package_id  )
define_one_ro ( core_id  )
define_one_ro_named ( thread_siblings  ,
show_thread_cpumask   
)
define_one_ro_named ( thread_siblings_list  ,
show_thread_cpumask_list   
)
define_one_ro_named ( core_siblings  ,
show_core_cpumask   
)
define_one_ro_named ( core_siblings_list  ,
show_core_cpumask_list   
)
define_siblings_show_func ( thread_cpumask  )
define_siblings_show_func ( core_cpumask  )
device_initcall ( topology_sysfs_init  )