aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-10-17 16:05:53 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2013-10-17 16:07:12 -0700
commit4c3c85630e83ed4522444c707abea6bc3db8a40b (patch)
tree2d0629e5703f300f8d792af0d6f0ea642e8fd459
parent4ac63b5ac412d54462e292daf65a309775bc0448 (diff)
downloadsyslinux-4c3c85630e83ed4522444c707abea6bc3db8a40b.tar.gz
syslinux-4c3c85630e83ed4522444c707abea6bc3db8a40b.tar.xz
syslinux-4c3c85630e83ed4522444c707abea6bc3db8a40b.zip
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@linux.intel.com>
-rw-r--r--core/include/core.h6
-rw-r--r--core/include/graphics.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/core/include/core.h b/core/include/core.h
index 127ac656..1fd283e3 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 651b7bc6..b1b442ad 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);