Changeset 8389628 in rtems for c/src/lib/libmisc
- Timestamp:
- 04/22/96 16:53:46 (28 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- d2d6467
- Parents:
- 5a36154a
- Location:
- c/src/lib/libmisc
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libmisc/assoc/assoc.c
r5a36154a r8389628 1 1 /* 2 * @(#)assoc.c 1.6 - 95/10/253 *4 *5 2 * assoc.c 6 3 * rtems assoc routines -
c/src/lib/libmisc/assoc/assoc.h
r5a36154a r8389628 1 1 /* 2 * @(#)assoc.h 1.4 - 95/10/253 *4 2 * 5 3 * Rtems associativity routines. Mainly used to convert a value from -
c/src/lib/libmisc/error/error.c
r5a36154a r8389628 1 1 /* 2 * @(#)error.c 1.6 - 95/12/123 *4 *5 2 * report errors and panics to RTEMS' stderr. 6 3 * Currently just used by RTEMS monitor. -
c/src/lib/libmisc/error/error.h
r5a36154a r8389628 1 2 1 /* 3 * @(#)error.h 1.3 - 95/10/254 *5 *6 2 * Defines and externs for rtems error reporting 7 3 * … … 25 21 const char *rtems_status_text(rtems_status_code); 26 22 int rtems_error(int error_code, const char *printf_format, ...); 23 #ifdef __GNUC__ 24 void rtems_panic(const char *printf_format, ...) 25 __attribute__ ((__noreturn__)); 26 #else 27 27 void rtems_panic(const char *printf_format, ...); 28 #endif 28 29 29 30 extern int rtems_panic_in_progress; -
c/src/lib/libmisc/monitor/mon-command.c
r5a36154a r8389628 1 1 /* 2 * @(#)command.c 1.5 - 95/08/023 *4 *5 2 * Command parsing routines for RTEMS monitor 6 3 * -
c/src/lib/libmisc/monitor/mon-config.c
r5a36154a r8389628 1 1 /* 2 * @(#)config.c 1.5 - 95/08/023 *4 *5 2 * RTEMS Config display support 6 3 * -
c/src/lib/libmisc/monitor/mon-dname.c
r5a36154a r8389628 1 1 /* 2 * @(#)dname.c 1.5 - 96/01/033 *4 *5 2 * RTEMS monitor driver names support. 6 3 * -
c/src/lib/libmisc/monitor/mon-driver.c
r5a36154a r8389628 1 1 /* 2 * @(#)driver.c 1.4 - 95/08/023 *4 *5 2 * RTEMS monitor IO (device drivers) support 6 3 * -
c/src/lib/libmisc/monitor/mon-extension.c
r5a36154a r8389628 1 1 /* 2 * @(#)extension.c 1.6 - 95/09/253 *4 *5 2 * RTEMS Monitor extension support 6 3 * -
c/src/lib/libmisc/monitor/mon-itask.c
r5a36154a r8389628 1 1 /* 2 * @(#)itask.c 1.6 - 96/01/03 3 * 4 * 5 * RTEMS Monitor init task support 2 * RTEMS Monitor init task support 6 3 * 7 4 * $Id$ -
c/src/lib/libmisc/monitor/mon-manager.c
r5a36154a r8389628 1 1 /* 2 * @(#)manager.c 1.4 - 96/01/03 3 * 4 * 5 * RTEMS Monitor "manager" support. 6 * Used to traverse object (chain) lists and print them out. 2 * RTEMS Monitor "manager" support. 3 * Used to traverse object (chain) lists and print them out. 7 4 * 8 5 * $Id$ -
c/src/lib/libmisc/monitor/mon-monitor.c
r5a36154a r8389628 1 1 /* 2 * @(#)monitor.c 1.23 - 96/01/033 *4 *5 *6 2 * RTEMS monitor main body 7 3 * … … 19 15 * remote request/response stuff should be cleaned up 20 16 * maybe we can use real rpc?? 21 * 'info' comma dnto print out:17 * 'info' command to print out: 22 18 * interrupt stack location, direction and size 23 19 * floating point config stuff … … 263 259 } 264 260 261 void 262 rtems_monitor_debugger_cmd( 263 int argc, 264 char **argv, 265 unsigned32 command_arg, 266 boolean verbose 267 ) 268 { 269 #ifdef CPU_INVOKE_DEBUGGER 270 CPU_INVOKE_DEBUGGER; 271 #endif 272 } 265 273 266 274 void … … 304 312 305 313 void 306 rtems_monitor_debugger_cmd(307 int argc,308 char **argv,309 unsigned32 command_arg,310 boolean verbose311 )312 {313 #ifdef CPU_INVOKE_DEBUGGER314 CPU_INVOKE_DEBUGGER;315 #endif316 }317 318 void319 314 rtems_monitor_node_cmd( 320 315 int argc, … … 341 336 } 342 337 343 if ((new_node >= 1) && (new_node <= _Configuration_MP_table->maximum_nodes)) 344 rtems_monitor_default_node = new_node; 338 if ((new_node >= 1) && 339 _Configuration_MP_table && 340 (new_node <= _Configuration_MP_table->maximum_nodes)) 341 rtems_monitor_default_node = new_node; 345 342 } 346 343 … … 384 381 return; 385 382 386 #ifdef SIMHPPA387 fp = fdopen(8, "r"); /* don't ask; don't tell */388 #else389 383 fp = fopen("symbols", "r"); 390 #endif391 384 392 385 if (fp == 0) -
c/src/lib/libmisc/monitor/mon-mpci.c
r5a36154a r8389628 1 1 /* 2 * @(#)mpci.c 1.6 - 95/08/023 *4 *5 2 * RTEMS MPCI Config display support 6 3 * -
c/src/lib/libmisc/monitor/mon-object.c
r5a36154a r8389628 1 1 /* 2 * @(#)object.c 1.9 - 96/01/033 *4 *5 2 * RTEMS Monitor "object" support. 6 3 * … … 342 339 for (arg=1; argv[arg]; arg++) 343 340 { 344 id = (rtems_id) strtoul(argv[arg], 0, 0);341 id = (rtems_id) strtoul(argv[arg], 0, 16); 345 342 id = rtems_monitor_id_fixup(id, default_node, type); 346 343 type = (rtems_monitor_object_type_t) rtems_get_class(id); -
c/src/lib/libmisc/monitor/mon-prmisc.c
r5a36154a r8389628 1 1 /* 2 * @(#)prmisc.c 1.9 - 95/08/023 *4 *5 2 * Print misc stuff for the monitor dump routines 6 3 * Each routine returns the number of characters it output. -
c/src/lib/libmisc/monitor/mon-queue.c
r5a36154a r8389628 1 1 /* 2 * @(#)queue.c 1.5 - 95/07/313 *4 2 * $Id$ 5 3 */ -
c/src/lib/libmisc/monitor/mon-server.c
r5a36154a r8389628 1 1 /* 2 * @(#)server.c 1.5 - 96/01/03 3 * 4 * 5 * RTEMS monitor server (handles requests for info from RTEMS monitors 2 * RTEMS monitor server (handles requests for info from RTEMS monitors 6 3 * running on other nodes) 7 4 * -
c/src/lib/libmisc/monitor/mon-symbols.c
r5a36154a r8389628 1 /*2 * @(#)symbols.c 1.10 - 95/08/023 *4 * $Id$5 */6 7 /* #define qsort _quicksort */8 9 1 /* 10 2 * File: symbols.c … … 16 8 * 17 9 * TODO: 10 * 11 * $Id$ 18 12 */ 19 13 … … 51 45 (void) free(table->addresses); 52 46 table->addresses = 0; 53 54 if (table->symbols)55 (void) free(table->symbols);56 table->symbols = 0;57 58 47 p = table->string_buffer_head; 59 48 while (p) … … 94 83 if (table->addresses == 0) /* blew it; lost orig */ 95 84 goto failed; 96 97 table->symbols = (rtems_symbol_t *) realloc((void *) table->symbols, newsize * sizeof(rtems_symbol_t));98 if (table->symbols == 0) /* blew it; lost orig */99 goto failed;100 101 85 table->size = newsize; 102 86 } … … 130 114 131 115 table->strings_next += symbol_length; 132 133 table->symbols[table->next] = *sp;134 135 116 table->sorted = 0; 136 117 table->next++; … … 148 129 */ 149 130 150 int131 static int 151 132 rtems_symbol_compare(const void *e1, 152 133 const void *e2) … … 163 144 } 164 145 165 /*166 * Qsort entry point for compare by string name (case independent)167 */168 169 int170 rtems_symbol_string_compare(const void *e1,171 const void *e2)172 {173 rtems_symbol_t *s1, *s2;174 s1 = (rtems_symbol_t *) e1;175 s2 = (rtems_symbol_t *) e2;176 177 return strcasecmp(s1->name, s2->name);178 }179 180 146 181 147 /* … … 183 149 */ 184 150 185 void151 static void 186 152 rtems_symbol_sort(rtems_symbol_table_t *table) 187 153 { 188 #ifdef RTEMS_ON_SIMULATOR189 printf("Sorting symbols ... "); /* so slow we need a msg */190 fflush(stdout);191 #endif192 193 154 qsort((void *) table->addresses, (size_t) table->next, 194 155 sizeof(rtems_symbol_t), rtems_symbol_compare); 195 196 qsort((void *) table->symbols, (size_t) table->next,197 sizeof(rtems_symbol_t), rtems_symbol_string_compare);198 199 #ifdef RTEMS_ON_SIMULATOR200 /* so slow we need a msg */201 printf("done\n");202 #endif203 204 156 table->sorted = 1; 205 157 } 158 206 159 207 160 /* … … 263 216 264 217 /* 218 * Search the symbol table for the exact matching address. 219 * If the symbol table has already been sorted, then 220 * call the regular symbol value lookup, however, it it 221 * has not yet been sorted, search it sequentially. 222 * This routine is primarily used for low level symbol 223 * lookups (eg. from exception handler and interrupt routines) 224 * where the penality of sorted is not wanted and where 225 * an exact match is needed such that symbol table order 226 * is not important. 227 */ 228 const rtems_symbol_t * 229 rtems_symbol_value_lookup_exact( 230 rtems_symbol_table_t *table, 231 rtems_unsigned32 value 232 ) 233 { 234 int s; 235 rtems_symbol_t *sp; 236 237 if (table == 0) 238 { 239 table = rtems_monitor_symbols; 240 if (table == 0) 241 return NULL; 242 } 243 244 if (table->sorted) 245 { 246 sp = rtems_symbol_value_lookup(table, value); 247 if ( rtems_symbol_value(sp) == value ) 248 return sp; 249 else 250 return NULL; /* not an exact match */ 251 } 252 253 for (s = 0, sp = table->addresses; s < table->next; s++, sp++) 254 { 255 if ( sp->value == value ) 256 return sp; 257 } 258 259 return NULL; 260 261 } 262 263 264 /* 265 265 * Search the symbol table by string name (case independent) 266 266 */ … … 272 272 ) 273 273 { 274 rtems_symbol_t *sp = 0; 275 rtems_symbol_t key; 276 277 if (table == 0) 274 int s; 275 rtems_symbol_t *sp; 276 277 if (table == 0) 278 { 278 279 table = rtems_monitor_symbols; 279 280 if ((table == 0) || (name == 0)) 281 goto done; 282 283 if (table->sorted == 0) 284 rtems_symbol_sort(table); 285 286 /* 287 * dummy up one for bsearch() 288 */ 289 290 key.name = name; 291 key.value = 0; 292 293 sp = (rtems_symbol_t *) bsearch((const void *) &key, 294 (const void *) table->symbols, 295 (size_t) table->next, 296 sizeof(rtems_symbol_t), 297 rtems_symbol_string_compare); 298 299 done: 300 return sp; 280 if (table == 0) 281 return NULL; 282 } 283 284 for (s = 0, sp = table->addresses; s < table->next; s++, sp++) 285 { 286 if ( strcasecmp(sp->name, name) == 0 ) 287 return sp; 288 } 289 290 return NULL; 301 291 } 302 292 … … 326 316 327 317 *next_id += 1; 328 return (void *) (table-> symbols + n);318 return (void *) (table->addresses + n); 329 319 330 320 failed: … … 439 429 rtems_symbol_sort(table); 440 430 441 for (s = 0, sp = table-> symbols; s < table->next; s++, sp++)431 for (s = 0, sp = table->addresses; s < table->next; s++, sp++) 442 432 { 443 433 rtems_monitor_symbol_t canonical_symbol; -
c/src/lib/libmisc/monitor/mon-task.c
r5a36154a r8389628 1 1 /* 2 * @(#)task.c 1.9 - 95/08/013 *4 *5 2 * RTEMS Monitor task support 6 3 * -
c/src/lib/libmisc/monitor/monitor.h
r5a36154a r8389628 1 /*2 * @(#)monitor.h 1.21 - 96/01/033 *4 *5 * monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp6 */7 8 1 /* 9 2 * File: monitor.h … … 13 6 * 14 7 * TODO: 8 * 9 * $Id$ 15 10 */ 16 11 … … 26 21 27 22 /* 28 * XXX this should be in rtems proper when type becomes part of id23 * Monitor types are derived from rtems object classes 29 24 */ 30 25 … … 307 302 308 303 typedef struct { 309 rtems_monitor_object_type_t 304 rtems_monitor_object_type_t type; 310 305 void *object_information; 311 306 int size; /* of canonical object */ … … 420 415 rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32); 421 416 rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32); 417 const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32); 422 418 rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *); 423 419 void *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *); -
c/src/lib/libmisc/monitor/symbols.h
r5a36154a r8389628 1 1 /* 2 * @(#)symbols.h 1.3 - 95/06/093 *4 *5 2 * RTEMS monitor symbol table functions 6 3 * … … 49 46 50 47 /* 51 * String list -- sorted by name (when we do a lookup)52 * This is a duplicate of the info in table->addresses, but it's53 * pretty small, so I don't worry about it.54 */55 56 rtems_symbol_t *symbols; /* symbol array */57 58 /*59 48 * String pool, unsorted, a list of blocks of string data 60 49 */ -
c/src/lib/libmisc/stackchk/check.c
r5a36154a r8389628 20 20 21 21 #include <rtems.h> 22 23 /* 24 * HACK 25 * the stack dump information should be printed by a "fatal" extension. 26 * Fatal extensions only get called via rtems_fatal_error_occurred() 27 * and not when rtems_shutdown_executive() is called. 28 * I hope/think this is changing so that fatal extensions are renamed 29 * to "shutdown" extensions. 30 * When that happens, this #define should be deleted and all the code 31 * it marks. 32 */ 33 #define DONT_USE_FATAL_EXTENSION 34 22 35 23 36 extern rtems_configuration_table BSP_Configuration; … … 50 63 Stack_check_Begin_extension, /* task_begin */ 51 64 0, /* task_exitted */ 65 #ifdef DONT_USE_FATAL_EXTENSION 66 0, /* fatal */ 67 #else 52 68 Stack_check_Fatal_extension, /* fatal */ 69 #endif 53 70 }; 54 71 … … 167 184 168 185 Stack_check_Blown_task = 0; 169 170 #ifdef STACK_CHECKER_REPORT_USAGE171 atexit( Stack_check_Dump_usage );172 #endif173 186 174 187 /* … … 218 231 } 219 232 233 #ifdef DONT_USE_FATAL_EXTENSION 234 #ifdef RTEMS_DEBUG 235 /* 236 * this would normally be called by a fatal extension 237 * handler, but we don't run fatal extensions unless 238 * we fatal error. 239 */ 240 atexit(Stack_check_Dump_usage); 241 #endif 242 #endif 243 220 244 stack_check_initialized = 1; 221 245 } … … 432 456 */ 433 457 434 void Stack_check_Fatal_extension( 458 void Stack_check_Fatal_extension( 435 459 Internal_errors_Source source, 436 460 boolean is_internal, … … 438 462 ) 439 463 { 464 #ifndef DONT_USE_FATAL_EXTENSION 440 465 if (status == 0) 441 466 Stack_check_Dump_usage(); 467 #endif 442 468 } 443 469
Note: See TracChangeset
for help on using the changeset viewer.