summaryrefslogtreecommitdiff
path: root/com32/include/syslinux/movebits.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-03-12 13:17:35 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-03-12 13:17:35 -0700
commit9a0509cffdb22cd647b4b9bea266c2ea68a7341e (patch)
tree28f82b1087c3859ec8164964fe64d7f87ca7da34 /com32/include/syslinux/movebits.h
parent66950a7c945cbb4c378c6185490a0d7d773e20d1 (diff)
downloadsyslinux-9a0509cffdb22cd647b4b9bea266c2ea68a7341e.tar.gz
Wrapper infrastructure for "shuffle and boot"
Initial checkin of a wrapper infrastructure for the "shuffle and boot" interface, both real and protected mode. This code automatically will figure out the necessary sequence of moves, taking into account swaps and overlaps as necessary.
Diffstat (limited to 'com32/include/syslinux/movebits.h')
-rw-r--r--com32/include/syslinux/movebits.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/com32/include/syslinux/movebits.h b/com32/include/syslinux/movebits.h
new file mode 100644
index 00000000..95adf6eb
--- /dev/null
+++ b/com32/include/syslinux/movebits.h
@@ -0,0 +1,44 @@
+#ifndef _SYSLINUX_MOVEBITS_H
+#define _SYSLINUX_MOVEBITS_H
+
+#include <inttypes.h>
+#include <setjmp.h>
+
+typedef uint32_t addr_t;
+
+struct syslinux_movelist {
+ addr_t dst;
+ addr_t src;
+ addr_t len;
+ struct syslinux_movelist *next;
+};
+
+struct syslinux_pm_regs {
+ uint32_t eax, ecx, edx, ebx;
+ uint32_t esp, ebp, esi, edi;
+ uint32_t eip;
+};
+
+/*
+ * moves is computed from "frags" and "freemem". "space" lists
+ * free memory areas at our disposal, and is (src, cnt) only.
+ */
+
+int syslinux_compute_movelist(struct syslinux_movelist **,
+ struct syslinux_movelist *,
+ struct syslinux_movelist *);
+
+struct syslinux_movelist *syslinux_memory_map(void);
+void syslinux_free_movelist(struct syslinux_movelist *);
+int syslinux_add_movelist(struct syslinux_movelist **,
+ addr_t dst, addr_t src, addr_t len);
+int syslinux_prepare_shuffle(struct syslinux_movelist *fraglist);
+int syslinux_shuffle_boot_rm(struct syslinux_movelist *fraglist,
+ uint16_t bootflags,
+ uint32_t edx, uint32_t esi, uint16_t ds,
+ uint16_t cs, uint16_t ip);
+int syslinux_shuffle_boot_pm(struct syslinux_movelist *fraglist,
+ uint16_t bootflags,
+ struct syslinux_pm_regs *regs);
+
+#endif /* _SYSLINUX_MOVEBITS_H */