- Timestamp:
- 09/29/95 17:19:16 (28 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 1ceface
- Parents:
- 1039ae4
- Location:
- c/src/lib
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h
r1039ae4 r11290355 14 14 */ 15 15 16 #ifndef __ SIMHPPA_h17 #define __ SIMHPPA_h16 #ifndef __PXFL_BSP_h 17 #define __PXFL_BSP_h 18 18 19 19 #ifdef __cplusplus … … 24 24 #include <clockdrv.h> 25 25 #include <rtems/ttydrv.h> 26 #include <libcsupport.h>27 26 28 27 /* -
c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c
r1039ae4 r11290355 53 53 shm_config_table BSP_shm_cfgtbl; 54 54 55 void Shm_Cause_interrupt_simhppa( 56 rtems_unsigned32 node 57 ); 55 void Shm_Cause_interrupt_pxfl( rtems_unsigned32 node ); 58 56 59 57 void Shm_Get_configuration( … … 66 64 BSP_shm_cfgtbl.format = SHM_BIG; 67 65 68 BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt_ simhppa;66 BSP_shm_cfgtbl.cause_intr = Shm_Cause_interrupt_pxfl; 69 67 70 68 #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 ) 2 2 * 3 3 * This routine is the shared memory driver routine which … … 25 25 #include <shm.h> 26 26 27 void Shm_Cause_interrupt_ simhppa(27 void Shm_Cause_interrupt_pxfl( 28 28 rtems_unsigned32 node 29 29 ) 30 30 { 31 31 Shm_Interrupt_information *intr; 32 rtems_unsigned8 *u8;33 rtems_unsigned16 *u16;34 32 rtems_unsigned32 *u32; 35 33 rtems_unsigned32 value; … … 41 39 case NO_INTERRUPT: 42 40 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;59 41 case LONG: 60 42 u32 = (rtems_unsigned32 *)intr->address; 61 43 HPPA_ASM_STWAS( value, 0, u32 ); 62 44 break; 45 default: 46 fprintf( stderr, "Shm_Cause_interrupt_pxfl: Unsupported length!!!\n" ); 47 rtems_shutdown_executive( 0 ); 48 break; 63 49 } 64 50 } -
c/src/lib/libbsp/hppa1.1/simhppa/startup/setvec.c
r1039ae4 r11290355 56 56 (vector < (HPPA_INTERRUPT_BSP_BASE + HPPA_BSP_INTERRUPTS))) 57 57 { 58 simhppa_interrupt_install(handler,59 60 58 pxfl_interrupt_install(handler, 59 vector - HPPA_INTERRUPT_BSP_BASE, 60 (rtems_isr_entry *) &previous_isr); 61 61 } 62 62 #endif -
c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
r1039ae4 r11290355 20 20 21 21 m302 = 0xf7f000; 22 _VBR = 0x000000; /* location of the VBR table (in RAM) */ 22 23 23 24 SECTIONS -
c/src/lib/libbsp/shmdr/dump.c
r1039ae4 r11290355 20 20 #include <rtems.h> 21 21 #include <stdio.h> 22 #include <libcsupport.h>23 22 24 23 #include "shm.h" -
c/src/lib/libbsp/shmdr/fatal.c
r1039ae4 r11290355 23 23 24 24 void MPCI_Fatal( 25 rtems_unsigned32 error 25 Internal_errors_Source source, 26 boolean is_internal, 27 rtems_unsigned32 error 26 28 ) 27 29 { -
c/src/lib/libbsp/shmdr/getlq.c
r1039ae4 r11290355 34 34 tmp_ecb = NULL; 35 35 Shm_Lock( lq_cb ); 36 36 37 tmpfront = Shm_Convert(lq_cb->front); 37 38 if ( tmpfront != Shm_Locked_queue_End_of_list ) { … … 42 43 tmp_ecb->next = Shm_Locked_queue_Not_on_list; 43 44 } 45 44 46 Shm_Unlock( lq_cb ); 45 47 return( tmp_ecb ); -
c/src/lib/libbsp/shmdr/shm.h
r1039ae4 r11290355 471 471 void Init_env_pool(); 472 472 void Shm_Print_statistics( void ); 473 void MPCI_Fatal( rtems_unsigned32 ); 473 void MPCI_Fatal( 474 Internal_errors_Source source, 475 boolean is_internal, 476 rtems_unsigned32 error 477 ); 474 478 rtems_task Shm_Cause_interrupt( rtems_unsigned32 ); 475 479 void Shm_Poll(); -
c/src/lib/libbsp/shmdr/shm_driver.h
r1039ae4 r11290355 471 471 void Init_env_pool(); 472 472 void Shm_Print_statistics( void ); 473 void MPCI_Fatal( rtems_unsigned32 ); 473 void MPCI_Fatal( 474 Internal_errors_Source source, 475 boolean is_internal, 476 rtems_unsigned32 error 477 ); 474 478 rtems_task Shm_Cause_interrupt( rtems_unsigned32 ); 475 479 void Shm_Poll(); -
c/src/lib/libbsp/unix/posix/include/bsp.h
r1039ae4 r11290355 25 25 #include <console.h> 26 26 #include <iosupp.h> 27 #include <libcsupport.h>28 27 29 28 /* -
c/src/lib/libbsp/unix/posix/startup/bspstart.c
r1039ae4 r11290355 196 196 rtems_fatal_error_occurred('STIO'); 197 197 #endif 198 199 #if defined(MALLOC_STATS) 200 atexit(malloc_dump); 201 #endif 202 198 203 } 199 204 -
c/src/lib/libbsp/unix/posix/startup/setvec.c
r1039ae4 r11290355 8 8 * type - 0 indicates raw hardware connect 9 9 * 1 indicates RTEMS interrupt connect 10 *11 * NOTE 'type' is ignored on hppa; all interrupts are owned by RTEMS12 10 * 13 11 * RETURNS: … … 26 24 27 25 #include <bsp.h> 28 29 /*30 * Install an interrupt handler in the right place31 * given its vector number from cpu/hppa.h32 * There are 2 places an interrupt can be installed33 * _ISR_Vector_table34 * bsp interrupt XXX: nyi35 *36 * We decide which based on the vector number37 */38 26 39 27 rtems_isr_entry -
c/src/lib/libc/error.c
r1039ae4 r11290355 40 40 * if ((fd = open(pathname, O_RDNLY)) < 0) 41 41 * { 42 * rtems_error( FLOSS_ERROR_ERRNO, "open of '%s' failed", pathname);42 * rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname); 43 43 * goto failed; 44 44 * } -
c/src/lib/libc/malloc.c
r1039ae4 r11290355 15 15 16 16 #include <rtems.h> 17 #ifdef RTEMS_LIBC18 #include <memory.h>19 #endif20 17 #include "libcsupport.h" 21 18 #ifdef RTEMS_NEWLIB … … 30 27 #include <string.h> 31 28 32 /*33 * XXX: Do we really need to duplicate these? It appears that they34 * only cause typing problems.35 */36 37 #if 038 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 #endif44 45 29 rtems_id RTEMS_Malloc_Heap; 46 30 size_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 39 struct { 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 47 53 48 54 void RTEMS_Malloc_Initialize( … … 78 84 u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); 79 85 80 /*81 * Adjust the length by whatever we aligned by82 86 /* 87 * adjust the length by whatever we aligned by 88 */ 83 89 84 90 length -= u32_address - old_address; … … 98 104 starting_address, 99 105 length, 100 8, /* XXX : use CPU dependent RTEMS constant */106 CPU_ALIGNMENT, 101 107 RTEMS_DEFAULT_ATTRIBUTES, 102 108 &RTEMS_Malloc_Heap … … 104 110 if ( status != RTEMS_SUCCESSFUL ) 105 111 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); 106 119 } 107 120 … … 115 128 rtems_unsigned32 sbrk_amount; 116 129 rtems_status_code status; 130 131 MSBUMP(malloc_calls, 1); 117 132 118 133 if ( !size ) … … 150 165 return (void *) 0; 151 166 152 /*153 fprintf(stderr, "Extended the C heap starting at 0x%x for %d bytes\n",154 (unsigned32)starting_address, the_size);155 */156 157 167 status = rtems_region_extend( 158 168 RTEMS_Malloc_Heap, … … 162 172 if ( status != RTEMS_SUCCESSFUL ) { 163 173 sbrk(-the_size); 164 return(FALSE);165 174 errno = ENOMEM; 166 175 return (void *) 0; 167 176 } 177 178 MSBUMP(space_available, the_size); 179 168 180 status = rtems_region_get_segment( 169 181 RTEMS_Malloc_Heap, … … 179 191 } 180 192 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 181 204 return return_this; 182 205 } … … 189 212 register char *cptr; 190 213 int length; 214 215 MSBUMP(calloc_calls, 1); 191 216 192 217 length = nelem * elsize; … … 207 232 char *new_area; 208 233 234 MSBUMP(realloc_calls, 1); 235 209 236 if ( !ptr ) 210 237 return malloc( size ); 211 238 212 239 if ( !size ) { 240 free( ptr ); 241 return (void *) 0; 242 } 243 244 new_area = malloc( size ); 245 if ( !new_area ) { 213 246 free( ptr ); 214 247 return (void *) 0; … … 221 254 } 222 255 223 new_area = malloc( size );224 if ( !new_area ) {225 free( ptr );226 return (void *) 0;227 }228 229 256 memcpy( new_area, ptr, (size < old_size) ? size : old_size ); 230 257 free( ptr ); … … 240 267 rtems_status_code status; 241 268 269 MSBUMP(free_calls, 1); 270 242 271 if ( !ptr ) 243 272 return; 244 273 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 245 284 status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr ); 246 285 if ( status != RTEMS_SUCCESSFUL ) { … … 250 289 } 251 290 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 298 void 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 252 320 /* 253 321 * "Reentrant" versions of the above routines implemented above. -
c/src/lib/libcpu/hppa1.1/clock/clock.c
r1039ae4 r11290355 16 16 17 17 #include <rtems.h> 18 #include <bsp.h>19 18 #include <rtems/libio.h> 19 20 /* should get this from bsp.h, but it is not installed yet */ 21 rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int); 22 extern rtems_configuration_table BSP_Configuration; 20 23 21 24 #include <stdlib.h> /* for atexit() */ -
c/src/lib/libmisc/error/error.c
r1039ae4 r11290355 40 40 * if ((fd = open(pathname, O_RDNLY)) < 0) 41 41 * { 42 * rtems_error( FLOSS_ERROR_ERRNO, "open of '%s' failed", pathname);42 * rtems_error(RTEMS_ERROR_ERRNO, "open of '%s' failed", pathname); 43 43 * goto failed; 44 44 * } -
c/src/lib/libmisc/monitor/mon-extension.c
r1039ae4 r11290355 1 1 /* 2 * @(#)extension.c 1. 3 - 95/07/312 * @(#)extension.c 1.6 - 95/09/25 3 3 * 4 4 * … … 22 22 rtems_extensions_table *e = &rtems_extension->Extension.Callouts; 23 23 24 rtems_monitor_symbol_canonical_by_value(&canonical_extension-> create,24 rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create, 25 25 e->thread_create); 26 26 27 rtems_monitor_symbol_canonical_by_value(&canonical_extension-> start,27 rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start, 28 28 e->thread_start); 29 rtems_monitor_symbol_canonical_by_value(&canonical_extension-> restart,29 rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart, 30 30 e->thread_restart); 31 rtems_monitor_symbol_canonical_by_value(&canonical_extension-> delete,31 rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete, 32 32 e->thread_delete); 33 rtems_monitor_symbol_canonical_by_value(&canonical_extension-> tswitch,33 rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch, 34 34 e->thread_switch); 35 rtems_monitor_symbol_canonical_by_value(&canonical_extension-> begin,35 rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin, 36 36 e->thread_begin); 37 rtems_monitor_symbol_canonical_by_value(&canonical_extension->e xitted,37 rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted, 38 38 e->thread_exitted); 39 rtems_monitor_symbol_canonical_by_value(&canonical_extension-> fatal,39 rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal, 40 40 e->fatal); 41 41 } … … 73 73 length += rtems_monitor_pad(18, length); 74 74 length += printf("create: "); 75 length += rtems_monitor_symbol_dump(&monitor_extension-> create, verbose);75 length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose); 76 76 length += printf("; start: "); 77 length += rtems_monitor_symbol_dump(&monitor_extension-> start, verbose);77 length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose); 78 78 length += printf("; restart: "); 79 length += rtems_monitor_symbol_dump(&monitor_extension-> restart, verbose);79 length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose); 80 80 length += printf("\n"); 81 81 length = 0; … … 83 83 length += rtems_monitor_pad(18, length); 84 84 length += printf("delete: "); 85 length += rtems_monitor_symbol_dump(&monitor_extension-> delete, verbose);85 length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose); 86 86 length += printf("; switch: "); 87 length += rtems_monitor_symbol_dump(&monitor_extension-> tswitch, verbose);87 length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose); 88 88 length += printf("; begin: "); 89 length += rtems_monitor_symbol_dump(&monitor_extension-> begin, verbose);89 length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose); 90 90 length += printf("\n"); 91 91 length = 0; … … 93 93 length += rtems_monitor_pad(18, length); 94 94 length += printf("exitted: "); 95 length += rtems_monitor_symbol_dump(&monitor_extension->e xitted, verbose);95 length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose); 96 96 length += printf("; fatal: "); 97 length += rtems_monitor_symbol_dump(&monitor_extension-> fatal, verbose);97 length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose); 98 98 length += printf("\n"); 99 99 length = 0; -
c/src/lib/libmisc/monitor/mon-symbols.c
r1039ae4 r11290355 185 185 rtems_symbol_sort(rtems_symbol_table_t *table) 186 186 { 187 #ifdef simhppa187 #ifdef RTEMS_ON_SIMULATOR 188 188 printf("Sorting symbols ... "); /* so slow we need a msg */ 189 189 fflush(stdout); … … 196 196 sizeof(rtems_symbol_t), rtems_symbol_string_compare); 197 197 198 #ifdef simhppa198 #ifdef RTEMS_ON_SIMULATOR 199 199 /* so slow we need a msg */ 200 200 printf("done\n"); … … 402 402 if (canonical_symbol->offset == 0) 403 403 length += printf("%.*s", 404 sizeof(canonical_symbol->name),404 (int) sizeof(canonical_symbol->name), 405 405 canonical_symbol->name); 406 406 else 407 407 length += printf("<%.*s+0x%x>", 408 sizeof(canonical_symbol->name),408 (int) sizeof(canonical_symbol->name), 409 409 canonical_symbol->name, 410 410 canonical_symbol->offset); -
c/src/lib/libmisc/monitor/monitor.h
r1039ae4 r11290355 141 141 rtems_name name; 142 142 /* 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 e xitted;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; 151 151 } rtems_monitor_extension_t; 152 152 -
c/src/lib/libmisc/stackchk/check.c
r1039ae4 r11290355 129 129 Objects_Id id_ignored; 130 130 unsigned32 *p; 131 #if 0 131 132 unsigned32 i; 132 133 unsigned32 class_index; 133 134 Thread_Control *the_thread; 134 135 Objects_Information *information; 136 #endif 135 137 136 138 if (stack_check_initialized) … … 421 423 */ 422 424 423 void Stack_check_Fatal_extension( unsigned32 status ) 425 void Stack_check_Fatal_extension( 426 Internal_errors_Source source, 427 boolean is_internal, 428 unsigned32 status 429 ) 424 430 { 425 431 if (status == 0) … … 444 450 return; 445 451 452 printf("Stack usage by thread\n"); 446 453 printf( 447 454 " ID NAME LOW HIGH AVAILABLE USED\n" -
c/src/lib/libmisc/stackchk/internal.h
r1039ae4 r11290355 78 78 79 79 void Stack_check_Fatal_extension( 80 unsigned32 80 Internal_errors_Source source, 81 boolean is_internal, 82 unsigned32 status 81 83 ); 82 84
Note: See TracChangeset
for help on using the changeset viewer.