summaryrefslogtreecommitdiff
path: root/com32/lib/syslinux/shuffle.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2014-02-27 21:44:06 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2014-02-27 21:45:44 -0800
commite01e93b0f29b6dc9e363d91175ef3f7ecb40f8bf (patch)
tree22963270f1297291a0c3906df8f4e25f3eb86639 /com32/lib/syslinux/shuffle.c
parent929b217f46ac45cc0bf7cbbaf77575ad0a17f94f (diff)
downloadsyslinux-e01e93b0f29b6dc9e363d91175ef3f7ecb40f8bf.tar.gz
shuffler: Actually get the shuffler size sanelysyslinux-6.03-pre4
Actually get the shuffler size sanely. At least for now, we are BIOS only, so stub out the functions on EFI (they shouldn't even be compiled for EFI; this stuff should be moved into some kind of BIOS-only directory.) Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'com32/lib/syslinux/shuffle.c')
-rw-r--r--com32/lib/syslinux/shuffle.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/com32/lib/syslinux/shuffle.c b/com32/lib/syslinux/shuffle.c
index ce85a5c4..dcc4afa4 100644
--- a/com32/lib/syslinux/shuffle.c
+++ b/com32/lib/syslinux/shuffle.c
@@ -48,16 +48,6 @@ struct shuffle_descriptor {
uint32_t dst, src, len;
};
-static int shuffler_size;
-
-static void __syslinux_get_shuffer_size(void)
-{
- if (!shuffler_size) {
- /* +15 padding is to guarantee alignment */
- shuffler_size = __bcopyxx_len + 15;
- }
-}
-
/*
* Allocate descriptor memory in these chunks; if this is large we may
* waste memory, if it is small we may get slow convergence.
@@ -80,6 +70,11 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist,
int nmoves, nzero;
com32sys_t ireg;
+#ifndef __FIRMWARE_BIOS__
+ errno = ENOSYS;
+ return -1; /* Not supported at this time*/
+#endif
+
descaddr = 0;
dp = dbuf = NULL;
@@ -116,14 +111,14 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist,
if (!rxmap)
goto bail;
- __syslinux_get_shuffer_size();
desc_blocks = (nzero + DESC_BLOCK_SIZE - 1) / DESC_BLOCK_SIZE;
for (;;) {
/* We want (desc_blocks) allocation blocks, plus the terminating
descriptor, plus the shuffler safe area. */
addr_t descmem = desc_blocks *
sizeof(struct shuffle_descriptor) * DESC_BLOCK_SIZE
- + sizeof(struct shuffle_descriptor) + shuffler_size;
+ + sizeof(struct shuffle_descriptor)
+ + syslinux_shuffler_size();
descaddr = (desczone + descfree - descmem) & ~3;