]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/power/power.h
Suspend: Testing facility (rev. 2)
[linux-2.6-omap-h63xx.git] / kernel / power / power.h
index 6ca85fd4975fc494c3ab00abfe4f00df9f0197f8..9f9e16e3396249a267facc3a1abb8ba3ae884e48 100644 (file)
@@ -1,4 +1,5 @@
 #include <linux/suspend.h>
+#include <linux/suspend_ioctls.h>
 #include <linux/utsname.h>
 
 struct swsusp_info {
@@ -134,35 +135,6 @@ extern int snapshot_write_next(struct snapshot_handle *handle, size_t count);
 extern void snapshot_write_finalize(struct snapshot_handle *handle);
 extern int snapshot_image_loaded(struct snapshot_handle *handle);
 
-/*
- * This structure is used to pass the values needed for the identification
- * of the resume swap area from a user space to the kernel via the
- * SNAPSHOT_SET_SWAP_AREA ioctl
- */
-struct resume_swap_area {
-       loff_t offset;
-       u_int32_t dev;
-} __attribute__((packed));
-
-#define SNAPSHOT_IOC_MAGIC     '3'
-#define SNAPSHOT_FREEZE                        _IO(SNAPSHOT_IOC_MAGIC, 1)
-#define SNAPSHOT_UNFREEZE              _IO(SNAPSHOT_IOC_MAGIC, 2)
-#define SNAPSHOT_ATOMIC_SNAPSHOT       _IOW(SNAPSHOT_IOC_MAGIC, 3, void *)
-#define SNAPSHOT_ATOMIC_RESTORE                _IO(SNAPSHOT_IOC_MAGIC, 4)
-#define SNAPSHOT_FREE                  _IO(SNAPSHOT_IOC_MAGIC, 5)
-#define SNAPSHOT_SET_IMAGE_SIZE                _IOW(SNAPSHOT_IOC_MAGIC, 6, unsigned long)
-#define SNAPSHOT_AVAIL_SWAP            _IOR(SNAPSHOT_IOC_MAGIC, 7, void *)
-#define SNAPSHOT_GET_SWAP_PAGE         _IOR(SNAPSHOT_IOC_MAGIC, 8, void *)
-#define SNAPSHOT_FREE_SWAP_PAGES       _IO(SNAPSHOT_IOC_MAGIC, 9)
-#define SNAPSHOT_SET_SWAP_FILE         _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int)
-#define SNAPSHOT_S2RAM                 _IO(SNAPSHOT_IOC_MAGIC, 11)
-#define SNAPSHOT_SET_SWAP_AREA         _IOW(SNAPSHOT_IOC_MAGIC, 13, \
-                                                       struct resume_swap_area)
-#define SNAPSHOT_GET_IMAGE_SIZE                _IOR(SNAPSHOT_IOC_MAGIC, 14, loff_t)
-#define SNAPSHOT_PLATFORM_SUPPORT      _IO(SNAPSHOT_IOC_MAGIC, 15)
-#define SNAPSHOT_POWER_OFF             _IO(SNAPSHOT_IOC_MAGIC, 16)
-#define SNAPSHOT_IOC_MAXNR     16
-
 /* If unset, the snapshot device cannot be open. */
 extern atomic_t snapshot_device_available;
 
@@ -208,3 +180,29 @@ static inline int pm_notifier_call_chain(unsigned long val)
        return (blocking_notifier_call_chain(&pm_chain_head, val, NULL)
                        == NOTIFY_BAD) ? -EINVAL : 0;
 }
+
+#ifdef CONFIG_HIGHMEM
+unsigned int count_highmem_pages(void);
+int restore_highmem(void);
+#else
+static inline unsigned int count_highmem_pages(void) { return 0; }
+static inline int restore_highmem(void) { return 0; }
+#endif
+
+/*
+ * Suspend test levels
+ */
+enum {
+       /* keep first */
+       TEST_NONE,
+       TEST_CORE,
+       TEST_CPUS,
+       TEST_PLATFORM,
+       TEST_DEVICES,
+       TEST_FREEZER,
+       /* keep last */
+       __TEST_AFTER_LAST
+};
+
+#define TEST_FIRST     TEST_NONE
+#define TEST_MAX       (__TEST_AFTER_LAST - 1)