From: Thomas Veerman Date: Thu, 17 Jan 2013 12:35:07 +0000 (+0100) Subject: ARM: clear BSS upon boot X-Git-Tag: v3.2.1~71 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=1a60a84cb7702c4fb0579304ee731d97030bf003;p=minix.git ARM: clear BSS upon boot --- diff --git a/kernel/arch/earm/pre_init.c b/kernel/arch/earm/pre_init.c index 2df28f798..3a4f72da9 100644 --- a/kernel/arch/earm/pre_init.c +++ b/kernel/arch/earm/pre_init.c @@ -38,6 +38,9 @@ static void setup_mbi(multiboot_info_t *mbi); /* Kernel may use memory */ int kernel_may_alloc = 1; +extern u32_t _edata; +extern u32_t _end; + static int mb_set_param(char *bigbuf, char *name, char *value, kinfo_t *cbi) { char *p = bigbuf; @@ -256,6 +259,9 @@ void get_parameters(u32_t ebx, kinfo_t *cbi) kinfo_t *pre_init(u32_t magic, u32_t ebx) { + /* Clear BSS */ + memset(&_edata, 0, (u32_t)&_end - (u32_t)&_edata); + /* Get our own copy boot params pointed to by ebx. * Here we find out whether we should do serial output. */