Changeset 8389628 in rtems


Ignore:
Timestamp:
04/22/96 16:53:46 (28 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
d2d6467
Parents:
5a36154a
Message:

updates from Tony Bennett

Files:
88 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/include/rtems/assoc.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.h     1.4 - 95/10/25
    3  *     
    42 *
    53 *  Rtems associativity routines.  Mainly used to convert a value from
  • c/src/exec/libcsupport/include/rtems/error.h

    r5a36154a r8389628  
    1 
    21/*
    3  *      @(#)error.h     1.3 - 95/10/25
    4  *     
    5  *
    62 *  Defines and externs for rtems error reporting
    73 *
     
    2521const char *rtems_status_text(rtems_status_code);
    2622int   rtems_error(int error_code, const char *printf_format, ...);
     23#ifdef __GNUC__
     24void  rtems_panic(const char *printf_format, ...)
     25                                         __attribute__ ((__noreturn__));
     26#else
    2727void  rtems_panic(const char *printf_format, ...);
     28#endif
    2829
    2930extern int rtems_panic_in_progress;
  • c/src/exec/libcsupport/src/assoc.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.c     1.6 - 95/10/25
    3  *
    4  *
    52 * assoc.c
    63 *      rtems assoc routines
  • c/src/exec/libcsupport/src/error.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)error.c     1.6 - 95/12/12
    3  *     
    4  *
    52 *  report errors and panics to RTEMS' stderr.
    63 *  Currently just used by RTEMS monitor.
  • c/src/exec/score/tools/hppa1.1/genoffsets.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)genoffsets.c        1.7 - 95/09/25
    3  *     
    4  *
    52 *  genoffsets.c
    63 *
    74 *  This file generates the offsets.h for the HP PA-RISC port of RTEMS.
    85 *
    9  *  NOTE:  It only prints the offset for structures actually used 
     6 *  NOTE:  It only prints the offset for structures actually used
    107 *         by the assembly code.
    118 *
     
    1815 *
    1916 *  $Id$
    20  *
    2117 */
    2218
     
    7167
    7268#define PRINT_SIZE( STRING, item ) \
    73   printf( "#define\t%s\t%d\t\t/* 0x%x */\n", \
     69  printf( "#ifdef ASM\n#define\t%s\t%d\t\t/* 0x%x */\n#endif\n", \
    7470          STRING, \
    7571          sizeof(item), \
     
    146142  PRINT_COMMENT("Context_Control_fp information");
    147143
     144  PRINT_IT( "FR0_OFFSET", Context_Control_fp *, fr0 );
     145  PRINT_IT( "FR1_OFFSET", Context_Control_fp *, fr1 );
     146  PRINT_IT( "FR2_OFFSET", Context_Control_fp *, fr2 );
     147  PRINT_IT( "FR3_OFFSET", Context_Control_fp *, fr3 );
     148  PRINT_IT( "FR4_OFFSET", Context_Control_fp *, fr4 );
     149  PRINT_IT( "FR5_OFFSET", Context_Control_fp *, fr5 );
     150  PRINT_IT( "FR6_OFFSET", Context_Control_fp *, fr6 );
     151  PRINT_IT( "FR7_OFFSET", Context_Control_fp *, fr7 );
     152  PRINT_IT( "FR8_OFFSET", Context_Control_fp *, fr8 );
     153  PRINT_IT( "FR9_OFFSET", Context_Control_fp *, fr9 );
     154  PRINT_IT( "FR10_OFFSET", Context_Control_fp *, fr10 );
     155  PRINT_IT( "FR11_OFFSET", Context_Control_fp *, fr11 );
     156  PRINT_IT( "FR12_OFFSET", Context_Control_fp *, fr12 );
     157  PRINT_IT( "FR13_OFFSET", Context_Control_fp *, fr13 );
     158  PRINT_IT( "FR14_OFFSET", Context_Control_fp *, fr14 );
     159  PRINT_IT( "FR15_OFFSET", Context_Control_fp *, fr15 );
     160  PRINT_IT( "FR16_OFFSET", Context_Control_fp *, fr16 );
     161  PRINT_IT( "FR17_OFFSET", Context_Control_fp *, fr17 );
     162  PRINT_IT( "FR18_OFFSET", Context_Control_fp *, fr18 );
     163  PRINT_IT( "FR19_OFFSET", Context_Control_fp *, fr19 );
     164  PRINT_IT( "FR20_OFFSET", Context_Control_fp *, fr20 );
     165  PRINT_IT( "FR21_OFFSET", Context_Control_fp *, fr21 );
     166  PRINT_IT( "FR22_OFFSET", Context_Control_fp *, fr22 );
     167  PRINT_IT( "FR23_OFFSET", Context_Control_fp *, fr23 );
     168  PRINT_IT( "FR24_OFFSET", Context_Control_fp *, fr24 );
     169  PRINT_IT( "FR25_OFFSET", Context_Control_fp *, fr25 );
     170  PRINT_IT( "FR26_OFFSET", Context_Control_fp *, fr26 );
     171  PRINT_IT( "FR27_OFFSET", Context_Control_fp *, fr27 );
     172  PRINT_IT( "FR28_OFFSET", Context_Control_fp *, fr28 );
     173  PRINT_IT( "FR29_OFFSET", Context_Control_fp *, fr29 );
     174  PRINT_IT( "FR30_OFFSET", Context_Control_fp *, fr30 );
     175  PRINT_IT( "FR31_OFFSET", Context_Control_fp *, fr31 );
     176
    148177  PRINT_SIZE("CPU_CONTEXT_FP_SIZE", Context_Control_fp);
    149178
  • c/src/lib/include/rtems/assoc.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.h     1.4 - 95/10/25
    3  *     
    42 *
    53 *  Rtems associativity routines.  Mainly used to convert a value from
  • c/src/lib/include/rtems/error.h

    r5a36154a r8389628  
    1 
    21/*
    3  *      @(#)error.h     1.3 - 95/10/25
    4  *     
    5  *
    62 *  Defines and externs for rtems error reporting
    73 *
     
    2521const char *rtems_status_text(rtems_status_code);
    2622int   rtems_error(int error_code, const char *printf_format, ...);
     23#ifdef __GNUC__
     24void  rtems_panic(const char *printf_format, ...)
     25                                         __attribute__ ((__noreturn__));
     26#else
    2727void  rtems_panic(const char *printf_format, ...);
     28#endif
    2829
    2930extern int rtems_panic_in_progress;
  • c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h

    r5a36154a r8389628  
    9898#define BSP_LIBIO_MAX_FDS       20
    9999
    100 /*
    101  *  Device Driver Table Entries
    102  */
    103 
    104 /*
    105  * When not doing printf to a buffer, we do printf thru RTEMS libio
    106  * and our tty driver.  Set it up so that console is right.
    107  */
    108 
    109 #define CONSOLE_DRIVER_TABLE_ENTRY \
    110   { tty_initialize, tty_open, tty_close, tty_read, tty_write, tty_control }
    111 
    112 /*
    113  * NOTE: Use the standard Clock driver entry
    114  */
    115 
    116 /*
    117  * How many libio files we want
    118  */
    119 #define BSP_LIBIO_MAX_FDS       20
    120 
    121100#define HPPA_INTERRUPT_EXTERNAL_MPCI        HPPA_INTERRUPT_EXTERNAL_10
    122 
    123 rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
    124101
    125102rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
  • c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)ttydrv.h    1.1 - 95/06/02
    3  *     
    42 *  $Id$
    53 */
  • c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c

    r5a36154a r8389628  
    1 /*
    2  *      @(#)bspstart.c  1.16 - 95/06/28
    3  */
    4 
    51/*  bsp_start()
    62 *
     
    353349    Cpu_table.itimer_clicks_per_microsecond = 1;
    354350
     351#ifdef 0
     352    /*
     353     * Commented by DIVISION INC.  External interrupt
     354     * processing is now divorced from RTEMS for HPPA.
     355     */
     356
    355357    /*
    356358     * Determine the external interrupt processing order
     
    370372      Cpu_table.external_interrupts++;
    371373    }
     374#endif
    372375
    373376    /*
  • c/src/lib/libc/assoc.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.c     1.6 - 95/10/25
    3  *
    4  *
    52 * assoc.c
    63 *      rtems assoc routines
  • c/src/lib/libc/assoc.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.h     1.4 - 95/10/25
    3  *     
    42 *
    53 *  Rtems associativity routines.  Mainly used to convert a value from
  • c/src/lib/libc/error.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)error.c     1.6 - 95/12/12
    3  *     
    4  *
    52 *  report errors and panics to RTEMS' stderr.
    63 *  Currently just used by RTEMS monitor.
  • c/src/lib/libc/error.h

    r5a36154a r8389628  
    1 
    21/*
    3  *      @(#)error.h     1.3 - 95/10/25
    4  *     
    5  *
    62 *  Defines and externs for rtems error reporting
    73 *
     
    2521const char *rtems_status_text(rtems_status_code);
    2622int   rtems_error(int error_code, const char *printf_format, ...);
     23#ifdef __GNUC__
     24void  rtems_panic(const char *printf_format, ...)
     25                                         __attribute__ ((__noreturn__));
     26#else
    2727void  rtems_panic(const char *printf_format, ...);
     28#endif
    2829
    2930extern int rtems_panic_in_progress;
  • c/src/lib/libmisc/assoc/assoc.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.c     1.6 - 95/10/25
    3  *
    4  *
    52 * assoc.c
    63 *      rtems assoc routines
  • c/src/lib/libmisc/assoc/assoc.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.h     1.4 - 95/10/25
    3  *     
    42 *
    53 *  Rtems associativity routines.  Mainly used to convert a value from
  • c/src/lib/libmisc/error/error.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)error.c     1.6 - 95/12/12
    3  *     
    4  *
    52 *  report errors and panics to RTEMS' stderr.
    63 *  Currently just used by RTEMS monitor.
  • c/src/lib/libmisc/error/error.h

    r5a36154a r8389628  
    1 
    21/*
    3  *      @(#)error.h     1.3 - 95/10/25
    4  *     
    5  *
    62 *  Defines and externs for rtems error reporting
    73 *
     
    2521const char *rtems_status_text(rtems_status_code);
    2622int   rtems_error(int error_code, const char *printf_format, ...);
     23#ifdef __GNUC__
     24void  rtems_panic(const char *printf_format, ...)
     25                                         __attribute__ ((__noreturn__));
     26#else
    2727void  rtems_panic(const char *printf_format, ...);
     28#endif
    2829
    2930extern int rtems_panic_in_progress;
  • c/src/lib/libmisc/monitor/mon-command.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)command.c   1.5 - 95/08/02
    3  *     
    4  *
    52 * Command parsing routines for RTEMS monitor
    63 *
  • c/src/lib/libmisc/monitor/mon-config.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)config.c    1.5 - 95/08/02
    3  *     
    4  *
    52 * RTEMS Config display support
    63 *
  • c/src/lib/libmisc/monitor/mon-dname.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)dname.c     1.5 - 96/01/03
    3  *     
    4  *
    52 * RTEMS monitor driver names support.
    63 *
  • c/src/lib/libmisc/monitor/mon-driver.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)driver.c    1.4 - 95/08/02
    3  *     
    4  *
    52 * RTEMS monitor IO (device drivers) support
    63 *
  • c/src/lib/libmisc/monitor/mon-extension.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)extension.c 1.6 - 95/09/25
    3  *     
    4  *
    52 * RTEMS Monitor extension support
    63 *
  • c/src/lib/libmisc/monitor/mon-itask.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)itask.c     1.6 - 96/01/03
    3  *     
    4  *
    5  *  RTEMS Monitor init task support
     2 * RTEMS Monitor init task support
    63 *
    74 *  $Id$
  • c/src/lib/libmisc/monitor/mon-manager.c

    r5a36154a r8389628  
    11/*
    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.
    74 *
    85 *  $Id$
  • c/src/lib/libmisc/monitor/mon-monitor.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)monitor.c   1.23 - 96/01/03
    3  *     
    4  *
    5  *
    62 * RTEMS monitor main body
    73 *     
     
    1915 *      remote request/response stuff should be cleaned up
    2016 *         maybe we can use real rpc??
    21  *      'info' commadn to print out:
     17 *      'info' command to print out:
    2218 *           interrupt stack location, direction and size
    2319 *           floating point config stuff
     
    263259}
    264260
     261void
     262rtems_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}
    265273
    266274void
     
    304312
    305313void
    306 rtems_monitor_debugger_cmd(
    307     int        argc,
    308     char     **argv,
    309     unsigned32 command_arg,
    310     boolean    verbose
    311 )
    312 {
    313 #ifdef CPU_INVOKE_DEBUGGER
    314     CPU_INVOKE_DEBUGGER;
    315 #endif
    316 }
    317 
    318 void
    319314rtems_monitor_node_cmd(
    320315    int     argc,
     
    341336    }
    342337
    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;
    345342}
    346343
     
    384381        return;
    385382
    386 #ifdef SIMHPPA
    387     fp = fdopen(8, "r");                /* don't ask; don't tell */
    388 #else
    389383    fp = fopen("symbols", "r");
    390 #endif
    391384   
    392385    if (fp == 0)
  • c/src/lib/libmisc/monitor/mon-mpci.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)mpci.c      1.6 - 95/08/02
    3  *     
    4  *
    52 * RTEMS MPCI Config display support
    63 *
  • c/src/lib/libmisc/monitor/mon-object.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)object.c    1.9 - 96/01/03
    3  *     
    4  *
    52 * RTEMS Monitor "object" support.
    63 *
     
    342339        for (arg=1; argv[arg]; arg++)
    343340        {
    344             id = (rtems_id) strtoul(argv[arg], 0, 0);
     341            id = (rtems_id) strtoul(argv[arg], 0, 16);
    345342            id = rtems_monitor_id_fixup(id, default_node, type);
    346343            type = (rtems_monitor_object_type_t) rtems_get_class(id);
  • c/src/lib/libmisc/monitor/mon-prmisc.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)prmisc.c    1.9 - 95/08/02
    3  *     
    4  *
    52 * Print misc stuff for the monitor dump routines
    63 * Each routine returns the number of characters it output.
  • c/src/lib/libmisc/monitor/mon-queue.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)queue.c     1.5 - 95/07/31
    3  *     
    42 *  $Id$
    53 */
  • c/src/lib/libmisc/monitor/mon-server.c

    r5a36154a r8389628  
    11/*
    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
    63 *             running on other nodes)
    74 *
  • c/src/lib/libmisc/monitor/mon-symbols.c

    r5a36154a r8389628  
    1 /*
    2  *      @(#)symbols.c   1.10 - 95/08/02
    3  *     
    4  *  $Id$
    5  */
    6 
    7 /* #define qsort _quicksort */
    8 
    91/*
    102 *  File:       symbols.c
     
    168 *
    179 *  TODO:
     10 *
     11 *  $Id$
    1812 */
    1913
     
    5145            (void) free(table->addresses);
    5246        table->addresses = 0;
    53 
    54         if (table->symbols)
    55             (void) free(table->symbols);
    56         table->symbols = 0;
    57 
    5847        p = table->string_buffer_head;
    5948        while (p)
     
    9483        if (table->addresses == 0)        /* blew it; lost orig */
    9584            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 
    10185        table->size = newsize;
    10286    }
     
    130114
    131115    table->strings_next += symbol_length;
    132 
    133     table->symbols[table->next] = *sp;
    134 
    135116    table->sorted = 0;
    136117    table->next++;
     
    148129 */
    149130
    150 int
     131static int
    151132rtems_symbol_compare(const void *e1,
    152133                     const void *e2)
     
    163144}
    164145
    165 /*
    166  * Qsort entry point for compare by string name (case independent)
    167  */
    168 
    169 int
    170 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 
    180146
    181147/*
     
    183149 */
    184150
    185 void
     151static void
    186152rtems_symbol_sort(rtems_symbol_table_t *table)
    187153{
    188 #ifdef RTEMS_ON_SIMULATOR
    189     printf("Sorting symbols ... ");         /* so slow we need a msg */
    190     fflush(stdout);
    191 #endif
    192 
    193154    qsort((void *) table->addresses, (size_t) table->next,
    194155          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_SIMULATOR
    200     /* so slow we need a msg */
    201     printf("done\n");
    202 #endif
    203 
    204156    table->sorted = 1;
    205157}
     158
    206159
    207160/*
     
    263216
    264217/*
     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 */
     228const rtems_symbol_t *
     229rtems_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/*
    265265 * Search the symbol table by string name (case independent)
    266266 */
     
    272272  )
    273273{
    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    {
    278279        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;
    301291}
    302292
     
    326316
    327317    *next_id += 1;
    328     return (void *) (table->symbols + n);
     318    return (void *) (table->addresses + n);
    329319
    330320failed:
     
    439429        rtems_symbol_sort(table);
    440430
    441     for (s = 0, sp = table->symbols; s < table->next; s++, sp++)
     431    for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
    442432    {
    443433        rtems_monitor_symbol_t canonical_symbol;
  • c/src/lib/libmisc/monitor/mon-task.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)task.c      1.9 - 95/08/01
    3  *     
    4  *
    52 * RTEMS Monitor task support
    63 *
  • c/src/lib/libmisc/monitor/monitor.h

    r5a36154a r8389628  
    1 /*
    2  *      @(#)monitor.h   1.21 - 96/01/03
    3  *     
    4  *
    5  *  monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp
    6  */
    7 
    81/*
    92 *  File:       monitor.h
     
    136 *
    147 *  TODO:
     8 *
     9 *  $Id$
    1510 */
    1611
     
    2621
    2722/*
    28  * XXX this should be in rtems proper when type becomes part of id
     23 * Monitor types are derived from rtems object classes
    2924 */
    3025
     
    307302
    308303typedef struct {
    309     rtems_monitor_object_type_t                 type;
     304    rtems_monitor_object_type_t         type;
    310305    void                               *object_information;
    311306    int                                 size;   /* of canonical object */
     
    420415rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
    421416rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
     417const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
    422418rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
    423419void   *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
  • c/src/lib/libmisc/monitor/symbols.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)symbols.h   1.3 - 95/06/09
    3  *     
    4  *
    52 *  RTEMS monitor symbol table functions
    63 *
     
    4946
    5047    /*
    51      * String list -- sorted by name (when we do a lookup)
    52      * This is a duplicate of the info in table->addresses, but it's
    53      * pretty small, so I don't worry about it.
    54      */
    55 
    56     rtems_symbol_t  *symbols;           /* symbol array */
    57 
    58     /*
    5948     * String pool, unsorted, a list of blocks of string data
    6049     */
  • c/src/lib/libmisc/stackchk/check.c

    r5a36154a r8389628  
    2020
    2121#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
    2235
    2336extern rtems_configuration_table BSP_Configuration;
     
    5063  Stack_check_Begin_extension,      /* task_begin   */
    5164  0,                                /* task_exitted */
     65#ifdef DONT_USE_FATAL_EXTENSION
     66  0,                                /* fatal        */
     67#else
    5268  Stack_check_Fatal_extension,      /* fatal        */
     69#endif
    5370};
    5471
     
    167184
    168185  Stack_check_Blown_task = 0;
    169 
    170 #ifdef STACK_CHECKER_REPORT_USAGE
    171   atexit( Stack_check_Dump_usage );
    172 #endif
    173186
    174187  /*
     
    218231  }
    219232
     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
    220244  stack_check_initialized = 1;
    221245}
     
    432456 */
    433457
    434 void Stack_check_Fatal_extension( 
     458void Stack_check_Fatal_extension(
    435459    Internal_errors_Source  source,
    436460    boolean                 is_internal,
     
    438462)
    439463{
     464#ifndef DONT_USE_FATAL_EXTENSION
    440465    if (status == 0)
    441466        Stack_check_Dump_usage();
     467#endif
    442468}
    443469
  • c/src/libmisc/assoc/assoc.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.c     1.6 - 95/10/25
    3  *
    4  *
    52 * assoc.c
    63 *      rtems assoc routines
  • c/src/libmisc/assoc/assoc.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.h     1.4 - 95/10/25
    3  *     
    42 *
    53 *  Rtems associativity routines.  Mainly used to convert a value from
  • c/src/libmisc/error/error.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)error.c     1.6 - 95/12/12
    3  *     
    4  *
    52 *  report errors and panics to RTEMS' stderr.
    63 *  Currently just used by RTEMS monitor.
  • c/src/libmisc/error/error.h

    r5a36154a r8389628  
    1 
    21/*
    3  *      @(#)error.h     1.3 - 95/10/25
    4  *     
    5  *
    62 *  Defines and externs for rtems error reporting
    73 *
     
    2521const char *rtems_status_text(rtems_status_code);
    2622int   rtems_error(int error_code, const char *printf_format, ...);
     23#ifdef __GNUC__
     24void  rtems_panic(const char *printf_format, ...)
     25                                         __attribute__ ((__noreturn__));
     26#else
    2727void  rtems_panic(const char *printf_format, ...);
     28#endif
    2829
    2930extern int rtems_panic_in_progress;
  • c/src/libmisc/monitor/mon-command.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)command.c   1.5 - 95/08/02
    3  *     
    4  *
    52 * Command parsing routines for RTEMS monitor
    63 *
  • c/src/libmisc/monitor/mon-config.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)config.c    1.5 - 95/08/02
    3  *     
    4  *
    52 * RTEMS Config display support
    63 *
  • c/src/libmisc/monitor/mon-dname.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)dname.c     1.5 - 96/01/03
    3  *     
    4  *
    52 * RTEMS monitor driver names support.
    63 *
  • c/src/libmisc/monitor/mon-driver.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)driver.c    1.4 - 95/08/02
    3  *     
    4  *
    52 * RTEMS monitor IO (device drivers) support
    63 *
  • c/src/libmisc/monitor/mon-extension.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)extension.c 1.6 - 95/09/25
    3  *     
    4  *
    52 * RTEMS Monitor extension support
    63 *
  • c/src/libmisc/monitor/mon-itask.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)itask.c     1.6 - 96/01/03
    3  *     
    4  *
    5  *  RTEMS Monitor init task support
     2 * RTEMS Monitor init task support
    63 *
    74 *  $Id$
  • c/src/libmisc/monitor/mon-manager.c

    r5a36154a r8389628  
    11/*
    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.
    74 *
    85 *  $Id$
  • c/src/libmisc/monitor/mon-monitor.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)monitor.c   1.23 - 96/01/03
    3  *     
    4  *
    5  *
    62 * RTEMS monitor main body
    73 *     
     
    1915 *      remote request/response stuff should be cleaned up
    2016 *         maybe we can use real rpc??
    21  *      'info' commadn to print out:
     17 *      'info' command to print out:
    2218 *           interrupt stack location, direction and size
    2319 *           floating point config stuff
     
    263259}
    264260
     261void
     262rtems_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}
    265273
    266274void
     
    304312
    305313void
    306 rtems_monitor_debugger_cmd(
    307     int        argc,
    308     char     **argv,
    309     unsigned32 command_arg,
    310     boolean    verbose
    311 )
    312 {
    313 #ifdef CPU_INVOKE_DEBUGGER
    314     CPU_INVOKE_DEBUGGER;
    315 #endif
    316 }
    317 
    318 void
    319314rtems_monitor_node_cmd(
    320315    int     argc,
     
    341336    }
    342337
    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;
    345342}
    346343
     
    384381        return;
    385382
    386 #ifdef SIMHPPA
    387     fp = fdopen(8, "r");                /* don't ask; don't tell */
    388 #else
    389383    fp = fopen("symbols", "r");
    390 #endif
    391384   
    392385    if (fp == 0)
  • c/src/libmisc/monitor/mon-mpci.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)mpci.c      1.6 - 95/08/02
    3  *     
    4  *
    52 * RTEMS MPCI Config display support
    63 *
  • c/src/libmisc/monitor/mon-object.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)object.c    1.9 - 96/01/03
    3  *     
    4  *
    52 * RTEMS Monitor "object" support.
    63 *
     
    342339        for (arg=1; argv[arg]; arg++)
    343340        {
    344             id = (rtems_id) strtoul(argv[arg], 0, 0);
     341            id = (rtems_id) strtoul(argv[arg], 0, 16);
    345342            id = rtems_monitor_id_fixup(id, default_node, type);
    346343            type = (rtems_monitor_object_type_t) rtems_get_class(id);
  • c/src/libmisc/monitor/mon-prmisc.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)prmisc.c    1.9 - 95/08/02
    3  *     
    4  *
    52 * Print misc stuff for the monitor dump routines
    63 * Each routine returns the number of characters it output.
  • c/src/libmisc/monitor/mon-queue.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)queue.c     1.5 - 95/07/31
    3  *     
    42 *  $Id$
    53 */
  • c/src/libmisc/monitor/mon-server.c

    r5a36154a r8389628  
    11/*
    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
    63 *             running on other nodes)
    74 *
  • c/src/libmisc/monitor/mon-symbols.c

    r5a36154a r8389628  
    1 /*
    2  *      @(#)symbols.c   1.10 - 95/08/02
    3  *     
    4  *  $Id$
    5  */
    6 
    7 /* #define qsort _quicksort */
    8 
    91/*
    102 *  File:       symbols.c
     
    168 *
    179 *  TODO:
     10 *
     11 *  $Id$
    1812 */
    1913
     
    5145            (void) free(table->addresses);
    5246        table->addresses = 0;
    53 
    54         if (table->symbols)
    55             (void) free(table->symbols);
    56         table->symbols = 0;
    57 
    5847        p = table->string_buffer_head;
    5948        while (p)
     
    9483        if (table->addresses == 0)        /* blew it; lost orig */
    9584            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 
    10185        table->size = newsize;
    10286    }
     
    130114
    131115    table->strings_next += symbol_length;
    132 
    133     table->symbols[table->next] = *sp;
    134 
    135116    table->sorted = 0;
    136117    table->next++;
     
    148129 */
    149130
    150 int
     131static int
    151132rtems_symbol_compare(const void *e1,
    152133                     const void *e2)
     
    163144}
    164145
    165 /*
    166  * Qsort entry point for compare by string name (case independent)
    167  */
    168 
    169 int
    170 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 
    180146
    181147/*
     
    183149 */
    184150
    185 void
     151static void
    186152rtems_symbol_sort(rtems_symbol_table_t *table)
    187153{
    188 #ifdef RTEMS_ON_SIMULATOR
    189     printf("Sorting symbols ... ");         /* so slow we need a msg */
    190     fflush(stdout);
    191 #endif
    192 
    193154    qsort((void *) table->addresses, (size_t) table->next,
    194155          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_SIMULATOR
    200     /* so slow we need a msg */
    201     printf("done\n");
    202 #endif
    203 
    204156    table->sorted = 1;
    205157}
     158
    206159
    207160/*
     
    263216
    264217/*
     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 */
     228const rtems_symbol_t *
     229rtems_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/*
    265265 * Search the symbol table by string name (case independent)
    266266 */
     
    272272  )
    273273{
    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    {
    278279        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;
    301291}
    302292
     
    326316
    327317    *next_id += 1;
    328     return (void *) (table->symbols + n);
     318    return (void *) (table->addresses + n);
    329319
    330320failed:
     
    439429        rtems_symbol_sort(table);
    440430
    441     for (s = 0, sp = table->symbols; s < table->next; s++, sp++)
     431    for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
    442432    {
    443433        rtems_monitor_symbol_t canonical_symbol;
  • c/src/libmisc/monitor/mon-task.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)task.c      1.9 - 95/08/01
    3  *     
    4  *
    52 * RTEMS Monitor task support
    63 *
  • c/src/libmisc/monitor/monitor.h

    r5a36154a r8389628  
    1 /*
    2  *      @(#)monitor.h   1.21 - 96/01/03
    3  *     
    4  *
    5  *  monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp
    6  */
    7 
    81/*
    92 *  File:       monitor.h
     
    136 *
    147 *  TODO:
     8 *
     9 *  $Id$
    1510 */
    1611
     
    2621
    2722/*
    28  * XXX this should be in rtems proper when type becomes part of id
     23 * Monitor types are derived from rtems object classes
    2924 */
    3025
     
    307302
    308303typedef struct {
    309     rtems_monitor_object_type_t                 type;
     304    rtems_monitor_object_type_t         type;
    310305    void                               *object_information;
    311306    int                                 size;   /* of canonical object */
     
    420415rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
    421416rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
     417const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
    422418rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
    423419void   *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
  • c/src/libmisc/monitor/symbols.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)symbols.h   1.3 - 95/06/09
    3  *     
    4  *
    52 *  RTEMS monitor symbol table functions
    63 *
     
    4946
    5047    /*
    51      * String list -- sorted by name (when we do a lookup)
    52      * This is a duplicate of the info in table->addresses, but it's
    53      * pretty small, so I don't worry about it.
    54      */
    55 
    56     rtems_symbol_t  *symbols;           /* symbol array */
    57 
    58     /*
    5948     * String pool, unsorted, a list of blocks of string data
    6049     */
  • c/src/libmisc/stackchk/check.c

    r5a36154a r8389628  
    2020
    2121#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
    2235
    2336extern rtems_configuration_table BSP_Configuration;
     
    5063  Stack_check_Begin_extension,      /* task_begin   */
    5164  0,                                /* task_exitted */
     65#ifdef DONT_USE_FATAL_EXTENSION
     66  0,                                /* fatal        */
     67#else
    5268  Stack_check_Fatal_extension,      /* fatal        */
     69#endif
    5370};
    5471
     
    167184
    168185  Stack_check_Blown_task = 0;
    169 
    170 #ifdef STACK_CHECKER_REPORT_USAGE
    171   atexit( Stack_check_Dump_usage );
    172 #endif
    173186
    174187  /*
     
    218231  }
    219232
     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
    220244  stack_check_initialized = 1;
    221245}
     
    432456 */
    433457
    434 void Stack_check_Fatal_extension( 
     458void Stack_check_Fatal_extension(
    435459    Internal_errors_Source  source,
    436460    boolean                 is_internal,
     
    438462)
    439463{
     464#ifndef DONT_USE_FATAL_EXTENSION
    440465    if (status == 0)
    441466        Stack_check_Dump_usage();
     467#endif
    442468}
    443469
  • c/src/tests/sptests/spfatal/fatal.c

    r5a36154a r8389628  
    5858
    5959rtems_extension Fatal_extension(
    60   rtems_unsigned32 error
     60  rtems_unsigned32 error,
     61  boolean          is_internal
    6162)
    6263{
  • c/src/tests/sptests/spfatal/system.h

    r5a36154a r8389628  
    2929 
    3030rtems_extension Fatal_extension(
    31   rtems_unsigned32 error
     31  rtems_unsigned32 error,
     32  boolean          is_internal
    3233);
    3334 
  • c/src/tests/tmtests/tm21/task1.c

    r5a36154a r8389628  
    7171    status = rtems_message_queue_create(
    7272      index,
    73       1,
     73      OPERATION_COUNT,
    7474      16,
    7575      RTEMS_DEFAULT_ATTRIBUTES,
  • c/src/tests/tools/generic/difftest

    r5a36154a r8389628  
    22#
    33#  Check test results against official output in the src tree
     4#
    45#  $Id$
    56#
     
    6566#
    6667
    67 cd $RTEMS_HOME/tests/$logdir ||
    68   fatal "No log directory: $RTEMS_HOME/tests/$logdir"
     68cd $RTEMS_HOME/tests/$logdir || fatal "No log directory: $RTEMS_HOME/tests/$logdir"
    6969
    7070tests="$args"
  • cpukit/libcsupport/include/rtems/assoc.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.h     1.4 - 95/10/25
    3  *     
    42 *
    53 *  Rtems associativity routines.  Mainly used to convert a value from
  • cpukit/libcsupport/include/rtems/error.h

    r5a36154a r8389628  
    1 
    21/*
    3  *      @(#)error.h     1.3 - 95/10/25
    4  *     
    5  *
    62 *  Defines and externs for rtems error reporting
    73 *
     
    2521const char *rtems_status_text(rtems_status_code);
    2622int   rtems_error(int error_code, const char *printf_format, ...);
     23#ifdef __GNUC__
     24void  rtems_panic(const char *printf_format, ...)
     25                                         __attribute__ ((__noreturn__));
     26#else
    2727void  rtems_panic(const char *printf_format, ...);
     28#endif
    2829
    2930extern int rtems_panic_in_progress;
  • cpukit/libcsupport/src/assoc.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)assoc.c     1.6 - 95/10/25
    3  *
    4  *
    52 * assoc.c
    63 *      rtems assoc routines
  • cpukit/libcsupport/src/error.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)error.c     1.6 - 95/12/12
    3  *     
    4  *
    52 *  report errors and panics to RTEMS' stderr.
    63 *  Currently just used by RTEMS monitor.
  • cpukit/libmisc/monitor/mon-command.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)command.c   1.5 - 95/08/02
    3  *     
    4  *
    52 * Command parsing routines for RTEMS monitor
    63 *
  • cpukit/libmisc/monitor/mon-config.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)config.c    1.5 - 95/08/02
    3  *     
    4  *
    52 * RTEMS Config display support
    63 *
  • cpukit/libmisc/monitor/mon-dname.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)dname.c     1.5 - 96/01/03
    3  *     
    4  *
    52 * RTEMS monitor driver names support.
    63 *
  • cpukit/libmisc/monitor/mon-driver.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)driver.c    1.4 - 95/08/02
    3  *     
    4  *
    52 * RTEMS monitor IO (device drivers) support
    63 *
  • cpukit/libmisc/monitor/mon-extension.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)extension.c 1.6 - 95/09/25
    3  *     
    4  *
    52 * RTEMS Monitor extension support
    63 *
  • cpukit/libmisc/monitor/mon-itask.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)itask.c     1.6 - 96/01/03
    3  *     
    4  *
    5  *  RTEMS Monitor init task support
     2 * RTEMS Monitor init task support
    63 *
    74 *  $Id$
  • cpukit/libmisc/monitor/mon-manager.c

    r5a36154a r8389628  
    11/*
    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.
    74 *
    85 *  $Id$
  • cpukit/libmisc/monitor/mon-monitor.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)monitor.c   1.23 - 96/01/03
    3  *     
    4  *
    5  *
    62 * RTEMS monitor main body
    73 *     
     
    1915 *      remote request/response stuff should be cleaned up
    2016 *         maybe we can use real rpc??
    21  *      'info' commadn to print out:
     17 *      'info' command to print out:
    2218 *           interrupt stack location, direction and size
    2319 *           floating point config stuff
     
    263259}
    264260
     261void
     262rtems_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}
    265273
    266274void
     
    304312
    305313void
    306 rtems_monitor_debugger_cmd(
    307     int        argc,
    308     char     **argv,
    309     unsigned32 command_arg,
    310     boolean    verbose
    311 )
    312 {
    313 #ifdef CPU_INVOKE_DEBUGGER
    314     CPU_INVOKE_DEBUGGER;
    315 #endif
    316 }
    317 
    318 void
    319314rtems_monitor_node_cmd(
    320315    int     argc,
     
    341336    }
    342337
    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;
    345342}
    346343
     
    384381        return;
    385382
    386 #ifdef SIMHPPA
    387     fp = fdopen(8, "r");                /* don't ask; don't tell */
    388 #else
    389383    fp = fopen("symbols", "r");
    390 #endif
    391384   
    392385    if (fp == 0)
  • cpukit/libmisc/monitor/mon-mpci.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)mpci.c      1.6 - 95/08/02
    3  *     
    4  *
    52 * RTEMS MPCI Config display support
    63 *
  • cpukit/libmisc/monitor/mon-object.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)object.c    1.9 - 96/01/03
    3  *     
    4  *
    52 * RTEMS Monitor "object" support.
    63 *
     
    342339        for (arg=1; argv[arg]; arg++)
    343340        {
    344             id = (rtems_id) strtoul(argv[arg], 0, 0);
     341            id = (rtems_id) strtoul(argv[arg], 0, 16);
    345342            id = rtems_monitor_id_fixup(id, default_node, type);
    346343            type = (rtems_monitor_object_type_t) rtems_get_class(id);
  • cpukit/libmisc/monitor/mon-prmisc.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)prmisc.c    1.9 - 95/08/02
    3  *     
    4  *
    52 * Print misc stuff for the monitor dump routines
    63 * Each routine returns the number of characters it output.
  • cpukit/libmisc/monitor/mon-queue.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)queue.c     1.5 - 95/07/31
    3  *     
    42 *  $Id$
    53 */
  • cpukit/libmisc/monitor/mon-server.c

    r5a36154a r8389628  
    11/*
    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
    63 *             running on other nodes)
    74 *
  • cpukit/libmisc/monitor/mon-symbols.c

    r5a36154a r8389628  
    1 /*
    2  *      @(#)symbols.c   1.10 - 95/08/02
    3  *     
    4  *  $Id$
    5  */
    6 
    7 /* #define qsort _quicksort */
    8 
    91/*
    102 *  File:       symbols.c
     
    168 *
    179 *  TODO:
     10 *
     11 *  $Id$
    1812 */
    1913
     
    5145            (void) free(table->addresses);
    5246        table->addresses = 0;
    53 
    54         if (table->symbols)
    55             (void) free(table->symbols);
    56         table->symbols = 0;
    57 
    5847        p = table->string_buffer_head;
    5948        while (p)
     
    9483        if (table->addresses == 0)        /* blew it; lost orig */
    9584            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 
    10185        table->size = newsize;
    10286    }
     
    130114
    131115    table->strings_next += symbol_length;
    132 
    133     table->symbols[table->next] = *sp;
    134 
    135116    table->sorted = 0;
    136117    table->next++;
     
    148129 */
    149130
    150 int
     131static int
    151132rtems_symbol_compare(const void *e1,
    152133                     const void *e2)
     
    163144}
    164145
    165 /*
    166  * Qsort entry point for compare by string name (case independent)
    167  */
    168 
    169 int
    170 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 
    180146
    181147/*
     
    183149 */
    184150
    185 void
     151static void
    186152rtems_symbol_sort(rtems_symbol_table_t *table)
    187153{
    188 #ifdef RTEMS_ON_SIMULATOR
    189     printf("Sorting symbols ... ");         /* so slow we need a msg */
    190     fflush(stdout);
    191 #endif
    192 
    193154    qsort((void *) table->addresses, (size_t) table->next,
    194155          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_SIMULATOR
    200     /* so slow we need a msg */
    201     printf("done\n");
    202 #endif
    203 
    204156    table->sorted = 1;
    205157}
     158
    206159
    207160/*
     
    263216
    264217/*
     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 */
     228const rtems_symbol_t *
     229rtems_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/*
    265265 * Search the symbol table by string name (case independent)
    266266 */
     
    272272  )
    273273{
    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    {
    278279        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;
    301291}
    302292
     
    326316
    327317    *next_id += 1;
    328     return (void *) (table->symbols + n);
     318    return (void *) (table->addresses + n);
    329319
    330320failed:
     
    439429        rtems_symbol_sort(table);
    440430
    441     for (s = 0, sp = table->symbols; s < table->next; s++, sp++)
     431    for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
    442432    {
    443433        rtems_monitor_symbol_t canonical_symbol;
  • cpukit/libmisc/monitor/mon-task.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)task.c      1.9 - 95/08/01
    3  *     
    4  *
    52 * RTEMS Monitor task support
    63 *
  • cpukit/libmisc/monitor/monitor.h

    r5a36154a r8389628  
    1 /*
    2  *      @(#)monitor.h   1.21 - 96/01/03
    3  *     
    4  *
    5  *  monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp
    6  */
    7 
    81/*
    92 *  File:       monitor.h
     
    136 *
    147 *  TODO:
     8 *
     9 *  $Id$
    1510 */
    1611
     
    2621
    2722/*
    28  * XXX this should be in rtems proper when type becomes part of id
     23 * Monitor types are derived from rtems object classes
    2924 */
    3025
     
    307302
    308303typedef struct {
    309     rtems_monitor_object_type_t                 type;
     304    rtems_monitor_object_type_t         type;
    310305    void                               *object_information;
    311306    int                                 size;   /* of canonical object */
     
    420415rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
    421416rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
     417const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
    422418rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
    423419void   *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
  • cpukit/libmisc/monitor/symbols.h

    r5a36154a r8389628  
    11/*
    2  *      @(#)symbols.h   1.3 - 95/06/09
    3  *     
    4  *
    52 *  RTEMS monitor symbol table functions
    63 *
     
    4946
    5047    /*
    51      * String list -- sorted by name (when we do a lookup)
    52      * This is a duplicate of the info in table->addresses, but it's
    53      * pretty small, so I don't worry about it.
    54      */
    55 
    56     rtems_symbol_t  *symbols;           /* symbol array */
    57 
    58     /*
    5948     * String pool, unsorted, a list of blocks of string data
    6049     */
  • cpukit/libmisc/stackchk/check.c

    r5a36154a r8389628  
    2020
    2121#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
    2235
    2336extern rtems_configuration_table BSP_Configuration;
     
    5063  Stack_check_Begin_extension,      /* task_begin   */
    5164  0,                                /* task_exitted */
     65#ifdef DONT_USE_FATAL_EXTENSION
     66  0,                                /* fatal        */
     67#else
    5268  Stack_check_Fatal_extension,      /* fatal        */
     69#endif
    5370};
    5471
     
    167184
    168185  Stack_check_Blown_task = 0;
    169 
    170 #ifdef STACK_CHECKER_REPORT_USAGE
    171   atexit( Stack_check_Dump_usage );
    172 #endif
    173186
    174187  /*
     
    218231  }
    219232
     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
    220244  stack_check_initialized = 1;
    221245}
     
    432456 */
    433457
    434 void Stack_check_Fatal_extension( 
     458void Stack_check_Fatal_extension(
    435459    Internal_errors_Source  source,
    436460    boolean                 is_internal,
     
    438462)
    439463{
     464#ifndef DONT_USE_FATAL_EXTENSION
    440465    if (status == 0)
    441466        Stack_check_Dump_usage();
     467#endif
    442468}
    443469
  • testsuites/sptests/spfatal/fatal.c

    r5a36154a r8389628  
    5858
    5959rtems_extension Fatal_extension(
    60   rtems_unsigned32 error
     60  rtems_unsigned32 error,
     61  boolean          is_internal
    6162)
    6263{
  • testsuites/sptests/spfatal/system.h

    r5a36154a r8389628  
    2929 
    3030rtems_extension Fatal_extension(
    31   rtems_unsigned32 error
     31  rtems_unsigned32 error,
     32  boolean          is_internal
    3233);
    3334 
  • testsuites/tmtests/tm21/task1.c

    r5a36154a r8389628  
    7171    status = rtems_message_queue_create(
    7272      index,
    73       1,
     73      OPERATION_COUNT,
    7474      16,
    7575      RTEMS_DEFAULT_ATTRIBUTES,
  • tools/cpu/hppa1.1/genoffsets.c

    r5a36154a r8389628  
    11/*
    2  *      @(#)genoffsets.c        1.7 - 95/09/25
    3  *     
    4  *
    52 *  genoffsets.c
    63 *
    74 *  This file generates the offsets.h for the HP PA-RISC port of RTEMS.
    85 *
    9  *  NOTE:  It only prints the offset for structures actually used 
     6 *  NOTE:  It only prints the offset for structures actually used
    107 *         by the assembly code.
    118 *
     
    1815 *
    1916 *  $Id$
    20  *
    2117 */
    2218
     
    7167
    7268#define PRINT_SIZE( STRING, item ) \
    73   printf( "#define\t%s\t%d\t\t/* 0x%x */\n", \
     69  printf( "#ifdef ASM\n#define\t%s\t%d\t\t/* 0x%x */\n#endif\n", \
    7470          STRING, \
    7571          sizeof(item), \
     
    146142  PRINT_COMMENT("Context_Control_fp information");
    147143
     144  PRINT_IT( "FR0_OFFSET", Context_Control_fp *, fr0 );
     145  PRINT_IT( "FR1_OFFSET", Context_Control_fp *, fr1 );
     146  PRINT_IT( "FR2_OFFSET", Context_Control_fp *, fr2 );
     147  PRINT_IT( "FR3_OFFSET", Context_Control_fp *, fr3 );
     148  PRINT_IT( "FR4_OFFSET", Context_Control_fp *, fr4 );
     149  PRINT_IT( "FR5_OFFSET", Context_Control_fp *, fr5 );
     150  PRINT_IT( "FR6_OFFSET", Context_Control_fp *, fr6 );
     151  PRINT_IT( "FR7_OFFSET", Context_Control_fp *, fr7 );
     152  PRINT_IT( "FR8_OFFSET", Context_Control_fp *, fr8 );
     153  PRINT_IT( "FR9_OFFSET", Context_Control_fp *, fr9 );
     154  PRINT_IT( "FR10_OFFSET", Context_Control_fp *, fr10 );
     155  PRINT_IT( "FR11_OFFSET", Context_Control_fp *, fr11 );
     156  PRINT_IT( "FR12_OFFSET", Context_Control_fp *, fr12 );
     157  PRINT_IT( "FR13_OFFSET", Context_Control_fp *, fr13 );
     158  PRINT_IT( "FR14_OFFSET", Context_Control_fp *, fr14 );
     159  PRINT_IT( "FR15_OFFSET", Context_Control_fp *, fr15 );
     160  PRINT_IT( "FR16_OFFSET", Context_Control_fp *, fr16 );
     161  PRINT_IT( "FR17_OFFSET", Context_Control_fp *, fr17 );
     162  PRINT_IT( "FR18_OFFSET", Context_Control_fp *, fr18 );
     163  PRINT_IT( "FR19_OFFSET", Context_Control_fp *, fr19 );
     164  PRINT_IT( "FR20_OFFSET", Context_Control_fp *, fr20 );
     165  PRINT_IT( "FR21_OFFSET", Context_Control_fp *, fr21 );
     166  PRINT_IT( "FR22_OFFSET", Context_Control_fp *, fr22 );
     167  PRINT_IT( "FR23_OFFSET", Context_Control_fp *, fr23 );
     168  PRINT_IT( "FR24_OFFSET", Context_Control_fp *, fr24 );
     169  PRINT_IT( "FR25_OFFSET", Context_Control_fp *, fr25 );
     170  PRINT_IT( "FR26_OFFSET", Context_Control_fp *, fr26 );
     171  PRINT_IT( "FR27_OFFSET", Context_Control_fp *, fr27 );
     172  PRINT_IT( "FR28_OFFSET", Context_Control_fp *, fr28 );
     173  PRINT_IT( "FR29_OFFSET", Context_Control_fp *, fr29 );
     174  PRINT_IT( "FR30_OFFSET", Context_Control_fp *, fr30 );
     175  PRINT_IT( "FR31_OFFSET", Context_Control_fp *, fr31 );
     176
    148177  PRINT_SIZE("CPU_CONTEXT_FP_SIZE", Context_Control_fp);
    149178
Note: See TracChangeset for help on using the changeset viewer.