implementation of __libc_init_memory()

svn path=/trunk/; revision=10520
This commit is contained in:
Thomas Bluemel 2004-08-14 00:39:19 +00:00
parent 067e284424
commit c90dfac1f8
2 changed files with 16 additions and 20 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: libsky.c,v 1.3 2004/08/13 23:31:12 sedwards Exp $
/* $Id: libsky.c,v 1.4 2004/08/14 00:39:19 weiden Exp $
*
* PROJECT: SkyOS library
* FILE: lib/libsky/libsky.c
@ -41,3 +41,17 @@ __to_kernel(int ret)
ExitProcess(ret);
}
/*
* @implemented
*/
void __cdecl
__libc_init_memory(void *end,
void *__bss_end__,
void *__bss_start__)
{
DBG("__libc_init_memory: end=0x%x __bss_end__=0x%x __bss_start__=0x%x\n", end, __bss_end__, __bss_start__);
RtlZeroMemory(__bss_start__, (PCHAR)__bss_end__ - (PCHAR)__bss_start__);
/* FIXME - initialize other stuff */
}

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.3 2004/08/12 23:38:17 weiden Exp $
/* $Id: stubs.c,v 1.4 2004/08/14 00:39:19 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: SkyOS library
@ -13,24 +13,6 @@
/* #define NDEBUG */
#include "libsky.h"
/*
* @unimplemented
*/
void __cdecl
__libc_init_memory(void *end,
void *__bss_end__,
void *__bss_start__)
{
STUB("__libc_init_memory: end=0x%x __bss_end__=0x%x __bss_start__=0x%x\n", end, __bss_end__, __bss_start__);
#if 1
RtlZeroMemory(__bss_start__, (PCHAR)__bss_end__ - (PCHAR)__bss_start__);
#else
RtlCopyMemory(__bss_start__, /* I think this function should initialize the data in the .bss section */
end, /* The source should be the pointer to raw of the EOF Extra Data, but how to get it?! It's not loaded to memory in win/ros */
(PCHAR)__bss_end__ - (PCHAR)__bss_start__); /* Or should we rather copy 0x2000 (raw size of EOF Extra data)? */
#endif
}
typedef void (__cdecl *func_ptr) (void);