Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
xen-balloon.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/capability.h>
#include <xen/xen.h>
#include <xen/interface/xen.h>
#include <xen/balloon.h>
#include <xen/xenbus.h>
#include <xen/features.h>
#include <xen/page.h>

Go to the source code of this file.

Macros

#define PAGES2KB(_p)   ((_p)<<(PAGE_SHIFT-10))
 
#define BALLOON_CLASS_NAME   "xen_memory"
 
#define BALLOON_SHOW(name, format, args...)
 

Functions

 subsys_initcall (balloon_init)
 
 module_exit (balloon_exit)
 
 BALLOON_SHOW (current_kb,"%lu\n", PAGES2KB(balloon_stats.current_pages))
 
 BALLOON_SHOW (low_kb,"%lu\n", PAGES2KB(balloon_stats.balloon_low))
 
 BALLOON_SHOW (high_kb,"%lu\n", PAGES2KB(balloon_stats.balloon_high))
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define BALLOON_CLASS_NAME   "xen_memory"

Definition at line 46 of file xen-balloon.c.

#define BALLOON_SHOW (   name,
  format,
  args... 
)
Value:
static ssize_t show_##name(struct device *dev, \
char *buf) \
{ \
return sprintf(buf, format, ##args); \
} \
static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)

Definition at line 118 of file xen-balloon.c.

#define PAGES2KB (   _p)    ((_p)<<(PAGE_SHIFT-10))

Definition at line 44 of file xen-balloon.c.

Function Documentation

BALLOON_SHOW ( current_kb  ,
"%lu\n"  ,
PAGES2KB(balloon_stats.current_pages  
)
BALLOON_SHOW ( low_kb  ,
"%lu\n"  ,
PAGES2KB(balloon_stats.balloon_low  
)
BALLOON_SHOW ( high_kb  ,
"%lu\n"  ,
PAGES2KB(balloon_stats.balloon_high  
)
module_exit ( balloon_exit  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( balloon_init  )