aboutsummaryrefslogtreecommitdiffstats
path: root/com32/gplinclude/disk
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-21 09:58:35 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-21 09:58:35 -0700
commit6a802f4761cb40de2fe25f6df3f9eab8af94d032 (patch)
tree40c80ee7ca1c2bd5c80c944a4bbebd49f0c6e56c /com32/gplinclude/disk
parentbdeb4237ed17d2deab8ecf3cb95721047731cc3c (diff)
downloadsyslinux-6a802f4761cb40de2fe25f6df3f9eab8af94d032.tar.gz
syslinux-6a802f4761cb40de2fe25f6df3f9eab8af94d032.tar.xz
syslinux-6a802f4761cb40de2fe25f6df3f9eab8af94d032.zip
gpllib: Add swsusp_check to check for swsusp signature
swsusp is a Linux mechanism to put a computer to sleep. In case of hibernation, an image is written to the disk, on a swap partition. swsusp_check can be used to check if a device contains the magic swsusp signature, meaning that an image is present. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/gplinclude/disk')
-rw-r--r--com32/gplinclude/disk/swsusp.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/com32/gplinclude/disk/swsusp.h b/com32/gplinclude/disk/swsusp.h
new file mode 100644
index 00000000..54140b3d
--- /dev/null
+++ b/com32/gplinclude/disk/swsusp.h
@@ -0,0 +1,19 @@
+#ifndef _SWSUSP_H_
+#define _SWSUSP_H_
+
+#include <disk/geom.h>
+#include <disk/common.h>
+#include <disk/partition.h>
+
+#define SWSUSP_SIG "S1SUSPEND"
+
+struct swsusp_header {
+ char reserved[PAGE_SIZE - 20 - sizeof(unsigned long) - sizeof(int)];
+ unsigned long image;
+ unsigned int flags; /* Flags to pass to the "boot" kernel */
+ char orig_sig[10];
+ char sig[10];
+} __attribute__((packed));
+
+int swsusp_check(struct driveinfo*, struct part_entry*, int*);
+#endif /* _SWSUSP_H */