am-apps.data.size = d, am-apps.bss.size = d heap: [0x80156000 - 0x88000000]
\ | / - RT - Thread Operating System / | \ 5.0.1 build Oct 21 2024 21:55:52 2006 - 2022 Copyright by RT-Thread team [I/utest] utest is initialize success. [I/utest] total utest testcase num: (0) Hello RISC-V! msh />help RT-Thread shell commands: date - get date and time or set (local timezone) [year month day hour min sec] list - list objects version - show RT-Thread version information clear - clear the terminal screen free - Show the memory usage in the system. ps - List threads in the system. help - RT-Thread shell help. tail - print the last N - lines data of the given file echo - echo string to file df - disk free umount - Unmount the mountpoint mount - mount <device> <mountpoint> <fstype> mkfs - format disk with file system mkdir - Create the DIRECTORY. pwd - Print the name of the current working directory. cd - Change the shell working directory. rm - Remove(unlink) the FILE(s). cat - Concatenate FILE(s) mv - Rename SOURCE to DEST. cp - Copy SOURCE to DEST. ls - List information about the FILEs. utest_run - utest_run [-thread or -help] [testcase name] [loop num] utest_list - output all utest testcase memtrace - dump memory trace information memcheck - check memory data am_fceux_am - AM fceux_am am_snake - AM snake am_typing_game - AM typing_game am_microbench - AM microbench am_hello - AM hello
msh />date [W/time] Cannot find a RTC device! local time: Thu Jan 1 08:00:00 1970 timestamps: 0 timezone: UTC+8 msh />version
\ | / - RT - Thread Operating System / | \ 5.0.1 build Oct 21 2024 21:55:52 2006 - 2022 Copyright by RT-Thread team msh />free total : 132816792 used : 33583304 maximum : 33583304 available: 99233488 msh />ps thread pri status sp stack size max used left tick error ------------------------ --- ------- ---------- ---------- ------ ---------- --- tshell 20 running 0x000000a0 0x00001000 21% 0x0000000a OK sys workq 23 ready 0x000000a0 0x00002000 01% 0x0000000a OK tidle0 31 ready 0x000000a0 0x00004000 00% 0x00000020 OK timer 4 suspend 0x000000f0 0x00004000 01% 0x0000000a OK main 10 close 0x000000e0 0x00000800 19% 0x00000014 OK msh />pwd / msh />ls No such directory msh />memtrace
memory heap address: name : heap total : 0x132816792 used : 0x33583304 max_used: 0x33583336 heap_ptr: 0x80156048 lfree : 0x8215d110 heap_end: 0x87fffff0
--memory item information -- [0x80156048 - 32M] NONE [0x82156058 - 12K] NONE [0x82159260 - 176] NONE [0x82159320 - 2K] NONE [0x82159b30 - 16] main [0x82159b50 - 72] main [0x82159ba8 - 176] main [0x82159c68 - 8K] main [0x8215bc78 - 952] main [0x8215c040 - 176] main [0x8215c100 - 4K] main [0x8215d110 - 94M] msh />memcheck msh />utest_list [I/utest] Commands list : msh />
static Context* ev_handler(Event e, Context* c) { rt_thread_t current; rt_ubase_t* para;
switch (e.event) { case EVENT_YIELD: current = rt_thread_self(); para = (rt_ubase_t*)current->user_data; rt_ubase_t to = para[0]; rt_ubase_t from = para[1]; if (from) { *((Context**)from) = c; } c = *(Context**)to; // 解引用,拿到一级指针 break; case EVENT_IRQ_TIMER: return c; default: printf("Unhandled event ID = %d\n", e.event); assert(0); }
switch (e.event) { case EVENT_YIELD: current = rt_thread_self(); para = (rt_ubase_t*)current->user_data; rt_ubase_t to = para[0]; rt_ubase_t from = para[1]; if (from) { *((Context**)from) = c; } c = *(Context**)to; // 解引用,拿到一级指针 break; case EVENT_IRQ_TIMER: return c; default: printf("Unhandled event ID = %d\n", e.event); assert(0); }
am-apps.data.size = d, am-apps.bss.size = d heap: [0x80156000 - 0x88000000]
\ | / - RT - Thread Operating System / | \ 5.0.1 build Oct 21 2024 21:55:52 2006 - 2022 Copyright by RT-Thread team rt_hw_context_switch_to:to = 0x80148fd8 rt_hw_context_switch:to = 0x8215929c [I/utest] utest is initialize success. [I/utest] total utest testcase num: (0) Hello RISC-V! rt_hw_context_switch:to = 0x8215c07c msh />help RT-Thread shell commands: date - get date and time or set (local timezone) [year month day hour min sec] list - list objects version - show RT-Thread version information clear - clear the terminal screen free - Show the memory usage in the system. ps - List threads in the system. help - RT-Thread shell help. tail - print the last N - lines data of the given file echo - echo string to file df - disk free umount - Unmount the mountpoint mount - mount <device> <mountpoint> <fstype> mkfs - format disk with file system mkdir - Create the DIRECTORY. pwd - Print the name of the current working directory. cd - Change the shell working directory. rm - Remove(unlink) the FILE(s). cat - Concatenate FILE(s) mv - Rename SOURCE to DEST. cp - Copy SOURCE to DEST. ls - List information about the FILEs. utest_run - utest_run [-thread or -help] [testcase name] [loop num] utest_list - output all utest testcase memtrace - dump memory trace information memcheck - check memory data am_fceux_am - AM fceux_am am_snake - AM snake am_typing_game - AM typing_game am_microbench - AM microbench am_hello - AM hello
msh />date [W/time] Cannot find a RTC device! local time: Thu Jan 1 08:00:00 1970 timestamps: 0 timezone: UTC+8 msh />version
\ | / - RT - Thread Operating System / | \ 5.0.1 build Oct 21 2024 21:55:52 2006 - 2022 Copyright by RT-Thread team msh />free total : 132816792 used : 33583304 maximum : 33583304 available: 99233488 msh />ps thread pri status sp stack size max used left tick error ------------------------ --- ------- ---------- ---------- ------ ---------- --- tshell 20 running 0x000000a0 0x00001000 21% 0x0000000a OK sys workq 23 ready 0x000000a0 0x00002000 01% 0x0000000a OK tidle0 31 ready 0x000000a0 0x00004000 00% 0x00000020 OK timer 4 suspend 0x00000120 0x00004000 03% 0x0000000a OK main 10 close 0x00000110 0x00000800 23% 0x00000014 OK msh />pwd / msh />ls No such directory msh />memtrace
memory heap address: name : heap total : 0x132816792 used : 0x33583304 max_used: 0x33583336 heap_ptr: 0x80156048 lfree : 0x8215d110 heap_end: 0x87fffff0
--memory item information -- [0x80156048 - 32M] NONE [0x82156058 - 12K] NONE [0x82159260 - 176] NONE [0x82159320 - 2K] NONE [0x82159b30 - 16] main [0x82159b50 - 72] main [0x82159ba8 - 176] main [0x82159c68 - 8K] main [0x8215bc78 - 952] main [0x8215c040 - 176] main [0x8215c100 - 4K] main [0x8215d110 - 94M] msh />memcheck msh />utest_list [I/utest] Commands list :