[syslinux:pathbased] core: don't bother zeroing the disk cache and heap
syslinux-bot for H. Peter Anvin
hpa at zytor.com
Sat Mar 6 21:48:02 PST 2010
Commit-ID: 5e0674b819d373f3fd9306fe6c7bc9f5e63ed36c
Gitweb: http://syslinux.zytor.com/commit/5e0674b819d373f3fd9306fe6c7bc9f5e63ed36c
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Sat, 6 Mar 2010 21:44:42 -0800
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Sat, 6 Mar 2010 21:44:42 -0800
core: don't bother zeroing the disk cache and heap
No point in zeroing out the disk cache and the heap. Put those in a
.hugebss section which we align, but don't zero.
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---
core/fs/diskio.c | 6 ++++--
core/include/core.h | 9 +++++++--
core/mem/init.c | 2 +-
core/syslinux.ld | 14 ++++++++++++++
4 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/core/fs/diskio.c b/core/fs/diskio.c
index 4c965cd..6afba21 100644
--- a/core/fs/diskio.c
+++ b/core/fs/diskio.c
@@ -302,13 +302,15 @@ struct disk *disk_init(uint8_t devno, bool cdrom, sector_t part_start,
/*
- * initialize the device structure
+ * Initialize the device structure.
+ *
+ * NOTE: the disk cache needs to be revamped to support multiple devices...
*/
struct device * device_init(uint8_t devno, bool cdrom, sector_t part_start,
uint16_t bsHeads, uint16_t bsSecPerTrack)
{
static struct device dev;
- static char diskcache[128*1024] __aligned(4096);
+ static __hugebss char diskcache[128*1024];
dev.disk = disk_init(devno, cdrom, part_start, bsHeads, bsSecPerTrack);
diff --git a/core/include/core.h b/core/include/core.h
index 48df921..f03da81 100644
--- a/core/include/core.h
+++ b/core/include/core.h
@@ -45,8 +45,13 @@ 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")))
+#define __lowmem __attribute__((nocommon,section(".lowmem")))
+#define __bss16 __attribute__((nocommon,section(".bss16")))
+
+/*
+ * Section for very large aligned objects, not zeroed on startup
+ */
+#define __hugebss __attribute__((nocommon,section(".hugebss"),aligned(4096)))
/*
* Death! The macro trick is to avoid symbol conflict with
diff --git a/core/mem/init.c b/core/mem/init.c
index a916a71..487bbb3 100644
--- a/core/mem/init.c
+++ b/core/mem/init.c
@@ -5,7 +5,7 @@
struct free_arena_header __malloc_head[NHEAP];
-static char main_heap[128 << 10] __aligned(16);
+static __hugebss char main_heap[128 << 10];
extern char __lowmem_heap[];
void mem_init(void)
diff --git a/core/syslinux.ld b/core/syslinux.ld
index c07242d..82170a7 100644
--- a/core/syslinux.ld
+++ b/core/syslinux.ld
@@ -346,6 +346,20 @@ SECTIONS
__bss_len = __bss_end - __bss_start;
__bss_dwords = (__bss_len + 3) >> 2;
+ /* Very large objects which don't need to be zeroed */
+
+ __hugebss_vma = .;
+ __hugebss_lma = .; /* Dummy */
+ .hugebss (NOLOAD) : AT (__hugebss_lma) {
+ __hugebss_start = .;
+ *(.hugebss)
+ *(.hugebss.*)
+ __hugebss_end = .;
+ }
+ __hugebss_len = __hugebss_end - __hugebss_start;
+ __hugebss_dwords = (__hugebss_len + 3) >> 2;
+
+
/* XXX: This stack should be unified with the COM32 stack */
__stack_vma = .;
__stack_lma = .; /* Dummy */
More information about the Syslinux-commits
mailing list