Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / system / SysMon / memory.c
blob429d44950e0f2bb0f8cf155c498891dcfad4ef9a
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "sysmon_intern.h"
8 #include <clib/alib_protos.h>
10 /* Memory functions */
11 static BOOL InitMemory(struct SysMonData *smdata)
13 return TRUE;
16 static VOID DeInitMemory(struct SysMonData *smdata)
20 VOID UpdateMemoryStaticInformation(struct SysMonData * smdata)
22 TEXT buffer[64] = {0};
23 ULONG size = 0;
25 /* Size */
26 size = AvailMem(MEMF_ANY | MEMF_TOTAL) / 1024;
27 __sprintf(buffer, "%ld kB", size);
28 set(smdata->memorysize[MEMORY_RAM], MUIA_Text_Contents, buffer);
30 size = AvailMem(MEMF_CHIP | MEMF_TOTAL) / 1024;
31 __sprintf(buffer, "%ld kB", size);
32 set(smdata->memorysize[MEMORY_CHIP], MUIA_Text_Contents, buffer);
34 size = AvailMem(MEMF_FAST | MEMF_TOTAL) / 1024;
35 __sprintf(buffer, "%ld kB", size);
36 set(smdata->memorysize[MEMORY_FAST], MUIA_Text_Contents, buffer);
39 VOID UpdateMemoryInformation(struct SysMonData * smdata)
41 TEXT buffer[64] = {0};
42 ULONG size = 0;
44 /* Free */
45 size = AvailMem(MEMF_ANY) / 1024;
46 __sprintf(buffer, "%ld kB", size);
47 set(smdata->memoryfree[MEMORY_RAM], MUIA_Text_Contents, buffer);
49 size = AvailMem(MEMF_CHIP) / 1024;
50 __sprintf(buffer, "%ld kB", size);
51 set(smdata->memoryfree[MEMORY_CHIP], MUIA_Text_Contents, buffer);
53 size = AvailMem(MEMF_FAST) / 1024;
54 __sprintf(buffer, "%ld kB", size);
55 set(smdata->memoryfree[MEMORY_FAST], MUIA_Text_Contents, buffer);
58 struct SysMonModule memorymodule =
60 .Init = InitMemory,
61 .DeInit = DeInitMemory,