From fc38cbecfcdb8237f22e8def62bced022260b035 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 12 Feb 2008 16:47:39 -0800 Subject: [PATCH] Query the shuffle descriptor set size and use it Query the maximum number of shuffle descriptors, and use that number as the descriptor block size. --- com32/lib/syslinux/shuffle.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/com32/lib/syslinux/shuffle.c b/com32/lib/syslinux/shuffle.c index dcb8d31..bb020a1 100644 --- a/com32/lib/syslinux/shuffle.c +++ b/com32/lib/syslinux/shuffle.c @@ -39,6 +39,7 @@ #include #include #include +#include #ifndef DEBUG # define DEBUG 0 @@ -54,8 +55,20 @@ struct shuffle_descriptor { uint32_t dst, src, len; }; +static int desc_block_size; + +static void __constructor __syslinux_get_desc_block_size(void) +{ + static com32sys_t reg; + + reg.eax.w[0] = 0x0011; + __intcall(0x22, ®, ®); + + desc_block_size = (reg.eflags.l & EFLAGS_CF) ? 256 : reg.ecx.w[0]; +} + /* Allocate descriptor memory in these chunks */ -#define DESC_BLOCK_SIZE 256 +#define DESC_BLOCK_SIZE desc_block_size int syslinux_prepare_shuffle(struct syslinux_movelist *fraglist, struct syslinux_memmap *memmap) -- 2.7.4