Changeset 11290355 in rtems


Ignore:
Timestamp:
Sep 29, 1995, 5:19:16 PM (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
1ceface
Parents:
1039ae4
Message:

all targets compile .. tony's patches in place

Files:
70 edited

Legend:

Unmodified
Added
Removed
  • c/build-tools/src/unhex.c

    r1039ae4 r11290355  
    8787#define ERR_MASK   (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
    8888
    89 #define stol(p) strtol(p, (char **) NULL, 0)
     89#define stol(p) strtoul(p, (char **) NULL, 0)
    9090
    9191int   unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
  • c/build-tools/unhex.c

    r1039ae4 r11290355  
    8787#define ERR_MASK   (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
    8888
    89 #define stol(p) strtol(p, (char **) NULL, 0)
     89#define stol(p) strtoul(p, (char **) NULL, 0)
    9090
    9191int   unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
  • c/src/exec/libcsupport/src/error.c

    r1039ae4 r11290355  
    4040 *        if ((fd = open(pathname, O_RDNLY)) < 0)
    4141 *        {
    42  *            rtems_error(FLOSS_ERROR_ERRNO, "open of '%s' failed", pathname);
     42 *            rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
    4343 *            goto failed;
    4444 *        }
  • c/src/exec/libcsupport/src/malloc.c

    r1039ae4 r11290355  
    1515
    1616#include <rtems.h>
    17 #ifdef RTEMS_LIBC
    18 #include <memory.h>
    19 #endif
    2017#include "libcsupport.h"
    2118#ifdef RTEMS_NEWLIB
     
    3027#include <string.h>
    3128
    32 /*
    33  *  XXX: Do we really need to duplicate these? It appears that they
    34  *       only cause typing problems.
    35  */
    36 
    37 #if 0
    38 void *malloc(size_t);
    39 void *calloc(size_t, size_t);
    40 void *realloc(void *, size_t);
    41 void free(void *);
    42 void *sbrk(size_t);
    43 #endif
    44 
    4529rtems_id RTEMS_Malloc_Heap;
    4630size_t RTEMS_Malloc_Sbrk_amount;
     31
     32#ifdef RTEMS_DEBUG
     33#define MALLOC_STATS
     34#endif
     35
     36#ifdef MALLOC_STATS
     37#define MSBUMP(f,n)    malloc_stats.f += (n)
     38
     39struct {
     40    unsigned32  space_available;             /* current size of malloc area */
     41    unsigned32  malloc_calls;                /* # calls to malloc */
     42    unsigned32  free_calls;
     43    unsigned32  realloc_calls;
     44    unsigned32  calloc_calls;
     45    unsigned32  max_depth;                   /* most ever malloc'd at 1 time */
     46    unsigned64  lifetime_allocated;
     47    unsigned64  lifetime_freed;
     48} malloc_stats;
     49
     50#else                   /* No malloc_stats */
     51#define MSBUMP(f,n)
     52#endif
    4753
    4854void RTEMS_Malloc_Initialize(
     
    7884      u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    7985
    80       /*
    81        *  Adjust the length by whatever we aligned by
    82        */
     86       /*
     87        * adjust the length by whatever we aligned by
     88        */
    8389
    8490      length -= u32_address - old_address;
     
    98104    starting_address,
    99105    length,
    100     8,                     /* XXX : use CPU dependent RTEMS constant */
     106    CPU_ALIGNMENT,
    101107    RTEMS_DEFAULT_ATTRIBUTES,
    102108    &RTEMS_Malloc_Heap
     
    104110  if ( status != RTEMS_SUCCESSFUL )
    105111    rtems_fatal_error_occurred( status );
     112
     113#ifdef MALLOC_STATS
     114  /* zero all the stats */
     115  (void) memset(&malloc_stats, 0, sizeof(malloc_stats));
     116#endif
     117 
     118  MSBUMP(space_available, length);
    106119}
    107120
     
    115128  rtems_unsigned32   sbrk_amount;
    116129  rtems_status_code  status;
     130
     131  MSBUMP(malloc_calls, 1);
    117132
    118133  if ( !size )
     
    150165      return (void *) 0;
    151166
    152     /*
    153     fprintf(stderr, "Extended the C heap starting at 0x%x for %d bytes\n",
    154         (unsigned32)starting_address, the_size);
    155      */
    156 
    157167    status = rtems_region_extend(
    158168      RTEMS_Malloc_Heap,
     
    162172    if ( status != RTEMS_SUCCESSFUL ) {
    163173      sbrk(-the_size);
    164       return(FALSE);
    165174      errno = ENOMEM;
    166175      return (void *) 0;
    167176    }
     177   
     178    MSBUMP(space_available, the_size);
     179
    168180    status = rtems_region_get_segment(
    169181      RTEMS_Malloc_Heap,
     
    179191  }
    180192
     193#ifdef MALLOC_STATS
     194  if (return_this)
     195  {
     196      unsigned32 current_depth;
     197      MSBUMP(lifetime_allocated, size);
     198      current_depth = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
     199      if (current_depth > malloc_stats.max_depth)
     200          malloc_stats.max_depth = current_depth;
     201  }
     202#endif
     203 
    181204  return return_this;
    182205}
     
    189212  register char *cptr;
    190213  int length;
     214
     215  MSBUMP(calloc_calls, 1);
    191216
    192217  length = nelem * elsize;
     
    207232  char *new_area;
    208233
     234  MSBUMP(realloc_calls, 1);
     235
    209236  if ( !ptr )
    210237    return malloc( size );
    211238
    212239  if ( !size ) {
     240    free( ptr );
     241    return (void *) 0;
     242  }
     243
     244  new_area = malloc( size );
     245  if ( !new_area ) {
    213246    free( ptr );
    214247    return (void *) 0;
     
    221254  }
    222255
    223   new_area = malloc( size );
    224   if ( !new_area ) {
    225     free( ptr );
    226     return (void *) 0;
    227   }
    228 
    229256  memcpy( new_area, ptr, (size < old_size) ? size : old_size );
    230257  free( ptr );
     
    240267  rtems_status_code status;
    241268
     269  MSBUMP(free_calls, 1);
     270
    242271  if ( !ptr )
    243272    return;
    244273
     274#ifdef MALLOC_STATS
     275  {
     276      unsigned32        size;
     277      status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &size );
     278      if ( status == RTEMS_SUCCESSFUL ) {
     279          MSBUMP(lifetime_freed, size);
     280      }
     281  }
     282#endif
     283 
    245284  status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
    246285  if ( status != RTEMS_SUCCESSFUL ) {
     
    250289}
    251290
     291#ifdef MALLOC_STATS
     292/*
     293 * Dump the malloc statistics
     294 * May be called via atexit()  (installable by our bsp) or
     295 * at any time by user
     296 */
     297
     298void malloc_dump(void)
     299{
     300    unsigned32 allocated = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
     301
     302    printf("Malloc stats\n");
     303    printf("  avail:%uk  allocated:%uk (%d%%) max:%uk (%d%%) lifetime:%Luk freed:%Luk\n",
     304           (unsigned int) malloc_stats.space_available / 1024,
     305           (unsigned int) allocated / 1024,
     306           /* avoid float! */
     307           (allocated * 100) / malloc_stats.space_available,
     308           (unsigned int) malloc_stats.max_depth / 1024,
     309           (malloc_stats.max_depth * 100) / malloc_stats.space_available,
     310           (unsigned long long) malloc_stats.lifetime_allocated / 1024,
     311           (unsigned long long) malloc_stats.lifetime_freed / 1024);
     312    printf("  Call counts:   malloc:%d   free:%d   realloc:%d   calloc:%d\n",
     313           malloc_stats.malloc_calls,
     314           malloc_stats.free_calls,
     315           malloc_stats.realloc_calls,
     316           malloc_stats.calloc_calls);
     317}       
     318#endif
     319
    252320/*
    253321 *  "Reentrant" versions of the above routines implemented above.
  • c/src/exec/score/cpu/hppa1.1/cpu.c

    r1039ae4 r11290355  
    1515 *      suitability of this software for any purpose.
    1616 *
    17  *  $Id$
     17 *  cpu.c,v 1.7 1995/09/19 14:49:35 joel Exp
    1818 */
    1919
    2020#include <rtems/system.h>
    21 #include <rtems/score/isr.h>
    22 #include <rtems/score/wkspace.h>
     21#include <rtems/fatal.h>
     22#include <rtems/core/isr.h>
     23#include <rtems/core/wkspace.h>
    2324
    2425void hppa_external_interrupt_initialize(void);
     
    102103
    103104    _CPU_Table = *cpu_table;
     105}
     106
     107/*PAGE
     108 *
     109 *  _CPU_ISR_Get_level
     110 */
     111 
     112unsigned32 _CPU_ISR_Get_level(void)
     113{
     114    int level;
     115    HPPA_ASM_SSM(0, level);     /* change no bits; just get copy */
     116    if (level & HPPA_PSW_I)
     117        return 1;
     118    return 0;
    104119}
    105120
  • c/src/exec/score/cpu/hppa1.1/cpu.h

    r1039ae4 r11290355  
    2121 *      This file is included by both C and assembler code ( -DASM )
    2222 *
    23  *  $Id$
     23 *  cpu.h,v 1.5 1995/09/11 19:24:10 joel Exp
    2424 */
    2525
     
    3131#endif
    3232
    33 #include <rtems/score/hppa.h>              /* pick up machine definitions */
     33#include <rtems/core/hppa.h>              /* pick up machine definitions */
    3434#ifndef ASM
    35 #include <rtems/score/hppatypes.h>
     35#include <rtems/core/hppatypes.h>
    3636#endif
    3737
     
    369369  }
    370370
     371/* return current level */
     372unsigned32 _CPU_ISR_Get_level( void );
     373
    371374/* end of ISR handler macros */
    372375
  • c/src/exec/score/cpu/hppa1.1/cpu_asm.s

    r1039ae4 r11290355  
    1 #       @(#)cpu_asm.S   1.6 - 95/05/16
     1#       @(#)cpu_asm.S   1.7 - 95/09/21
    22#       
    33#
     
    2525#      suitability of this software for any purpose.
    2626#
    27 $Id$
    28 #
    29 
    30 #include <rtems/score/hppa.h>
    31 #include <rtems/score/cpu_asm.h>
    32 #include <rtems/score/cpu.h>
    33 
    34 #include <rtems/score/offsets.h>
     27cpu_asm.S,v 1.5 1995/09/19 14:49:36 joel Exp
     28#
     29
     30#include <rtems/core/hppa.h>
     31#include <rtems/core/cpu_asm.h>
     32#include <rtems/core/cpu.h>
     33
     34#include <rtems/core/offsets.h>
    3535
    3636        .SPACE $PRIVATE$
  • c/src/exec/score/cpu/hppa1.1/hppa.h

    r1039ae4 r11290355  
    11/*
    2  *      @(#)hppa.h      1.9 - 95/06/28
     2 *      @(#)hppa.h      1.13 - 95/09/21
    33 *     
    44 *
     
    2525 *      This file is included by both C and assembler code ( -DASM )
    2626 *
    27  *  $Id$
     27 *  hppa.h,v 1.4 1995/09/19 14:49:37 joel Exp
    2828 */
    2929
     
    6565 */
    6666
    67 #if !defined(CPU_MODEL_NAME)
     67#if !defined(RTEMS_MODEL_NAME)
    6868
    6969#if defined(hppa7100)
    7070
    71 #define CPU_MODEL_NAME  "hppa 7100"
     71#define RTEMS_MODEL_NAME  "hppa 7100"
    7272
    7373#elif defined(hppa7200)
    7474
    75 #define CPU_MODEL_NAME  "hppa 7200"
     75#define RTEMS_MODEL_NAME  "hppa 7200"
    7676
    7777#else
    7878
    79 #error "Unsupported CPU Model"
     79#define RTEMS_MODEL_NAME  Unsupported CPU Model      /* cause an error on usage */
    8080
    8181#endif
    8282
    83 #endif /* !defined(CPU_MODEL_NAME) */
     83#endif /* !defined(RTEMS_MODEL_NAME) */
    8484         
    8585/*
     
    224224
    225225/*
     226 * TLB characteristics
     227 *
     228 * Flags and Access Control layout for using TLB protection insertion
     229 *
     230 *                      1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
     231 *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     232 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     233 * |?|?|T|D|B|type |PL1|Pl2|U|           access id               |?|
     234 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     235 *
     236 */
     237
     238/*
     239 * Access rights (type + PL1 + PL2)
     240 */
     241#define HPPA_PROT_R    0x00c00000   /* Read Only, no Write, no Execute */
     242#define HPPA_PROT_RW   0x01c00000   /* Read & Write Only, no Execute */
     243#define HPPA_PROT_RX   0x02c00000   /* Read & Execute Only, no Write */
     244#define HPPA_PROT_RWX  0x03c00000   /* Read, Write, Execute */
     245#define HPPA_PROT_X0   0x04c00000   /* Execute Only, Promote to Level 0 */
     246#define HPPA_PROT_X1   0x05c00000   /* Execute Only, Promote to Level 1 */
     247#define HPPA_PROT_X2   0x06c00000   /* Execute Only, Promote to Level 2 */
     248#define HPPA_PROT_X3   0x07c00000   /* Execute Only, Promote to Level 3 */
     249
     250
     251/*
    226252 * Inline macros for misc. interesting opcodes
    227253 */
  • c/src/exec/score/cpu/m68k/cpu_asm.s

    r1039ae4 r11290355  
    6060SYM (_CPU_Context_save_fp):
    6161#if ( M68K_HAS_FPU == 1 )
    62         moval    a7@(FPCONTEXT_ARG),a1   | a1 = &ptr to context area
    63         moval    a1@,a0                  | a0 = Save context area
     62        moval    a7@(FPCONTEXT_ARG),a1    | a1 = &ptr to context area
     63        moval    a1@,a0                   | a0 = Save context area
    6464        fsave    a0@-                     | save 68881/68882 state frame
    6565        tstb     a0@                      | check for a null frame
    66         beq      nosv                      | Yes, skip save of user model
    67         fmovem   fp0-fp7,a0@-           | save data registers (fp0-fp7)
    68         fmovem   fpc/fps/fpi,a0@-      | and save control registers
     66        beq      nosv                     | Yes, skip save of user model
     67        fmovem   fp0-fp7,a0@-             | save data registers (fp0-fp7)
     68        fmovem   fpc/fps/fpi,a0@-         | and save control registers
    6969        movl     #-1,a0@-                 | place not-null flag on stack
    70 nosv:   movl     a0,a1@                  | save pointer to saved context
     70nosv:   movl     a0,a1@                   | save pointer to saved context
    7171#endif
    7272        rts
     
    7676SYM (_CPU_Context_restore_fp):
    7777#if ( M68K_HAS_FPU == 1 )
    78         moval    a7@(FPCONTEXT_ARG),a1   | a1 = &ptr to context area
    79         moval    a1@,a0                  | a0 = address of saved context
     78        moval    a7@(FPCONTEXT_ARG),a1    | a1 = &ptr to context area
     79        moval    a1@,a0                   | a0 = address of saved context
    8080        tstb     a0@                      | Null context frame?
    81         beq      norst                     | Yes, skip fp restore
     81        beq      norst                    | Yes, skip fp restore
    8282        addql    #4,a0                    | throwaway non-null flag
    83         fmovem   a0@+,fpc/fps/fpi      | restore control registers
    84         fmovem   a0@+,fp0-fp7           | restore data regs (fp0-fp7)
     83        fmovem   a0@+,fpc/fps/fpi         | restore control registers
     84        fmovem   a0@+,fp0-fp7             | restore data regs (fp0-fp7)
    8585norst:  frestore a0@+                     | restore the fp state frame
    86         movl     a0,a1@                  | save pointer to saved context
     86        movl     a0,a1@                   | save pointer to saved context
    8787#endif
    8888        rts
     
    113113 *  permitted by the new interrupt level mask, and (2) when
    114114 *  the original context regains the cpu.
     115 *
     116 *  XXX: Code for switching to a software maintained interrupt stack is
     117 *       not in place.
    115118 */
    116119 
     
    134137        addql   #1,SYM (_Thread_Dispatch_disable_level) | disable multitasking
    135138        moveml  d0-d1/a0-a1,a7@-         | save d0-d1,a0-a1
     139
     140/*
     141 *  NOTE FOR CPUs WITHOUT HARDWARE INTERRUPT STACK:
     142 *
     143 *  After the interrupted codes registers have been saved, it is save
     144 *  to switch to the software maintained interrupt stack.
     145 */
    136146
    137147#if ( M68K_HAS_VBR == 0)
  • c/src/exec/score/cpu/unix/cpu.c

    r1039ae4 r11290355  
    174174{
    175175
    176 #if defined(hppa1_1) && defined(RTEMS_UNIXLIB)
     176#if defined(hppa1_1) && defined(RTEMS_UNIXLIB_SETJMP)
    177177    /*
    178178     * HACK - set the _SYSTEM_ID to 0x20c so that setjmp/longjmp
  • c/src/exec/score/headers/heap.h

    r1039ae4 r11290355  
    281281/*PAGE
    282282 *
    283  *  _Heap_User_Block_at
    284  *
    285  */
    286 
    287 STATIC INLINE Heap_Block *_Heap_User_Block_at(
     283 *  _Heap_User_block_at
     284 *
     285 */
     286
     287STATIC INLINE Heap_Block *_Heap_User_block_at(
    288288  void       *base
    289289);
  • c/src/exec/score/include/rtems/score/heap.h

    r1039ae4 r11290355  
    281281/*PAGE
    282282 *
    283  *  _Heap_User_Block_at
    284  *
    285  */
    286 
    287 STATIC INLINE Heap_Block *_Heap_User_Block_at(
     283 *  _Heap_User_block_at
     284 *
     285 */
     286
     287STATIC INLINE Heap_Block *_Heap_User_block_at(
    288288  void       *base
    289289);
  • c/src/exec/score/inline/heap.inl

    r1039ae4 r11290355  
    9595/*PAGE
    9696 *
    97  *  _Heap_User_Block_at
     97 *  _Heap_User_block_at
    9898 *
    9999 */
    100100 
    101 STATIC INLINE Heap_Block *_Heap_User_Block_at(
     101STATIC INLINE Heap_Block *_Heap_User_block_at(
    102102  void       *base
    103103)
  • c/src/exec/score/inline/rtems/score/heap.inl

    r1039ae4 r11290355  
    9595/*PAGE
    9696 *
    97  *  _Heap_User_Block_at
     97 *  _Heap_User_block_at
    9898 *
    9999 */
    100100 
    101 STATIC INLINE Heap_Block *_Heap_User_Block_at(
     101STATIC INLINE Heap_Block *_Heap_User_block_at(
    102102  void       *base
    103103)
  • c/src/exec/score/macros/heap.inl

    r1039ae4 r11290355  
    7171/*PAGE
    7272 *
    73  *  _Heap_User_Block_at
     73 *  _Heap_User_block_at
    7474 *
    7575 */
    7676 
    77 #define _Heap_User_Block_at( _base ) \
     77#define _Heap_User_block_at( _base ) \
    7878  _Heap_Block_at( \
    7979    (_base), \
  • c/src/exec/score/macros/rtems/score/heap.inl

    r1039ae4 r11290355  
    7171/*PAGE
    7272 *
    73  *  _Heap_User_Block_at
     73 *  _Heap_User_block_at
    7474 *
    7575 */
    7676 
    77 #define _Heap_User_Block_at( _base ) \
     77#define _Heap_User_block_at( _base ) \
    7878  _Heap_Block_at( \
    7979    (_base), \
  • c/src/exec/score/src/heap.c

    r1039ae4 r11290355  
    302302  unsigned32         the_size;
    303303
    304   the_block = _Heap_User_Block_at( starting_address );
     304  the_block = _Heap_User_block_at( starting_address );
    305305 
    306306  if ( !_Heap_Is_block_in( the_heap, the_block ) ||
     
    347347  unsigned32         the_size;
    348348
    349   the_block = _Heap_User_Block_at( starting_address );
     349  the_block = _Heap_User_block_at( starting_address );
    350350
    351351  if ( !_Heap_Is_block_in( the_heap, the_block ) ||
     
    431431  Heap_Block *next_block = 0;  /* avoid warnings */
    432432  int         notdone = 1;
     433  int         error = 0;
     434  int         passes = 0;
    433435
    434436  /*
     
    456458  if (the_block->back_flag != HEAP_DUMMY_FLAG) {
    457459    printf("PASS: %d  Back flag of 1st block isn't HEAP_DUMMY_FLAG\n", source);
     460    error = 1;
    458461  }
    459462
    460463  while (notdone) {
     464    passes++;
     465    if (error && (passes > 10))
     466        abort();
     467   
    461468    if (do_dump == TRUE) {
    462469      printf("PASS: %d  Block @ 0x%p   Back %d,   Front %d",
     
    478485      next_block = _Heap_Next_block(the_block);
    479486      if ( the_block->front_flag != next_block->back_flag ) {
     487        error = 1;
    480488        printf("PASS: %d  Front and back flags don't match\n", source);
    481489        printf("         Current Block:  Back - %d,  Front - %d",
     
    511519      the_block = next_block;
    512520  }
     521
     522  if (error)
     523      abort();
    513524}
  • c/src/exec/score/tools/hppa1.1/genoffsets.c

    r1039ae4 r11290355  
    11/*
    2  *      @(#)genoffsets.c        1.5 - 95/05/16
     2 *      @(#)genoffsets.c        1.7 - 95/09/25
    33 *     
    44 *
     
    8383  );
    8484
    85 #if defined(hpux) && defined(__hppa__)
     85#if defined(__hpux__) && defined(__hppa__)
    8686
    8787/*
  • c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h

    r1039ae4 r11290355  
    1414 */
    1515
    16 #ifndef __SIMHPPA_h
    17 #define __SIMHPPA_h
     16#ifndef __PXFL_BSP_h
     17#define __PXFL_BSP_h
    1818
    1919#ifdef __cplusplus
     
    2424#include <clockdrv.h>
    2525#include <rtems/ttydrv.h>
    26 #include <libcsupport.h>
    2726
    2827/*
  • c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c

    r1039ae4 r11290355  
    5353shm_config_table BSP_shm_cfgtbl;
    5454
    55 void Shm_Cause_interrupt_simhppa(
    56   rtems_unsigned32 node
    57 );
     55void Shm_Cause_interrupt_pxfl( rtems_unsigned32 node );
    5856
    5957void Shm_Get_configuration(
     
    6664   BSP_shm_cfgtbl.format       = SHM_BIG;
    6765
    68    BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt_simhppa;
     66   BSP_shm_cfgtbl.cause_intr   = Shm_Cause_interrupt_pxfl;
    6967
    7068#ifdef NEUTRAL_BIG
  • c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c

    r1039ae4 r11290355  
    1 /*  void Shm_Cause_interrupt_simhppa( node )
     1/*  void Shm_Cause_interrupt_pxfl( node )
    22 *
    33 *  This routine is the shared memory driver routine which
     
    2525#include <shm.h>
    2626
    27 void Shm_Cause_interrupt_simhppa(
     27void Shm_Cause_interrupt_pxfl(
    2828  rtems_unsigned32 node
    2929)
    3030{
    3131  Shm_Interrupt_information *intr;
    32   rtems_unsigned8  *u8;
    33   rtems_unsigned16 *u16;
    3432  rtems_unsigned32 *u32;
    3533  rtems_unsigned32  value;
     
    4139    case NO_INTERRUPT:
    4240       break;
    43     case BYTE:
    44       u8   = (rtems_unsigned8 *)intr->address;
    45       fprintf(
    46         stderr,
    47         "Shm_Cause_interrupt_simhppa: Writes of unsigned8 not supported!!!\n"
    48       );
    49       rtems_shutdown_executive( 0 );
    50       break;
    51     case WORD:
    52       u16   = (rtems_unsigned16 *)intr->address;
    53       fprintf(
    54         stderr,
    55         "Shm_Cause_interrupt_simhppa: Writes of unsigned8 not supported!!!\n"
    56       );
    57       rtems_shutdown_executive( 0 );
    58       break;
    5941    case LONG:
    6042      u32   = (rtems_unsigned32 *)intr->address;
    6143      HPPA_ASM_STWAS( value, 0, u32 );
    6244      break;
     45    default:
     46      fprintf( stderr, "Shm_Cause_interrupt_pxfl: Unsupported length!!!\n" );
     47      rtems_shutdown_executive( 0 );
     48      break;
    6349  }
    6450}
  • c/src/lib/libbsp/hppa1.1/simhppa/startup/setvec.c

    r1039ae4 r11290355  
    5656             (vector < (HPPA_INTERRUPT_BSP_BASE + HPPA_BSP_INTERRUPTS)))
    5757    {
    58         simhppa_interrupt_install(handler,
    59                                   vector - HPPA_INTERRUPT_BSP_BASE,
    60                                   (rtems_isr_entry *) &previous_isr);
     58        pxfl_interrupt_install(handler,
     59                               vector - HPPA_INTERRUPT_BSP_BASE,
     60                               (rtems_isr_entry *) &previous_isr);
    6161    }
    6262#endif
  • c/src/lib/libbsp/m68k/gen68302/startup/linkcmds

    r1039ae4 r11290355  
    2020
    2121m302 = 0xf7f000;
     22_VBR = 0x000000;                /* location of the VBR table (in RAM) */
    2223
    2324SECTIONS
  • c/src/lib/libbsp/shmdr/dump.c

    r1039ae4 r11290355  
    2020#include <rtems.h>
    2121#include <stdio.h>
    22 #include <libcsupport.h>
    2322
    2423#include "shm.h"
  • c/src/lib/libbsp/shmdr/fatal.c

    r1039ae4 r11290355  
    2323
    2424void MPCI_Fatal(
    25   rtems_unsigned32 error
     25  Internal_errors_Source  source,
     26  boolean                 is_internal,
     27  rtems_unsigned32        error
    2628)
    2729{
  • c/src/lib/libbsp/shmdr/getlq.c

    r1039ae4 r11290355  
    3434  tmp_ecb = NULL;
    3535  Shm_Lock( lq_cb );
     36
    3637    tmpfront = Shm_Convert(lq_cb->front);
    3738    if ( tmpfront != Shm_Locked_queue_End_of_list ) {
     
    4243      tmp_ecb->next = Shm_Locked_queue_Not_on_list;
    4344    }
     45
    4446  Shm_Unlock( lq_cb );
    4547  return( tmp_ecb );
  • c/src/lib/libbsp/shmdr/shm.h

    r1039ae4 r11290355  
    471471void           Init_env_pool();
    472472void           Shm_Print_statistics( void );
    473 void           MPCI_Fatal( rtems_unsigned32 );
     473void           MPCI_Fatal(
     474  Internal_errors_Source  source,
     475  boolean                 is_internal,
     476  rtems_unsigned32        error
     477 );
    474478rtems_task     Shm_Cause_interrupt( rtems_unsigned32 );
    475479void           Shm_Poll();
  • c/src/lib/libbsp/shmdr/shm_driver.h

    r1039ae4 r11290355  
    471471void           Init_env_pool();
    472472void           Shm_Print_statistics( void );
    473 void           MPCI_Fatal( rtems_unsigned32 );
     473void           MPCI_Fatal(
     474  Internal_errors_Source  source,
     475  boolean                 is_internal,
     476  rtems_unsigned32        error
     477 );
    474478rtems_task     Shm_Cause_interrupt( rtems_unsigned32 );
    475479void           Shm_Poll();
  • c/src/lib/libbsp/unix/posix/include/bsp.h

    r1039ae4 r11290355  
    2525#include <console.h>
    2626#include <iosupp.h>
    27 #include <libcsupport.h>
    2827
    2928/*
  • c/src/lib/libbsp/unix/posix/startup/bspstart.c

    r1039ae4 r11290355  
    196196    rtems_fatal_error_occurred('STIO');
    197197#endif
     198
     199#if defined(MALLOC_STATS)
     200  atexit(malloc_dump);
     201#endif
     202
    198203}
    199204
  • c/src/lib/libbsp/unix/posix/startup/setvec.c

    r1039ae4 r11290355  
    88 *    type    - 0 indicates raw hardware connect
    99 *              1 indicates RTEMS interrupt connect
    10  *
    11  *  NOTE 'type' is ignored on hppa; all interrupts are owned by RTEMS
    1210 *
    1311 *  RETURNS:
     
    2624
    2725#include <bsp.h>
    28 
    29 /*
    30  * Install an interrupt handler in the right place
    31  * given its vector number from cpu/hppa.h
    32  * There are 2 places an interrupt can be installed
    33  *      _ISR_Vector_table
    34  *      bsp interrupt      XXX: nyi
    35  *
    36  * We decide which based on the vector number
    37  */
    3826
    3927rtems_isr_entry
  • c/src/lib/libc/error.c

    r1039ae4 r11290355  
    4040 *        if ((fd = open(pathname, O_RDNLY)) < 0)
    4141 *        {
    42  *            rtems_error(FLOSS_ERROR_ERRNO, "open of '%s' failed", pathname);
     42 *            rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
    4343 *            goto failed;
    4444 *        }
  • c/src/lib/libc/malloc.c

    r1039ae4 r11290355  
    1515
    1616#include <rtems.h>
    17 #ifdef RTEMS_LIBC
    18 #include <memory.h>
    19 #endif
    2017#include "libcsupport.h"
    2118#ifdef RTEMS_NEWLIB
     
    3027#include <string.h>
    3128
    32 /*
    33  *  XXX: Do we really need to duplicate these? It appears that they
    34  *       only cause typing problems.
    35  */
    36 
    37 #if 0
    38 void *malloc(size_t);
    39 void *calloc(size_t, size_t);
    40 void *realloc(void *, size_t);
    41 void free(void *);
    42 void *sbrk(size_t);
    43 #endif
    44 
    4529rtems_id RTEMS_Malloc_Heap;
    4630size_t RTEMS_Malloc_Sbrk_amount;
     31
     32#ifdef RTEMS_DEBUG
     33#define MALLOC_STATS
     34#endif
     35
     36#ifdef MALLOC_STATS
     37#define MSBUMP(f,n)    malloc_stats.f += (n)
     38
     39struct {
     40    unsigned32  space_available;             /* current size of malloc area */
     41    unsigned32  malloc_calls;                /* # calls to malloc */
     42    unsigned32  free_calls;
     43    unsigned32  realloc_calls;
     44    unsigned32  calloc_calls;
     45    unsigned32  max_depth;                   /* most ever malloc'd at 1 time */
     46    unsigned64  lifetime_allocated;
     47    unsigned64  lifetime_freed;
     48} malloc_stats;
     49
     50#else                   /* No malloc_stats */
     51#define MSBUMP(f,n)
     52#endif
    4753
    4854void RTEMS_Malloc_Initialize(
     
    7884      u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    7985
    80       /*
    81        *  Adjust the length by whatever we aligned by
    82        */
     86       /*
     87        * adjust the length by whatever we aligned by
     88        */
    8389
    8490      length -= u32_address - old_address;
     
    98104    starting_address,
    99105    length,
    100     8,                     /* XXX : use CPU dependent RTEMS constant */
     106    CPU_ALIGNMENT,
    101107    RTEMS_DEFAULT_ATTRIBUTES,
    102108    &RTEMS_Malloc_Heap
     
    104110  if ( status != RTEMS_SUCCESSFUL )
    105111    rtems_fatal_error_occurred( status );
     112
     113#ifdef MALLOC_STATS
     114  /* zero all the stats */
     115  (void) memset(&malloc_stats, 0, sizeof(malloc_stats));
     116#endif
     117 
     118  MSBUMP(space_available, length);
    106119}
    107120
     
    115128  rtems_unsigned32   sbrk_amount;
    116129  rtems_status_code  status;
     130
     131  MSBUMP(malloc_calls, 1);
    117132
    118133  if ( !size )
     
    150165      return (void *) 0;
    151166
    152     /*
    153     fprintf(stderr, "Extended the C heap starting at 0x%x for %d bytes\n",
    154         (unsigned32)starting_address, the_size);
    155      */
    156 
    157167    status = rtems_region_extend(
    158168      RTEMS_Malloc_Heap,
     
    162172    if ( status != RTEMS_SUCCESSFUL ) {
    163173      sbrk(-the_size);
    164       return(FALSE);
    165174      errno = ENOMEM;
    166175      return (void *) 0;
    167176    }
     177   
     178    MSBUMP(space_available, the_size);
     179
    168180    status = rtems_region_get_segment(
    169181      RTEMS_Malloc_Heap,
     
    179191  }
    180192
     193#ifdef MALLOC_STATS
     194  if (return_this)
     195  {
     196      unsigned32 current_depth;
     197      MSBUMP(lifetime_allocated, size);
     198      current_depth = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
     199      if (current_depth > malloc_stats.max_depth)
     200          malloc_stats.max_depth = current_depth;
     201  }
     202#endif
     203 
    181204  return return_this;
    182205}
     
    189212  register char *cptr;
    190213  int length;
     214
     215  MSBUMP(calloc_calls, 1);
    191216
    192217  length = nelem * elsize;
     
    207232  char *new_area;
    208233
     234  MSBUMP(realloc_calls, 1);
     235
    209236  if ( !ptr )
    210237    return malloc( size );
    211238
    212239  if ( !size ) {
     240    free( ptr );
     241    return (void *) 0;
     242  }
     243
     244  new_area = malloc( size );
     245  if ( !new_area ) {
    213246    free( ptr );
    214247    return (void *) 0;
     
    221254  }
    222255
    223   new_area = malloc( size );
    224   if ( !new_area ) {
    225     free( ptr );
    226     return (void *) 0;
    227   }
    228 
    229256  memcpy( new_area, ptr, (size < old_size) ? size : old_size );
    230257  free( ptr );
     
    240267  rtems_status_code status;
    241268
     269  MSBUMP(free_calls, 1);
     270
    242271  if ( !ptr )
    243272    return;
    244273
     274#ifdef MALLOC_STATS
     275  {
     276      unsigned32        size;
     277      status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &size );
     278      if ( status == RTEMS_SUCCESSFUL ) {
     279          MSBUMP(lifetime_freed, size);
     280      }
     281  }
     282#endif
     283 
    245284  status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
    246285  if ( status != RTEMS_SUCCESSFUL ) {
     
    250289}
    251290
     291#ifdef MALLOC_STATS
     292/*
     293 * Dump the malloc statistics
     294 * May be called via atexit()  (installable by our bsp) or
     295 * at any time by user
     296 */
     297
     298void malloc_dump(void)
     299{
     300    unsigned32 allocated = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
     301
     302    printf("Malloc stats\n");
     303    printf("  avail:%uk  allocated:%uk (%d%%) max:%uk (%d%%) lifetime:%Luk freed:%Luk\n",
     304           (unsigned int) malloc_stats.space_available / 1024,
     305           (unsigned int) allocated / 1024,
     306           /* avoid float! */
     307           (allocated * 100) / malloc_stats.space_available,
     308           (unsigned int) malloc_stats.max_depth / 1024,
     309           (malloc_stats.max_depth * 100) / malloc_stats.space_available,
     310           (unsigned long long) malloc_stats.lifetime_allocated / 1024,
     311           (unsigned long long) malloc_stats.lifetime_freed / 1024);
     312    printf("  Call counts:   malloc:%d   free:%d   realloc:%d   calloc:%d\n",
     313           malloc_stats.malloc_calls,
     314           malloc_stats.free_calls,
     315           malloc_stats.realloc_calls,
     316           malloc_stats.calloc_calls);
     317}       
     318#endif
     319
    252320/*
    253321 *  "Reentrant" versions of the above routines implemented above.
  • c/src/lib/libcpu/hppa1.1/clock/clock.c

    r1039ae4 r11290355  
    1616
    1717#include <rtems.h>
    18 #include <bsp.h>
    1918#include <rtems/libio.h>
     19
     20/* should get this from bsp.h, but it is not installed yet */
     21rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
     22extern rtems_configuration_table BSP_Configuration;
    2023
    2124#include <stdlib.h>                     /* for atexit() */
  • c/src/lib/libmisc/error/error.c

    r1039ae4 r11290355  
    4040 *        if ((fd = open(pathname, O_RDNLY)) < 0)
    4141 *        {
    42  *            rtems_error(FLOSS_ERROR_ERRNO, "open of '%s' failed", pathname);
     42 *            rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
    4343 *            goto failed;
    4444 *        }
  • c/src/lib/libmisc/monitor/mon-extension.c

    r1039ae4 r11290355  
    11/*
    2  *      @(#)extension.c 1.3 - 95/07/31
     2 *      @(#)extension.c 1.6 - 95/09/25
    33 *     
    44 *
     
    2222    rtems_extensions_table *e = &rtems_extension->Extension.Callouts;
    2323
    24     rtems_monitor_symbol_canonical_by_value(&canonical_extension->create,
     24    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create,
    2525                                            e->thread_create);
    2626
    27     rtems_monitor_symbol_canonical_by_value(&canonical_extension->start,
     27    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start,
    2828                                            e->thread_start);
    29     rtems_monitor_symbol_canonical_by_value(&canonical_extension->restart,
     29    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart,
    3030                                            e->thread_restart);
    31     rtems_monitor_symbol_canonical_by_value(&canonical_extension->delete,
     31    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete,
    3232                                            e->thread_delete);
    33     rtems_monitor_symbol_canonical_by_value(&canonical_extension->tswitch,
     33    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch,
    3434                                            e->thread_switch);
    35     rtems_monitor_symbol_canonical_by_value(&canonical_extension->begin,
     35    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin,
    3636                                            e->thread_begin);
    37     rtems_monitor_symbol_canonical_by_value(&canonical_extension->exitted,
     37    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted,
    3838                                            e->thread_exitted);
    39     rtems_monitor_symbol_canonical_by_value(&canonical_extension->fatal,
     39    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal,
    4040                                            e->fatal);
    4141}
     
    7373    length += rtems_monitor_pad(18, length);
    7474    length += printf("create: ");
    75     length += rtems_monitor_symbol_dump(&monitor_extension->create, verbose);
     75    length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
    7676    length += printf(";  start: ");
    77     length += rtems_monitor_symbol_dump(&monitor_extension->start, verbose);
     77    length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
    7878    length += printf(";  restart: ");
    79     length += rtems_monitor_symbol_dump(&monitor_extension->restart, verbose);
     79    length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
    8080    length += printf("\n");
    8181    length = 0;
     
    8383    length += rtems_monitor_pad(18, length);
    8484    length += printf("delete: ");
    85     length += rtems_monitor_symbol_dump(&monitor_extension->delete, verbose);
     85    length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
    8686    length += printf(";  switch: ");
    87     length += rtems_monitor_symbol_dump(&monitor_extension->tswitch, verbose);
     87    length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
    8888    length += printf(";  begin: ");
    89     length += rtems_monitor_symbol_dump(&monitor_extension->begin, verbose);
     89    length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
    9090    length += printf("\n");
    9191    length = 0;
     
    9393    length += rtems_monitor_pad(18, length);
    9494    length += printf("exitted: ");
    95     length += rtems_monitor_symbol_dump(&monitor_extension->exitted, verbose);
     95    length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
    9696    length += printf(";  fatal: ");
    97     length += rtems_monitor_symbol_dump(&monitor_extension->fatal, verbose);
     97    length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
    9898    length += printf("\n");
    9999    length = 0;
  • c/src/lib/libmisc/monitor/mon-symbols.c

    r1039ae4 r11290355  
    185185rtems_symbol_sort(rtems_symbol_table_t *table)
    186186{
    187 #ifdef simhppa
     187#ifdef RTEMS_ON_SIMULATOR
    188188    printf("Sorting symbols ... ");         /* so slow we need a msg */
    189189    fflush(stdout);
     
    196196          sizeof(rtems_symbol_t), rtems_symbol_string_compare);
    197197
    198 #ifdef simhppa
     198#ifdef RTEMS_ON_SIMULATOR
    199199    /* so slow we need a msg */
    200200    printf("done\n");
     
    402402        if (canonical_symbol->offset == 0)
    403403            length += printf("%.*s",
    404                              sizeof(canonical_symbol->name),
     404                             (int) sizeof(canonical_symbol->name),
    405405                             canonical_symbol->name);
    406406        else
    407407            length += printf("<%.*s+0x%x>",
    408                              sizeof(canonical_symbol->name),
     408                             (int) sizeof(canonical_symbol->name),
    409409                             canonical_symbol->name,
    410410                             canonical_symbol->offset);
  • c/src/lib/libmisc/monitor/monitor.h

    r1039ae4 r11290355  
    141141    rtems_name               name;
    142142  /* end of common portion */
    143     rtems_monitor_symbol_t  create;
    144     rtems_monitor_symbol_t  start;
    145     rtems_monitor_symbol_t  restart;
    146     rtems_monitor_symbol_t  delete;
    147     rtems_monitor_symbol_t  tswitch;
    148     rtems_monitor_symbol_t  begin;
    149     rtems_monitor_symbol_t  exitted;
    150     rtems_monitor_symbol_t  fatal;
     143    rtems_monitor_symbol_t  e_create;
     144    rtems_monitor_symbol_t  e_start;
     145    rtems_monitor_symbol_t  e_restart;
     146    rtems_monitor_symbol_t  e_delete;
     147    rtems_monitor_symbol_t  e_tswitch;
     148    rtems_monitor_symbol_t  e_begin;
     149    rtems_monitor_symbol_t  e_exitted;
     150    rtems_monitor_symbol_t  e_fatal;
    151151} rtems_monitor_extension_t;
    152152
  • c/src/lib/libmisc/stackchk/check.c

    r1039ae4 r11290355  
    129129  Objects_Id           id_ignored;
    130130  unsigned32          *p;
     131#if 0
    131132  unsigned32           i;
    132133  unsigned32           class_index;
    133134  Thread_Control      *the_thread;
    134135  Objects_Information *information;
     136#endif
    135137
    136138  if (stack_check_initialized)
     
    421423 */
    422424
    423 void Stack_check_Fatal_extension( unsigned32 status )
     425void Stack_check_Fatal_extension(
     426    Internal_errors_Source  source,
     427    boolean                 is_internal,
     428    unsigned32              status
     429)
    424430{
    425431    if (status == 0)
     
    444450      return;
    445451
     452  printf("Stack usage by thread\n");
    446453  printf(
    447454    "   ID          NAME         LOW        HIGH      AVAILABLE     USED\n"
  • c/src/lib/libmisc/stackchk/internal.h

    r1039ae4 r11290355  
    7878
    7979void Stack_check_Fatal_extension(
    80   unsigned32
     80    Internal_errors_Source  source,
     81    boolean                 is_internal,
     82    unsigned32              status
    8183);
    8284
  • c/src/libchip/shmdr/dump.c

    r1039ae4 r11290355  
    2020#include <rtems.h>
    2121#include <stdio.h>
    22 #include <libcsupport.h>
    2322
    2423#include "shm.h"
  • c/src/libchip/shmdr/fatal.c

    r1039ae4 r11290355  
    2323
    2424void MPCI_Fatal(
    25   rtems_unsigned32 error
     25  Internal_errors_Source  source,
     26  boolean                 is_internal,
     27  rtems_unsigned32        error
    2628)
    2729{
  • c/src/libchip/shmdr/getlq.c

    r1039ae4 r11290355  
    3434  tmp_ecb = NULL;
    3535  Shm_Lock( lq_cb );
     36
    3637    tmpfront = Shm_Convert(lq_cb->front);
    3738    if ( tmpfront != Shm_Locked_queue_End_of_list ) {
     
    4243      tmp_ecb->next = Shm_Locked_queue_Not_on_list;
    4344    }
     45
    4446  Shm_Unlock( lq_cb );
    4547  return( tmp_ecb );
  • c/src/libchip/shmdr/shm_driver.h

    r1039ae4 r11290355  
    471471void           Init_env_pool();
    472472void           Shm_Print_statistics( void );
    473 void           MPCI_Fatal( rtems_unsigned32 );
     473void           MPCI_Fatal(
     474  Internal_errors_Source  source,
     475  boolean                 is_internal,
     476  rtems_unsigned32        error
     477 );
    474478rtems_task     Shm_Cause_interrupt( rtems_unsigned32 );
    475479void           Shm_Poll();
  • c/src/libmisc/error/error.c

    r1039ae4 r11290355  
    4040 *        if ((fd = open(pathname, O_RDNLY)) < 0)
    4141 *        {
    42  *            rtems_error(FLOSS_ERROR_ERRNO, "open of '%s' failed", pathname);
     42 *            rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
    4343 *            goto failed;
    4444 *        }
  • c/src/libmisc/monitor/mon-extension.c

    r1039ae4 r11290355  
    11/*
    2  *      @(#)extension.c 1.3 - 95/07/31
     2 *      @(#)extension.c 1.6 - 95/09/25
    33 *     
    44 *
     
    2222    rtems_extensions_table *e = &rtems_extension->Extension.Callouts;
    2323
    24     rtems_monitor_symbol_canonical_by_value(&canonical_extension->create,
     24    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create,
    2525                                            e->thread_create);
    2626
    27     rtems_monitor_symbol_canonical_by_value(&canonical_extension->start,
     27    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start,
    2828                                            e->thread_start);
    29     rtems_monitor_symbol_canonical_by_value(&canonical_extension->restart,
     29    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart,
    3030                                            e->thread_restart);
    31     rtems_monitor_symbol_canonical_by_value(&canonical_extension->delete,
     31    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete,
    3232                                            e->thread_delete);
    33     rtems_monitor_symbol_canonical_by_value(&canonical_extension->tswitch,
     33    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch,
    3434                                            e->thread_switch);
    35     rtems_monitor_symbol_canonical_by_value(&canonical_extension->begin,
     35    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin,
    3636                                            e->thread_begin);
    37     rtems_monitor_symbol_canonical_by_value(&canonical_extension->exitted,
     37    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted,
    3838                                            e->thread_exitted);
    39     rtems_monitor_symbol_canonical_by_value(&canonical_extension->fatal,
     39    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal,
    4040                                            e->fatal);
    4141}
     
    7373    length += rtems_monitor_pad(18, length);
    7474    length += printf("create: ");
    75     length += rtems_monitor_symbol_dump(&monitor_extension->create, verbose);
     75    length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
    7676    length += printf(";  start: ");
    77     length += rtems_monitor_symbol_dump(&monitor_extension->start, verbose);
     77    length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
    7878    length += printf(";  restart: ");
    79     length += rtems_monitor_symbol_dump(&monitor_extension->restart, verbose);
     79    length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
    8080    length += printf("\n");
    8181    length = 0;
     
    8383    length += rtems_monitor_pad(18, length);
    8484    length += printf("delete: ");
    85     length += rtems_monitor_symbol_dump(&monitor_extension->delete, verbose);
     85    length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
    8686    length += printf(";  switch: ");
    87     length += rtems_monitor_symbol_dump(&monitor_extension->tswitch, verbose);
     87    length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
    8888    length += printf(";  begin: ");
    89     length += rtems_monitor_symbol_dump(&monitor_extension->begin, verbose);
     89    length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
    9090    length += printf("\n");
    9191    length = 0;
     
    9393    length += rtems_monitor_pad(18, length);
    9494    length += printf("exitted: ");
    95     length += rtems_monitor_symbol_dump(&monitor_extension->exitted, verbose);
     95    length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
    9696    length += printf(";  fatal: ");
    97     length += rtems_monitor_symbol_dump(&monitor_extension->fatal, verbose);
     97    length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
    9898    length += printf("\n");
    9999    length = 0;
  • c/src/libmisc/monitor/mon-symbols.c

    r1039ae4 r11290355  
    185185rtems_symbol_sort(rtems_symbol_table_t *table)
    186186{
    187 #ifdef simhppa
     187#ifdef RTEMS_ON_SIMULATOR
    188188    printf("Sorting symbols ... ");         /* so slow we need a msg */
    189189    fflush(stdout);
     
    196196          sizeof(rtems_symbol_t), rtems_symbol_string_compare);
    197197
    198 #ifdef simhppa
     198#ifdef RTEMS_ON_SIMULATOR
    199199    /* so slow we need a msg */
    200200    printf("done\n");
     
    402402        if (canonical_symbol->offset == 0)
    403403            length += printf("%.*s",
    404                              sizeof(canonical_symbol->name),
     404                             (int) sizeof(canonical_symbol->name),
    405405                             canonical_symbol->name);
    406406        else
    407407            length += printf("<%.*s+0x%x>",
    408                              sizeof(canonical_symbol->name),
     408                             (int) sizeof(canonical_symbol->name),
    409409                             canonical_symbol->name,
    410410                             canonical_symbol->offset);
  • c/src/libmisc/monitor/monitor.h

    r1039ae4 r11290355  
    141141    rtems_name               name;
    142142  /* end of common portion */
    143     rtems_monitor_symbol_t  create;
    144     rtems_monitor_symbol_t  start;
    145     rtems_monitor_symbol_t  restart;
    146     rtems_monitor_symbol_t  delete;
    147     rtems_monitor_symbol_t  tswitch;
    148     rtems_monitor_symbol_t  begin;
    149     rtems_monitor_symbol_t  exitted;
    150     rtems_monitor_symbol_t  fatal;
     143    rtems_monitor_symbol_t  e_create;
     144    rtems_monitor_symbol_t  e_start;
     145    rtems_monitor_symbol_t  e_restart;
     146    rtems_monitor_symbol_t  e_delete;
     147    rtems_monitor_symbol_t  e_tswitch;
     148    rtems_monitor_symbol_t  e_begin;
     149    rtems_monitor_symbol_t  e_exitted;
     150    rtems_monitor_symbol_t  e_fatal;
    151151} rtems_monitor_extension_t;
    152152
  • c/src/libmisc/stackchk/check.c

    r1039ae4 r11290355  
    129129  Objects_Id           id_ignored;
    130130  unsigned32          *p;
     131#if 0
    131132  unsigned32           i;
    132133  unsigned32           class_index;
    133134  Thread_Control      *the_thread;
    134135  Objects_Information *information;
     136#endif
    135137
    136138  if (stack_check_initialized)
     
    421423 */
    422424
    423 void Stack_check_Fatal_extension( unsigned32 status )
     425void Stack_check_Fatal_extension(
     426    Internal_errors_Source  source,
     427    boolean                 is_internal,
     428    unsigned32              status
     429)
    424430{
    425431    if (status == 0)
     
    444450      return;
    445451
     452  printf("Stack usage by thread\n");
    446453  printf(
    447454    "   ID          NAME         LOW        HIGH      AVAILABLE     USED\n"
  • c/src/libmisc/stackchk/internal.h

    r1039ae4 r11290355  
    7878
    7979void Stack_check_Fatal_extension(
    80   unsigned32
     80    Internal_errors_Source  source,
     81    boolean                 is_internal,
     82    unsigned32              status
    8183);
    8284
  • c/src/tests/samples/cdtest/main.cc

    r1039ae4 r11290355  
    3030#include <rtems.h>
    3131#include <stdio.h>
    32 #include <libcsupport.h>
    3332#include <iostream.h>
    3433
     
    129128//      run.
    130129//
    131 //      Ref: c/src/lib/libbsp/hppa1_1/simhppa/startup/bspstart.c
     130//      Ref: c/src/lib/libbsp/hppa1_1/pxfl/startup/bspstart.c
    132131//
    133132
  • c/src/tests/support/include/tmacros.h

    r1039ae4 r11290355  
    2727#include <stdio.h>
    2828#include <stdlib.h>
    29 #include <libcsupport.h>
    3029
    3130#define FOREVER 1                  /* infinite loop */
     
    9695}
    9796
    98 #define put_buffer( _buffer )  XYZ( _buffer )
    99 
    10097#define build_time( TB, MON, DAY, YR, HR, MIN, SEC, TK ) \
    10198  { (TB)->year   = YR;  \
  • cpukit/libcsupport/src/error.c

    r1039ae4 r11290355  
    4040 *        if ((fd = open(pathname, O_RDNLY)) < 0)
    4141 *        {
    42  *            rtems_error(FLOSS_ERROR_ERRNO, "open of '%s' failed", pathname);
     42 *            rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname);
    4343 *            goto failed;
    4444 *        }
  • cpukit/libcsupport/src/malloc.c

    r1039ae4 r11290355  
    1515
    1616#include <rtems.h>
    17 #ifdef RTEMS_LIBC
    18 #include <memory.h>
    19 #endif
    2017#include "libcsupport.h"
    2118#ifdef RTEMS_NEWLIB
     
    3027#include <string.h>
    3128
    32 /*
    33  *  XXX: Do we really need to duplicate these? It appears that they
    34  *       only cause typing problems.
    35  */
    36 
    37 #if 0
    38 void *malloc(size_t);
    39 void *calloc(size_t, size_t);
    40 void *realloc(void *, size_t);
    41 void free(void *);
    42 void *sbrk(size_t);
    43 #endif
    44 
    4529rtems_id RTEMS_Malloc_Heap;
    4630size_t RTEMS_Malloc_Sbrk_amount;
     31
     32#ifdef RTEMS_DEBUG
     33#define MALLOC_STATS
     34#endif
     35
     36#ifdef MALLOC_STATS
     37#define MSBUMP(f,n)    malloc_stats.f += (n)
     38
     39struct {
     40    unsigned32  space_available;             /* current size of malloc area */
     41    unsigned32  malloc_calls;                /* # calls to malloc */
     42    unsigned32  free_calls;
     43    unsigned32  realloc_calls;
     44    unsigned32  calloc_calls;
     45    unsigned32  max_depth;                   /* most ever malloc'd at 1 time */
     46    unsigned64  lifetime_allocated;
     47    unsigned64  lifetime_freed;
     48} malloc_stats;
     49
     50#else                   /* No malloc_stats */
     51#define MSBUMP(f,n)
     52#endif
    4753
    4854void RTEMS_Malloc_Initialize(
     
    7884      u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    7985
    80       /*
    81        *  Adjust the length by whatever we aligned by
    82        */
     86       /*
     87        * adjust the length by whatever we aligned by
     88        */
    8389
    8490      length -= u32_address - old_address;
     
    98104    starting_address,
    99105    length,
    100     8,                     /* XXX : use CPU dependent RTEMS constant */
     106    CPU_ALIGNMENT,
    101107    RTEMS_DEFAULT_ATTRIBUTES,
    102108    &RTEMS_Malloc_Heap
     
    104110  if ( status != RTEMS_SUCCESSFUL )
    105111    rtems_fatal_error_occurred( status );
     112
     113#ifdef MALLOC_STATS
     114  /* zero all the stats */
     115  (void) memset(&malloc_stats, 0, sizeof(malloc_stats));
     116#endif
     117 
     118  MSBUMP(space_available, length);
    106119}
    107120
     
    115128  rtems_unsigned32   sbrk_amount;
    116129  rtems_status_code  status;
     130
     131  MSBUMP(malloc_calls, 1);
    117132
    118133  if ( !size )
     
    150165      return (void *) 0;
    151166
    152     /*
    153     fprintf(stderr, "Extended the C heap starting at 0x%x for %d bytes\n",
    154         (unsigned32)starting_address, the_size);
    155      */
    156 
    157167    status = rtems_region_extend(
    158168      RTEMS_Malloc_Heap,
     
    162172    if ( status != RTEMS_SUCCESSFUL ) {
    163173      sbrk(-the_size);
    164       return(FALSE);
    165174      errno = ENOMEM;
    166175      return (void *) 0;
    167176    }
     177   
     178    MSBUMP(space_available, the_size);
     179
    168180    status = rtems_region_get_segment(
    169181      RTEMS_Malloc_Heap,
     
    179191  }
    180192
     193#ifdef MALLOC_STATS
     194  if (return_this)
     195  {
     196      unsigned32 current_depth;
     197      MSBUMP(lifetime_allocated, size);
     198      current_depth = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
     199      if (current_depth > malloc_stats.max_depth)
     200          malloc_stats.max_depth = current_depth;
     201  }
     202#endif
     203 
    181204  return return_this;
    182205}
     
    189212  register char *cptr;
    190213  int length;
     214
     215  MSBUMP(calloc_calls, 1);
    191216
    192217  length = nelem * elsize;
     
    207232  char *new_area;
    208233
     234  MSBUMP(realloc_calls, 1);
     235
    209236  if ( !ptr )
    210237    return malloc( size );
    211238
    212239  if ( !size ) {
     240    free( ptr );
     241    return (void *) 0;
     242  }
     243
     244  new_area = malloc( size );
     245  if ( !new_area ) {
    213246    free( ptr );
    214247    return (void *) 0;
     
    221254  }
    222255
    223   new_area = malloc( size );
    224   if ( !new_area ) {
    225     free( ptr );
    226     return (void *) 0;
    227   }
    228 
    229256  memcpy( new_area, ptr, (size < old_size) ? size : old_size );
    230257  free( ptr );
     
    240267  rtems_status_code status;
    241268
     269  MSBUMP(free_calls, 1);
     270
    242271  if ( !ptr )
    243272    return;
    244273
     274#ifdef MALLOC_STATS
     275  {
     276      unsigned32        size;
     277      status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &size );
     278      if ( status == RTEMS_SUCCESSFUL ) {
     279          MSBUMP(lifetime_freed, size);
     280      }
     281  }
     282#endif
     283 
    245284  status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
    246285  if ( status != RTEMS_SUCCESSFUL ) {
     
    250289}
    251290
     291#ifdef MALLOC_STATS
     292/*
     293 * Dump the malloc statistics
     294 * May be called via atexit()  (installable by our bsp) or
     295 * at any time by user
     296 */
     297
     298void malloc_dump(void)
     299{
     300    unsigned32 allocated = malloc_stats.lifetime_allocated - malloc_stats.lifetime_freed;
     301
     302    printf("Malloc stats\n");
     303    printf("  avail:%uk  allocated:%uk (%d%%) max:%uk (%d%%) lifetime:%Luk freed:%Luk\n",
     304           (unsigned int) malloc_stats.space_available / 1024,
     305           (unsigned int) allocated / 1024,
     306           /* avoid float! */
     307           (allocated * 100) / malloc_stats.space_available,
     308           (unsigned int) malloc_stats.max_depth / 1024,
     309           (malloc_stats.max_depth * 100) / malloc_stats.space_available,
     310           (unsigned long long) malloc_stats.lifetime_allocated / 1024,
     311           (unsigned long long) malloc_stats.lifetime_freed / 1024);
     312    printf("  Call counts:   malloc:%d   free:%d   realloc:%d   calloc:%d\n",
     313           malloc_stats.malloc_calls,
     314           malloc_stats.free_calls,
     315           malloc_stats.realloc_calls,
     316           malloc_stats.calloc_calls);
     317}       
     318#endif
     319
    252320/*
    253321 *  "Reentrant" versions of the above routines implemented above.
  • cpukit/libmisc/monitor/mon-extension.c

    r1039ae4 r11290355  
    11/*
    2  *      @(#)extension.c 1.3 - 95/07/31
     2 *      @(#)extension.c 1.6 - 95/09/25
    33 *     
    44 *
     
    2222    rtems_extensions_table *e = &rtems_extension->Extension.Callouts;
    2323
    24     rtems_monitor_symbol_canonical_by_value(&canonical_extension->create,
     24    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create,
    2525                                            e->thread_create);
    2626
    27     rtems_monitor_symbol_canonical_by_value(&canonical_extension->start,
     27    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start,
    2828                                            e->thread_start);
    29     rtems_monitor_symbol_canonical_by_value(&canonical_extension->restart,
     29    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart,
    3030                                            e->thread_restart);
    31     rtems_monitor_symbol_canonical_by_value(&canonical_extension->delete,
     31    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete,
    3232                                            e->thread_delete);
    33     rtems_monitor_symbol_canonical_by_value(&canonical_extension->tswitch,
     33    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch,
    3434                                            e->thread_switch);
    35     rtems_monitor_symbol_canonical_by_value(&canonical_extension->begin,
     35    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin,
    3636                                            e->thread_begin);
    37     rtems_monitor_symbol_canonical_by_value(&canonical_extension->exitted,
     37    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted,
    3838                                            e->thread_exitted);
    39     rtems_monitor_symbol_canonical_by_value(&canonical_extension->fatal,
     39    rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal,
    4040                                            e->fatal);
    4141}
     
    7373    length += rtems_monitor_pad(18, length);
    7474    length += printf("create: ");
    75     length += rtems_monitor_symbol_dump(&monitor_extension->create, verbose);
     75    length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
    7676    length += printf(";  start: ");
    77     length += rtems_monitor_symbol_dump(&monitor_extension->start, verbose);
     77    length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
    7878    length += printf(";  restart: ");
    79     length += rtems_monitor_symbol_dump(&monitor_extension->restart, verbose);
     79    length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
    8080    length += printf("\n");
    8181    length = 0;
     
    8383    length += rtems_monitor_pad(18, length);
    8484    length += printf("delete: ");
    85     length += rtems_monitor_symbol_dump(&monitor_extension->delete, verbose);
     85    length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
    8686    length += printf(";  switch: ");
    87     length += rtems_monitor_symbol_dump(&monitor_extension->tswitch, verbose);
     87    length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
    8888    length += printf(";  begin: ");
    89     length += rtems_monitor_symbol_dump(&monitor_extension->begin, verbose);
     89    length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
    9090    length += printf("\n");
    9191    length = 0;
     
    9393    length += rtems_monitor_pad(18, length);
    9494    length += printf("exitted: ");
    95     length += rtems_monitor_symbol_dump(&monitor_extension->exitted, verbose);
     95    length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
    9696    length += printf(";  fatal: ");
    97     length += rtems_monitor_symbol_dump(&monitor_extension->fatal, verbose);
     97    length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
    9898    length += printf("\n");
    9999    length = 0;
  • cpukit/libmisc/monitor/mon-symbols.c

    r1039ae4 r11290355  
    185185rtems_symbol_sort(rtems_symbol_table_t *table)
    186186{
    187 #ifdef simhppa
     187#ifdef RTEMS_ON_SIMULATOR
    188188    printf("Sorting symbols ... ");         /* so slow we need a msg */
    189189    fflush(stdout);
     
    196196          sizeof(rtems_symbol_t), rtems_symbol_string_compare);
    197197
    198 #ifdef simhppa
     198#ifdef RTEMS_ON_SIMULATOR
    199199    /* so slow we need a msg */
    200200    printf("done\n");
     
    402402        if (canonical_symbol->offset == 0)
    403403            length += printf("%.*s",
    404                              sizeof(canonical_symbol->name),
     404                             (int) sizeof(canonical_symbol->name),
    405405                             canonical_symbol->name);
    406406        else
    407407            length += printf("<%.*s+0x%x>",
    408                              sizeof(canonical_symbol->name),
     408                             (int) sizeof(canonical_symbol->name),
    409409                             canonical_symbol->name,
    410410                             canonical_symbol->offset);
  • cpukit/libmisc/monitor/monitor.h

    r1039ae4 r11290355  
    141141    rtems_name               name;
    142142  /* end of common portion */
    143     rtems_monitor_symbol_t  create;
    144     rtems_monitor_symbol_t  start;
    145     rtems_monitor_symbol_t  restart;
    146     rtems_monitor_symbol_t  delete;
    147     rtems_monitor_symbol_t  tswitch;
    148     rtems_monitor_symbol_t  begin;
    149     rtems_monitor_symbol_t  exitted;
    150     rtems_monitor_symbol_t  fatal;
     143    rtems_monitor_symbol_t  e_create;
     144    rtems_monitor_symbol_t  e_start;
     145    rtems_monitor_symbol_t  e_restart;
     146    rtems_monitor_symbol_t  e_delete;
     147    rtems_monitor_symbol_t  e_tswitch;
     148    rtems_monitor_symbol_t  e_begin;
     149    rtems_monitor_symbol_t  e_exitted;
     150    rtems_monitor_symbol_t  e_fatal;
    151151} rtems_monitor_extension_t;
    152152
  • cpukit/libmisc/stackchk/check.c

    r1039ae4 r11290355  
    129129  Objects_Id           id_ignored;
    130130  unsigned32          *p;
     131#if 0
    131132  unsigned32           i;
    132133  unsigned32           class_index;
    133134  Thread_Control      *the_thread;
    134135  Objects_Information *information;
     136#endif
    135137
    136138  if (stack_check_initialized)
     
    421423 */
    422424
    423 void Stack_check_Fatal_extension( unsigned32 status )
     425void Stack_check_Fatal_extension(
     426    Internal_errors_Source  source,
     427    boolean                 is_internal,
     428    unsigned32              status
     429)
    424430{
    425431    if (status == 0)
     
    444450      return;
    445451
     452  printf("Stack usage by thread\n");
    446453  printf(
    447454    "   ID          NAME         LOW        HIGH      AVAILABLE     USED\n"
  • cpukit/libmisc/stackchk/internal.h

    r1039ae4 r11290355  
    7878
    7979void Stack_check_Fatal_extension(
    80   unsigned32
     80    Internal_errors_Source  source,
     81    boolean                 is_internal,
     82    unsigned32              status
    8183);
    8284
  • cpukit/score/cpu/hppa1.1/cpu.c

    r1039ae4 r11290355  
    1515 *      suitability of this software for any purpose.
    1616 *
    17  *  $Id$
     17 *  cpu.c,v 1.7 1995/09/19 14:49:35 joel Exp
    1818 */
    1919
    2020#include <rtems/system.h>
    21 #include <rtems/score/isr.h>
    22 #include <rtems/score/wkspace.h>
     21#include <rtems/fatal.h>
     22#include <rtems/core/isr.h>
     23#include <rtems/core/wkspace.h>
    2324
    2425void hppa_external_interrupt_initialize(void);
     
    102103
    103104    _CPU_Table = *cpu_table;
     105}
     106
     107/*PAGE
     108 *
     109 *  _CPU_ISR_Get_level
     110 */
     111 
     112unsigned32 _CPU_ISR_Get_level(void)
     113{
     114    int level;
     115    HPPA_ASM_SSM(0, level);     /* change no bits; just get copy */
     116    if (level & HPPA_PSW_I)
     117        return 1;
     118    return 0;
    104119}
    105120
  • cpukit/score/cpu/unix/cpu.c

    r1039ae4 r11290355  
    174174{
    175175
    176 #if defined(hppa1_1) && defined(RTEMS_UNIXLIB)
     176#if defined(hppa1_1) && defined(RTEMS_UNIXLIB_SETJMP)
    177177    /*
    178178     * HACK - set the _SYSTEM_ID to 0x20c so that setjmp/longjmp
  • cpukit/score/include/rtems/score/heap.h

    r1039ae4 r11290355  
    281281/*PAGE
    282282 *
    283  *  _Heap_User_Block_at
    284  *
    285  */
    286 
    287 STATIC INLINE Heap_Block *_Heap_User_Block_at(
     283 *  _Heap_User_block_at
     284 *
     285 */
     286
     287STATIC INLINE Heap_Block *_Heap_User_block_at(
    288288  void       *base
    289289);
  • cpukit/score/inline/rtems/score/heap.inl

    r1039ae4 r11290355  
    9595/*PAGE
    9696 *
    97  *  _Heap_User_Block_at
     97 *  _Heap_User_block_at
    9898 *
    9999 */
    100100 
    101 STATIC INLINE Heap_Block *_Heap_User_Block_at(
     101STATIC INLINE Heap_Block *_Heap_User_block_at(
    102102  void       *base
    103103)
  • cpukit/score/macros/rtems/score/heap.inl

    r1039ae4 r11290355  
    7171/*PAGE
    7272 *
    73  *  _Heap_User_Block_at
     73 *  _Heap_User_block_at
    7474 *
    7575 */
    7676 
    77 #define _Heap_User_Block_at( _base ) \
     77#define _Heap_User_block_at( _base ) \
    7878  _Heap_Block_at( \
    7979    (_base), \
  • cpukit/score/src/heap.c

    r1039ae4 r11290355  
    302302  unsigned32         the_size;
    303303
    304   the_block = _Heap_User_Block_at( starting_address );
     304  the_block = _Heap_User_block_at( starting_address );
    305305 
    306306  if ( !_Heap_Is_block_in( the_heap, the_block ) ||
     
    347347  unsigned32         the_size;
    348348
    349   the_block = _Heap_User_Block_at( starting_address );
     349  the_block = _Heap_User_block_at( starting_address );
    350350
    351351  if ( !_Heap_Is_block_in( the_heap, the_block ) ||
     
    431431  Heap_Block *next_block = 0;  /* avoid warnings */
    432432  int         notdone = 1;
     433  int         error = 0;
     434  int         passes = 0;
    433435
    434436  /*
     
    456458  if (the_block->back_flag != HEAP_DUMMY_FLAG) {
    457459    printf("PASS: %d  Back flag of 1st block isn't HEAP_DUMMY_FLAG\n", source);
     460    error = 1;
    458461  }
    459462
    460463  while (notdone) {
     464    passes++;
     465    if (error && (passes > 10))
     466        abort();
     467   
    461468    if (do_dump == TRUE) {
    462469      printf("PASS: %d  Block @ 0x%p   Back %d,   Front %d",
     
    478485      next_block = _Heap_Next_block(the_block);
    479486      if ( the_block->front_flag != next_block->back_flag ) {
     487        error = 1;
    480488        printf("PASS: %d  Front and back flags don't match\n", source);
    481489        printf("         Current Block:  Back - %d,  Front - %d",
     
    511519      the_block = next_block;
    512520  }
     521
     522  if (error)
     523      abort();
    513524}
  • testsuites/samples/cdtest/main.cc

    r1039ae4 r11290355  
    3030#include <rtems.h>
    3131#include <stdio.h>
    32 #include <libcsupport.h>
    3332#include <iostream.h>
    3433
     
    129128//      run.
    130129//
    131 //      Ref: c/src/lib/libbsp/hppa1_1/simhppa/startup/bspstart.c
     130//      Ref: c/src/lib/libbsp/hppa1_1/pxfl/startup/bspstart.c
    132131//
    133132
  • testsuites/support/include/tmacros.h

    r1039ae4 r11290355  
    2727#include <stdio.h>
    2828#include <stdlib.h>
    29 #include <libcsupport.h>
    3029
    3130#define FOREVER 1                  /* infinite loop */
     
    9695}
    9796
    98 #define put_buffer( _buffer )  XYZ( _buffer )
    99 
    10097#define build_time( TB, MON, DAY, YR, HR, MIN, SEC, TK ) \
    10198  { (TB)->year   = YR;  \
  • tools/build/src/unhex.c

    r1039ae4 r11290355  
    8787#define ERR_MASK   (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
    8888
    89 #define stol(p) strtol(p, (char **) NULL, 0)
     89#define stol(p) strtoul(p, (char **) NULL, 0)
    9090
    9191int   unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
  • tools/build/unhex.c

    r1039ae4 r11290355  
    8787#define ERR_MASK   (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
    8888
    89 #define stol(p) strtol(p, (char **) NULL, 0)
     89#define stol(p) strtoul(p, (char **) NULL, 0)
    9090
    9191int   unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
  • tools/cpu/hppa1.1/genoffsets.c

    r1039ae4 r11290355  
    11/*
    2  *      @(#)genoffsets.c        1.5 - 95/05/16
     2 *      @(#)genoffsets.c        1.7 - 95/09/25
    33 *     
    44 *
     
    8383  );
    8484
    85 #if defined(hpux) && defined(__hppa__)
     85#if defined(__hpux__) && defined(__hppa__)
    8686
    8787/*
Note: See TracChangeset for help on using the changeset viewer.