[syslinux:firmware] core: don' t leak the __lowmem and __bss16 macros to modules

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Thu Oct 17 16:12:11 PDT 2013


Commit-ID:  4c3c85630e83ed4522444c707abea6bc3db8a40b
Gitweb:     http://www.syslinux.org/commit/4c3c85630e83ed4522444c707abea6bc3db8a40b
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Thu, 17 Oct 2013 16:05:53 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Thu, 17 Oct 2013 16:07:12 -0700

core: don't leak the __lowmem and __bss16 macros to modules

The __lowmem and __bss16 macros are only useful in the core itself.
Hide them from modules so people don't use them by mistake.

extern declarations don't need them (and are safe in modules), they
are only necessary at the point of definition (which must be in the
core.)

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

---
 core/include/core.h     | 6 ++++--
 core/include/graphics.h | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/core/include/core.h b/core/include/core.h
index 127ac65..1fd283e 100644
--- a/core/include/core.h
+++ b/core/include/core.h
@@ -92,8 +92,10 @@ void call16(void (*)(void), const com32sys_t *, com32sys_t *);
 /*
  * __lowmem is in the low 1 MB; __bss16 in the low 64K
  */
-#define __lowmem __attribute__((nocommon,section(".lowmem")))
-#define __bss16  __attribute__((nocommon,section(".bss16")))
+#ifdef __SYSLINUX_CORE__	/* Not supported in modules */
+# define __lowmem __attribute__((nocommon,section(".lowmem")))
+# define __bss16  __attribute__((nocommon,section(".bss16")))
+#endif
 
 /*
  * Helper routine to return a specific set of flags
diff --git a/core/include/graphics.h b/core/include/graphics.h
index 651b7bc..b1b442a 100644
--- a/core/include/graphics.h
+++ b/core/include/graphics.h
@@ -48,7 +48,7 @@ extern uint16_t VGAFontSize;
 
 extern uint8_t UserFont;
 
-extern __lowmem char fontbuf[8192];
+extern char fontbuf[8192];
 
 extern void vgadisplayfile(FILE *_fd);
 extern void using_vga(uint8_t vga, uint16_t pix_cols, uint16_t pix_rows);


More information about the Syslinux-commits mailing list