Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
vmw_balloon.c File Reference
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/workqueue.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <asm/hypervisor.h>

Go to the source code of this file.

Data Structures

struct  vmballoon
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define VMW_BALLOON_NOSLEEP_ALLOC_MAX   16384U
 
#define VMW_BALLOON_RATE_ALLOC_MIN   512U
 
#define VMW_BALLOON_RATE_ALLOC_MAX   2048U
 
#define VMW_BALLOON_RATE_ALLOC_INC   16U
 
#define VMW_BALLOON_RATE_FREE_MIN   512U
 
#define VMW_BALLOON_RATE_FREE_MAX   16384U
 
#define VMW_BALLOON_RATE_FREE_INC   16U
 
#define VMW_BALLOON_SLOW_CYCLES   4
 
#define VMW_PAGE_ALLOC_NOSLEEP   (__GFP_HIGHMEM|__GFP_NOWARN)
 
#define VMW_PAGE_ALLOC_CANSLEEP   (GFP_HIGHUSER)
 
#define VMW_BALLOON_YIELD_THRESHOLD   1024
 
#define VMW_BALLOON_MAX_REFUSED   16
 
#define VMW_BALLOON_HV_PORT   0x5670
 
#define VMW_BALLOON_HV_MAGIC   0x456c6d6f
 
#define VMW_BALLOON_PROTOCOL_VERSION   2
 
#define VMW_BALLOON_GUEST_ID   1 /* Linux */
 
#define VMW_BALLOON_CMD_START   0
 
#define VMW_BALLOON_CMD_GET_TARGET   1
 
#define VMW_BALLOON_CMD_LOCK   2
 
#define VMW_BALLOON_CMD_UNLOCK   3
 
#define VMW_BALLOON_CMD_GUEST_ID   4
 
#define VMW_BALLOON_SUCCESS   0
 
#define VMW_BALLOON_FAILURE   -1
 
#define VMW_BALLOON_ERROR_CMD_INVALID   1
 
#define VMW_BALLOON_ERROR_PPN_INVALID   2
 
#define VMW_BALLOON_ERROR_PPN_LOCKED   3
 
#define VMW_BALLOON_ERROR_PPN_UNLOCKED   4
 
#define VMW_BALLOON_ERROR_PPN_PINNED   5
 
#define VMW_BALLOON_ERROR_PPN_NOTNEEDED   6
 
#define VMW_BALLOON_ERROR_RESET   7
 
#define VMW_BALLOON_ERROR_BUSY   8
 
#define VMWARE_BALLOON_CMD(cmd, data, result)
 
#define STATS_INC(stat)
 

Functions

 MODULE_AUTHOR ("VMware, Inc.")
 
 MODULE_DESCRIPTION ("VMware Memory Control (Balloon) Driver")
 
 MODULE_VERSION ("1.2.1.3-k")
 
 MODULE_ALIAS ("dmi:*:svnVMware*:*")
 
 MODULE_ALIAS ("vmware_vmmemctl")
 
 MODULE_LICENSE ("GPL")
 
 module_init (vmballoon_init)
 
 module_exit (vmballoon_exit)
 

Macro Definition Documentation

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 34 of file vmw_balloon.c.

#define STATS_INC (   stat)

Definition at line 178 of file vmw_balloon.c.

#define VMW_BALLOON_CMD_GET_TARGET   1

Definition at line 116 of file vmw_balloon.c.

#define VMW_BALLOON_CMD_GUEST_ID   4

Definition at line 119 of file vmw_balloon.c.

#define VMW_BALLOON_CMD_LOCK   2

Definition at line 117 of file vmw_balloon.c.

#define VMW_BALLOON_CMD_START   0

Definition at line 115 of file vmw_balloon.c.

#define VMW_BALLOON_CMD_UNLOCK   3

Definition at line 118 of file vmw_balloon.c.

#define VMW_BALLOON_ERROR_BUSY   8

Definition at line 131 of file vmw_balloon.c.

#define VMW_BALLOON_ERROR_CMD_INVALID   1

Definition at line 124 of file vmw_balloon.c.

#define VMW_BALLOON_ERROR_PPN_INVALID   2

Definition at line 125 of file vmw_balloon.c.

#define VMW_BALLOON_ERROR_PPN_LOCKED   3

Definition at line 126 of file vmw_balloon.c.

#define VMW_BALLOON_ERROR_PPN_NOTNEEDED   6

Definition at line 129 of file vmw_balloon.c.

#define VMW_BALLOON_ERROR_PPN_PINNED   5

Definition at line 128 of file vmw_balloon.c.

#define VMW_BALLOON_ERROR_PPN_UNLOCKED   4

Definition at line 127 of file vmw_balloon.c.

#define VMW_BALLOON_ERROR_RESET   7

Definition at line 130 of file vmw_balloon.c.

#define VMW_BALLOON_FAILURE   -1

Definition at line 123 of file vmw_balloon.c.

#define VMW_BALLOON_GUEST_ID   1 /* Linux */

Definition at line 113 of file vmw_balloon.c.

#define VMW_BALLOON_HV_MAGIC   0x456c6d6f

Definition at line 111 of file vmw_balloon.c.

#define VMW_BALLOON_HV_PORT   0x5670

Definition at line 110 of file vmw_balloon.c.

#define VMW_BALLOON_MAX_REFUSED   16

Definition at line 105 of file vmw_balloon.c.

#define VMW_BALLOON_NOSLEEP_ALLOC_MAX   16384U

Definition at line 62 of file vmw_balloon.c.

#define VMW_BALLOON_PROTOCOL_VERSION   2

Definition at line 112 of file vmw_balloon.c.

#define VMW_BALLOON_RATE_ALLOC_INC   16U

Definition at line 70 of file vmw_balloon.c.

#define VMW_BALLOON_RATE_ALLOC_MAX   2048U

Definition at line 69 of file vmw_balloon.c.

#define VMW_BALLOON_RATE_ALLOC_MIN   512U

Definition at line 68 of file vmw_balloon.c.

#define VMW_BALLOON_RATE_FREE_INC   16U

Definition at line 77 of file vmw_balloon.c.

#define VMW_BALLOON_RATE_FREE_MAX   16384U

Definition at line 76 of file vmw_balloon.c.

#define VMW_BALLOON_RATE_FREE_MIN   512U

Definition at line 75 of file vmw_balloon.c.

#define VMW_BALLOON_SLOW_CYCLES   4

Definition at line 83 of file vmw_balloon.c.

#define VMW_BALLOON_SUCCESS   0

Definition at line 122 of file vmw_balloon.c.

#define VMW_BALLOON_YIELD_THRESHOLD   1024

Definition at line 102 of file vmw_balloon.c.

#define VMW_PAGE_ALLOC_CANSLEEP   (GFP_HIGHUSER)

Definition at line 99 of file vmw_balloon.c.

#define VMW_PAGE_ALLOC_NOSLEEP   (__GFP_HIGHMEM|__GFP_NOWARN)

Definition at line 90 of file vmw_balloon.c.

#define VMWARE_BALLOON_CMD (   cmd,
  data,
  result 
)
Value:
({ \
unsigned long __stat, __dummy1, __dummy2; \
__asm__ __volatile__ ("inl (%%dx)" : \
"=a"(__stat), \
"=c"(__dummy1), \
"=d"(__dummy2), \
"=b"(result) : \
"1"(VMW_BALLOON_CMD_##cmd), \
"3"(data) : \
"memory"); \
result &= -1UL; \
__stat & -1UL; \
})

Definition at line 133 of file vmw_balloon.c.

Function Documentation

MODULE_ALIAS ( "dmi:*:svnVMware*:*"  )
MODULE_ALIAS ( "vmware_vmmemctl"  )
MODULE_AUTHOR ( VMware,
Inc."   
)
MODULE_DESCRIPTION ( "VMware Memory Control (Balloon) Driver"  )
module_exit ( vmballoon_exit  )
module_init ( vmballoon_init  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( "1.2.1.3-k"  )