19 if (nargs == 2 &&
strncmp(args[1],
"--help", 7) == 0) {
20 printf(
"use: %s \n\n", args[0]);
22 printf(
"\tDisplays the current memory use and prints the\n");
25 printf(
"\t--help\t\tdisplay this help and exit\n");
57 printf(
"Block address Length (dec) Length (hex)\n");
58 printf(
"------------- ------------ ------------\n");
61 printf(
" 0x%08x %9d 0x%08x\n", block,
67 extern void start(
void);
90 for (i = 1; i <
NPROC; i++) {
104 kheap = kfree - stack;
108 printf(
"Current system memory statistics:\n");
109 printf(
"---------------------------------\n");
110 printf(
"%10d bytes (0x%08x) of Xinu code\n", code, code);
111 printf(
"%10d bytes (0x%08x) of allocated stack space\n", stack, stack);
112 printf(
"%10d bytes (0x%08x) of available kernel heap space\n\n", kheap, kheap);
#define NULL
連結リスト用のNULLポインタ
int32 strncmp(const char *, const char *, int32)
static void printMemUse(void)
static void printFreeList(void)
struct memblk * mnext
次のフリーメモリブロックへのポインタ
int32 printf(const char *,...)
struct memblk memlist
フリーメモリリストの先頭
#define PR_FREE
プロセステーブルエントリが使用されていない状態。
uint32 mlength
memblk構造体のサイズを含むブロックサイズ
struct procent proctab[]
プロセステーブル。
int32 shellcmd
シェルコール関数 返り値の型
int32 fprintf(int, char *,...)
shellcmd xsh_memstat(int nargs, char *args[])
unsigned int uint32
符号なし32ビット整数(unsigned int)