Go to the source code of this file.
Functions | |
| static int | cmd_memtest (int argc, char **argv) |
| mycmd_init (memtest, cmd_memtest,"memtest addr size","test memory") | |
| static int cmd_memtest | ( | int | argc, | |
| char ** | argv | |||
| ) | [static] |
Definition at line 1 of file memtest.c.
References tgt_exec, and ui_datamem.
00002 { 00003 int i; 00004 unsigned int start_address; 00005 unsigned int end_address; 00006 start_address = strtoul(argv[1],0,0); 00007 end_address = strtoul(argv[2],0,0); 00008 ui_datamem[0] = start_address & ~3; 00009 ui_datamem[1] = end_address & ~3; 00010 ui_datamem[2] = "address %08x:write %08x read %08x error %08x all error %08x\n"; 00011 tgt_exec( 00012 "1:mtc0 a0,c0_desave;\n" 00013 "lui a0,0xff20;\n" 00014 "sw v0,0x1fc(a0);\n" 00015 "sw v1,0x1fc(a0);\n" 00016 "sw t0,0x1fc(a0);\n" 00017 "sw t1,0x1fc(a0);\n" 00018 "sw t2,0x1fc(a0);\n" 00019 "sw t3,0x1fc(a0);\n" 00020 "sw ra,0x1fc(a0);\n" 00021 "lw t0,(a0);\n" 00022 "lw t1,4(a0);\n" 00023 "move t3,zero;\n" 00024 "2:li v0,0;\n" 00025 "sw v0,(t0);\n" 00026 "lw v1,(t0);\n" 00027 "beq v0,v1,3f;\n" 00028 "nop;\n" 00029 "bal 11f;\n" 00030 "nop;\n" 00031 "3:not v0;\n" 00032 "sw v0,(t0);\n" 00033 "lw v1,(t0);\n" 00034 "beq v0,v1,4f;\n" 00035 "nop;\n" 00036 "bal 11f;\n" 00037 "nop;\n" 00038 "4:addu t0,4;\n" 00039 "bne t0,t1,2b;\n" 00040 "nop;\n" 00041 "lw ra,0x1fc(a0);\n" 00042 "lw t3,0x1fc(a0);\n" 00043 "lw t2,0x1fc(a0);\n" 00044 "lw t1,0x1fc(a0);\n" 00045 "lw t0,0x1fc(a0);\n" 00046 "lw v1,0x1fc(a0);\n" 00047 "lw v0,0x1fc(a0);\n" 00048 "mfc0 a0,c0_desave;\n" 00049 "b 1b;\n" 00050 "nop;\n" 00051 "11:xor t2,v0,v1;\n" 00052 "or t3,t2;\n" 00053 "sw t0,12(a0);\n" 00054 "sw v0,16(a0);\n" 00055 "sw v1,20(a0);\n" 00056 "sw t2,24(a0);\n" 00057 "sw t3,28(a0);\n" 00058 "li v0,2;\n" 00059 "sb v0,0x1f5(a0);\n" 00060 "jr ra;\n" 00061 "nop;\n" 00062 ,0x8000); 00063 return 0; 00064 }
| mycmd_init | ( | memtest | , | |
| cmd_memtest | , | |||
| "memtest addr size" | , | |||
| "test memory" | ||||
| ) |
1.5.6