[syslinux:master] pmapi: make the pmapi vector include its own size

syslinux-bot for H. Peter Anvin hpa at zytor.com
Sat Jun 26 12:36:26 PDT 2010


Commit-ID:  3547a45e6d81e82cbdee266fc6b6186fb189e9ea
Gitweb:     http://syslinux.zytor.com/commit/3547a45e6d81e82cbdee266fc6b6186fb189e9ea
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Sat, 26 Jun 2010 12:30:13 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Sat, 26 Jun 2010 12:30:13 -0700

pmapi: make the pmapi vector include its own size

Future-proof the pmapi vector by making it include its own size.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 com32/include/syslinux/pmapi.h |    2 ++
 core/pmapi.c                   |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/com32/include/syslinux/pmapi.h b/com32/include/syslinux/pmapi.h
index f583dea..ae3254d 100644
--- a/com32/include/syslinux/pmapi.h
+++ b/com32/include/syslinux/pmapi.h
@@ -52,6 +52,8 @@ struct com32_filedata {
 };
 
 struct com32_pmapi {
+    size_t __pmapi_size;
+
     void *(*lmalloc)(size_t);
     void (*lfree)(void *);
 
diff --git a/core/pmapi.c b/core/pmapi.c
index 3313cea..f3a0c16 100644
--- a/core/pmapi.c
+++ b/core/pmapi.c
@@ -19,6 +19,8 @@
 
 const struct com32_pmapi pm_api_vector =
 {
+    .__pmapi_size = sizeof(struct com32_pmapi),
+
     .lmalloc	= pmapi_lmalloc, /* Allocate low memory */
     .lfree	= free,		 /* Free low memory */
 



More information about the Syslinux-commits mailing list