Make sys_memstat arguments optional.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-01-14 14:40:04 +01:00
parent f8793bc53e
commit 3c821cb4a1
1 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,6 @@
/******************************************************************************* /*******************************************************************************
COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2011, 2012. Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013.
This file is part of Sortix. This file is part of Sortix.
@ -29,13 +29,15 @@
namespace Sortix { namespace Sortix {
namespace Memory { namespace Memory {
int SysMemStat(size_t* memused, size_t* memtotal) static int sys_memstat(size_t* memused, size_t* memtotal)
{ {
size_t used; size_t used;
size_t total; size_t total;
Statistics(&used, &total); Statistics(&used, &total);
// TODO: Check if legal user-space buffers! // TODO: Check if legal user-space buffers!
if ( memused )
*memused = used; *memused = used;
if ( memtotal )
*memtotal = total; *memtotal = total;
return 0; return 0;
} }
@ -46,7 +48,7 @@ void Init(multiboot_info_t* bootinfo)
{ {
InitCPU(bootinfo); InitCPU(bootinfo);
Syscall::Register(SYSCALL_MEMSTAT, (void*) SysMemStat); Syscall::Register(SYSCALL_MEMSTAT, (void*) sys_memstat);
} }
} // namespace Memory } // namespace Memory