Changeset 2312685 in mainline
- Timestamp:
- 2005-12-10T18:02:51Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3887b105
- Parents:
- 7a8c866a
- Location:
- generic/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/console/kconsole.c
r7a8c866a r2312685 119 119 static char carg1_buf[MAX_CMDLINE+1]; 120 120 static char carg2_buf[MAX_CMDLINE+1]; 121 static char carg3_buf[MAX_CMDLINE+1]; 121 122 122 123 static int cmd_call0(cmd_arg_t *argv); … … 181 182 }; 182 183 184 static int cmd_call3(cmd_arg_t *argv); 185 static cmd_arg_t call3_argv[] = { 186 { 187 .type = ARG_TYPE_STRING, 188 .buffer = call0_buf, 189 .len = sizeof(call0_buf) 190 }, 191 { 192 .type = ARG_TYPE_VAR, 193 .buffer = carg1_buf, 194 .len = sizeof(carg1_buf) 195 }, 196 { 197 .type = ARG_TYPE_VAR, 198 .buffer = carg2_buf, 199 .len = sizeof(carg2_buf) 200 }, 201 { 202 .type = ARG_TYPE_VAR, 203 .buffer = carg3_buf, 204 .len = sizeof(carg3_buf) 205 } 206 207 }; 208 static cmd_info_t call3_info = { 209 .name = "call3", 210 .description = "call3 <function> <arg1> <arg2> <arg3> -> call function(arg1,arg2,arg3).", 211 .func = cmd_call3, 212 .argc = 4, 213 .argv = call3_argv 214 }; 183 215 184 216 /** Data and methods for 'halt' command. */ … … 228 260 if (!cmd_register(&call2_info)) 229 261 panic("could not register command %s\n", call2_info.name); 262 263 spinlock_initialize(&call3_info.lock, "kconsole_call3"); 264 link_initialize(&call3_info.link); 265 if (!cmd_register(&call3_info)) 266 panic("could not register command %s\n", call3_info.name); 230 267 231 268 spinlock_initialize(&halt_info.lock, "kconsole_halt"); … … 653 690 } 654 691 692 /** Call function with three parameters */ 693 int cmd_call3(cmd_arg_t *argv) 694 { 695 __address symaddr; 696 char *symbol; 697 __native (*f)(__native,__native,__native); 698 __native arg1 = argv[1].intval; 699 __native arg2 = argv[2].intval; 700 __native arg3 = argv[3].intval; 701 702 symaddr = get_symbol_addr(argv->buffer); 703 if (!symaddr) 704 printf("Symbol %s not found.\n", argv->buffer); 705 else if (symaddr == (__address) -1) { 706 symtab_print_search(argv->buffer); 707 printf("Duplicate symbol, be more specific.\n"); 708 } else { 709 symbol = get_symtab_entry(symaddr); 710 printf("Calling f(0x%x,0x%x, 0x%x): 0x%p: %s\n", 711 arg1, arg2, arg3, symaddr, symbol); 712 f = (__native (*)(__native,__native,__native)) symaddr; 713 printf("Result: 0x%x\n", f(arg1, arg2, arg3)); 714 } 715 716 return 1; 717 } 718 655 719 656 720 /** Print detailed description of 'describe' command. */ -
generic/src/lib/func.c
r7a8c866a r2312685 136 136 137 137 while (*text) { 138 result *= base;139 138 if (base != 16 && *text >= 'A' && *text <= 'F') 140 139 break; … … 142 141 break; 143 142 144 if (*text >= '0' && *text <= '9') 143 if (*text >= '0' && *text <= '9') { 144 result *= base; 145 145 result += *text - '0'; 146 else if (*text >= 'A' && *text <= 'F') 146 } else if (*text >= 'A' && *text <= 'F') { 147 result *= base; 147 148 result += *text - 'A' + 10; 148 else149 } else 149 150 break; 150 151 text++; -
generic/src/mm/heap.c
r7a8c866a r2312685 65 65 chunk_t *x, *y, *z; 66 66 67 size = ALIGN_UP(size, sizeof(__native));68 69 67 if (size == 0) 70 68 panic("zero-size allocation request"); 71 69 70 size = ALIGN_UP(size, sizeof(__native)); 71 72 72 x = chunk0; 73 73 ipl = interrupts_disable();
Note:
See TracChangeset
for help on using the changeset viewer.