- Timestamp:
- 05/24/95 21:39:42 (27 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 5b9d6ddf
- Parents:
- bf61e45c
- Location:
- cpukit
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libcsupport/src/__brk.c
rbf61e45c r88d594a 1 #if !defined(RTEMS_UNIX) 2 1 3 /* 2 4 * RTEMS "Broken" __brk/__sbrk Implementation … … 13 15 * notice must appear in all copies of this file and its derivatives. 14 16 * 15 * $Id$17 * __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp 16 18 */ 17 19 … … 39 41 return -1; 40 42 } 43 44 #endif -
cpukit/libcsupport/src/__gettod.c
rbf61e45c r88d594a 12 12 * notice must appear in all copies of this file and its derivatives. 13 13 * 14 * $Id$14 * __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp 15 15 */ 16 16 … … 20 20 #include <sys/reent.h> 21 21 #endif 22 22 23 #include <time.h> 23 24 #include <sys/time.h> 25 24 26 #include <errno.h> 25 27 #include <assert.h> … … 30 32 31 33 int gettimeofday( 32 33 34 struct timeval *tp, 35 struct timezone *tzp 34 36 ) 35 37 { … … 37 39 rtems_clock_time_value time; 38 40 39 if ( !tp || !tzp) {41 if ( !tp ) { 40 42 errno = EFAULT; 41 43 return -1; … … 52 54 tp->tv_usec = time.microseconds; 53 55 54 #if 055 tzp->minuteswest = timezone / 60; /* from seconds to minutes */56 tzp->dsttime = daylight;57 #endif58 59 56 /* 60 57 * newlib does not have timezone and daylight savings time … … 62 59 */ 63 60 64 tzp->tz_minuteswest = 0; /* at UTC */ 65 tzp->tz_dsttime = 0; /* no daylight savings */ 61 if ( tzp ) { 62 tzp->tz_minuteswest = 0; /* at UTC */ 63 tzp->tz_dsttime = 0; /* no daylight savings */ 64 #if 0 65 tzp->minuteswest = timezone / 60; /* from seconds to minutes */ 66 tzp->dsttime = daylight; 67 #endif 68 } 66 69 return 0; 67 70 } 68 71 72 #if defined(RTEMS_NEWLIB) 73 74 #if 0 69 75 /* 70 * "Reentrant" version s of the above routines implemented above.76 * "Reentrant" version 71 77 */ 72 78 73 #if 074 79 int _gettimeofday_r( 75 76 77 80 struct _reent *ignored_reentrancy_stuff, 81 struct timeval *tp, 82 struct timezone *tzp 78 83 ) 79 84 { … … 82 87 #endif 83 88 89 /* 90 * "System call" version 91 */ 92 93 int _gettimeofday( 94 struct timeval *tp, 95 struct timezone *tzp 96 ) 97 { 98 return gettimeofday( tp, tzp ); 99 } 100 101 #endif /* defined(RTEMS_NEWLIB) */ 102 84 103 #endif -
cpukit/libcsupport/src/newlibc.c
rbf61e45c r88d594a 1 1 /* 2 * @(#)newlibc.c 1. 8 - 95/04/252 * @(#)newlibc.c 1.9 - 95/05/16 3 3 * 4 4 */ … … 7 7 8 8 /* 9 * File: $RCSfile$9 * File: newlibc.c,v 10 10 * Project: PixelFlow 11 11 * Created: 94/12/7 12 * Revision: $Revision$13 * Last Mod: $Date$12 * Revision: 1.2 13 * Last Mod: 1995/05/09 20:24:37 14 14 * 15 15 * COPYRIGHT (c) 1994 by Division Incorporated … … 36 36 * NOTE: 37 37 * 38 * $Id$38 * newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp 39 39 * 40 40 */ -
cpukit/libmisc/stackchk/check.c
rbf61e45c r88d594a 330 330 */ 331 331 332 base += 4; 332 333 for (ebase = base + length; base < ebase; base++) 333 334 if (*base != U32_PATTERN) -
cpukit/rtems/src/rtemstimer.c
rbf61e45c r88d594a 147 147 return( RTEMS_INTERNAL_ERROR ); 148 148 case OBJECTS_LOCAL: 149 if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) {149 if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 150 150 (void) _Watchdog_Remove( &the_timer->Ticker ); 151 _Thread_Enable_dispatch(); 152 return( RTEMS_SUCCESSFUL ); 153 } 154 _Thread_Enable_dispatch(); 155 return( RTEMS_INCORRECT_STATE ); 151 _Thread_Enable_dispatch(); 152 return( RTEMS_SUCCESSFUL ); 156 153 } 157 154 -
cpukit/sapi/include/rtems/io.h
rbf61e45c r88d594a 188 188 189 189 rtems_status_code _IO_Handler_routine( 190 IO_operations operation,191 rtems_device_major_number major, 192 rtems_device_minor_number minor, 193 void *argument,194 unsigned32 *return_value190 IO_operations operation, 191 rtems_device_major_number major, 192 rtems_device_minor_number minor, 193 void *argument, 194 unsigned32 *return_value 195 195 ); 196 196 -
cpukit/sapi/src/exinit.c
rbf61e45c r88d594a 108 108 _CPU_Initialize( cpu_table, _Thread_Dispatch ); 109 109 110 /* 111 * Do this as early as possible to insure no debugging output 112 * is even attempted to be printed. 113 */ 114 115 _Debug_Manager_initialization(); 116 110 117 multiprocessing_table = configuration_table->User_multiprocessing_table; 111 118 if ( multiprocessing_table == NULL ) -
cpukit/sapi/src/io.c
rbf61e45c r88d594a 257 257 258 258 rtems_status_code _IO_Handler_routine( 259 IO_operations operation,260 rtems_device_major_number major, 261 rtems_device_minor_number minor, 262 void *argument,263 unsigned32 *return_value259 IO_operations operation, 260 rtems_device_major_number major, 261 rtems_device_minor_number minor, 262 void *argument, 263 unsigned32 *return_value 264 264 ) 265 265 { -
cpukit/score/cpu/hppa1.1/cpu.c
rbf61e45c r88d594a 15 15 * suitability of this software for any purpose. 16 16 * 17 * $Id$17 * cpu.c,v 1.2 1995/05/09 20:11:35 joel Exp 18 18 */ 19 19 -
cpukit/score/cpu/i386/asm.h
rbf61e45c r88d594a 32 32 33 33 #define ASM 34 #include < i386.h>34 #include <rtems/i386.h> 35 35 36 36 /* -
cpukit/score/cpu/i386/rtems/asm.h
rbf61e45c r88d594a 32 32 33 33 #define ASM 34 #include < i386.h>34 #include <rtems/i386.h> 35 35 36 36 /* -
cpukit/score/cpu/i960/asm.h
rbf61e45c r88d594a 32 32 33 33 #define ASM 34 #include < i960.h>34 #include <rtems/i960.h> 35 35 36 36 /* -
cpukit/score/cpu/m68k/asm.h
rbf61e45c r88d594a 32 32 33 33 #define ASM 34 #include < m68k.h>34 #include <rtems/m68k.h> 35 35 36 36 /* -
cpukit/score/cpu/m68k/rtems/asm.h
rbf61e45c r88d594a 32 32 33 33 #define ASM 34 #include < m68k.h>34 #include <rtems/m68k.h> 35 35 36 36 /* -
cpukit/score/cpu/no_cpu/asm.h
rbf61e45c r88d594a 32 32 33 33 #define ASM 34 #include < no_cpu.h>34 #include <rtems/no_cpu.h> 35 35 36 36 /* -
cpukit/score/cpu/no_cpu/rtems/asm.h
rbf61e45c r88d594a 32 32 33 33 #define ASM 34 #include < no_cpu.h>34 #include <rtems/no_cpu.h> 35 35 36 36 /* -
cpukit/score/cpu/unix/cpu.c
rbf61e45c r88d594a 36 36 #include <stdlib.h> 37 37 #include <unistd.h> 38 #include <string.h>39 38 #include <signal.h> 40 39 #include <time.h> … … 226 225 unsigned32 _size, 227 226 unsigned32 _new_level, 228 proc_ptr*_entry_point227 void *_entry_point 229 228 ) 230 229 { 231 230 unsigned32 *addr; 232 231 unsigned32 jmp_addr; 233 unsigned32 _stack; 232 unsigned32 _stack_low; /* lowest "stack aligned" address */ 233 unsigned32 _stack_high; /* highest "stack aligned" address */ 234 234 unsigned32 _the_size; 235 235 236 236 jmp_addr = (unsigned32) _entry_point; 237 237 238 _stack = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT); 239 _stack &= ~(CPU_STACK_ALIGNMENT - 1); 238 /* 239 * On CPUs with stacks which grow down, we build the stack 240 * based on the _stack_high address. On CPUs with stacks which 241 * grow up, we build the stack based on the _stack_low address. 242 */ 243 244 _stack_low = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT); 245 _stack_low &= ~(CPU_STACK_ALIGNMENT - 1); 246 247 _stack_high = ((unsigned32)(_stack_base) + _size); 248 _stack_high &= ~(CPU_STACK_ALIGNMENT - 1); 240 249 241 250 _the_size = _size & ~(CPU_STACK_ALIGNMENT - 1); … … 251 260 #if defined(hppa1_1) 252 261 *(addr + RP_OFF) = jmp_addr; 253 *(addr + SP_OFF) = (unsigned32)(_stack + CPU_FRAME_SIZE);262 *(addr + SP_OFF) = (unsigned32)(_stack_low + CPU_FRAME_SIZE); 254 263 255 264 /* … … 275 284 276 285 *(addr + RP_OFF) = jmp_addr + ADDR_ADJ_OFFSET; 277 *(addr + SP_OFF) = (unsigned32)(_stack +_the_size- CPU_FRAME_SIZE);278 *(addr + FP_OFF) = (unsigned32)(_stack +_the_size);286 *(addr + SP_OFF) = (unsigned32)(_stack_high - CPU_FRAME_SIZE); 287 *(addr + FP_OFF) = (unsigned32)(_stack_high); 279 288 #else 280 289 #error "UNKNOWN CPU!!!" -
cpukit/score/include/rtems/score/watchdog.h
rbf61e45c r88d594a 101 101 102 102 /* 103 * The following type isused for synchronization purposes103 * The following are used for synchronization purposes 104 104 * during an insert on a watchdog delta chain. 105 * 106 * NOTE: Watchdog_Pointer is only used to insure that 107 * Watchdog_Synchronization_pointer is a pointer 108 * which is volatile rather than a pointer to a 109 * volatile block of memory. 110 */ 111 112 typedef Watchdog_Control *Watchdog_Pointer; 113 typedef volatile Watchdog_Pointer Watchdog_Synchronization_pointer; 105 */ 106 107 volatile unsigned32 _Watchdog_Sync_level; 108 volatile unsigned32 _Watchdog_Sync_count; 114 109 115 110 /* … … 120 115 EXTERN Chain_Control _Watchdog_Ticks_chain; 121 116 EXTERN Chain_Control _Watchdog_Seconds_chain; 122 123 /*124 * The following defines the synchronization variable used to125 * allow interrupts to be enabled while inserting a watchdog126 * on a watchdog chain.127 */128 129 EXTERN Watchdog_Synchronization_pointer _Watchdog_Sync;130 117 131 118 /* … … 377 364 378 365 /* 379 *380 * _Watchdog_Get_sync381 *382 * DESCRIPTION:383 *384 * This routine returns the current synchronization timer. This385 * routine is used so that interrupts can be enabled while a386 * watchdog timer is being inserted into a watchdog chain.387 */388 389 STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void );390 391 /*392 *393 * _Watchdog_Set_sync394 *395 * DESCRIPTION:396 *397 * This routine sets the current synchronization timer. This398 * routine is used so that interrupts can be enabled while a399 * watchdog timer is being inserted into a watchdog chain.400 */401 402 STATIC INLINE void _Watchdog_Set_sync(403 Watchdog_Control *the_watchdog404 );405 406 /*407 *408 * _Watchdog_Clear_sync409 *410 * DESCRIPTION:411 *412 * This routine will set the watchdog synchronization flag to a413 * NULL address indicating synchronization is unnecessary.414 */415 416 STATIC INLINE void _Watchdog_Clear_sync( void );417 418 /*419 366 * _Watchdog_Adjust 420 367 * … … 428 375 Chain_Control *header, 429 376 Watchdog_Adjust_directions direction, 430 rtems_interval units377 rtems_interval units 431 378 ); 432 379 -
cpukit/score/inline/rtems/score/watchdog.inl
rbf61e45c r88d594a 258 258 } 259 259 260 /*PAGE261 *262 * _Watchdog_Get_sync263 *264 */265 266 STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void )267 {268 return (Watchdog_Control *) _Watchdog_Sync;269 }270 271 /*PAGE272 *273 * _Watchdog_Set_sync274 *275 */276 277 STATIC INLINE void _Watchdog_Set_sync(278 Watchdog_Control *the_watchdog279 )280 {281 _Watchdog_Sync = (Watchdog_Synchronization_pointer) the_watchdog;282 }283 284 /*PAGE285 *286 * _Watchdog_Clear_sync287 *288 */289 290 STATIC INLINE void _Watchdog_Clear_sync( void )291 {292 _Watchdog_Sync = NULL;293 }294 295 260 #endif 296 261 /* end of include file */ -
cpukit/score/macros/rtems/score/watchdog.inl
rbf61e45c r88d594a 172 172 ((Watchdog_Control *) (_header)->last) 173 173 174 /*PAGE175 *176 * _Watchdog_Get_sync177 *178 */179 180 #define _Watchdog_Get_sync() \181 ((Watchdog_Control *) _Watchdog_Sync)182 183 /*PAGE184 *185 * _Watchdog_Set_sync186 *187 */188 189 #define _Watchdog_Set_sync( _the_watchdog ) \190 _Watchdog_Sync = (Watchdog_Synchronization_pointer) (_the_watchdog)191 192 /*PAGE193 *194 * _Watchdog_Clear_sync195 *196 */197 198 #define _Watchdog_Clear_sync() \199 _Watchdog_Sync = NULL;200 201 174 #endif 202 175 /* end of include file */ -
cpukit/score/src/heap.c
rbf61e45c r88d594a 117 117 { 118 118 Heap_Block *the_block; 119 Heap_Block *next_block; 120 Heap_Block *previous_block; 119 120 /* 121 * The overhead was taken from the original heap memory. 122 */ 123 124 Heap_Block *old_final; 125 Heap_Block *new_final; 121 126 122 127 /* … … 151 156 /* 152 157 * Currently only case 4 should make it to this point. 153 */ 154 155 *amount_extended = size - HEAP_BLOCK_USED_OVERHEAD; 156 157 previous_block = the_heap->last; 158 159 the_block = (Heap_Block *) starting_address; 160 the_block->front_flag = size; 161 the_block->next = previous_block->next; 162 the_block->previous = previous_block; 163 164 previous_block->next = the_block; 165 the_heap->last = the_block; 166 167 next_block = _Heap_Next_block( the_block ); 168 next_block->back_flag = size; 169 next_block->front_flag = HEAP_DUMMY_FLAG; 170 the_heap->final = next_block; 158 * The basic trick is to make the extend area look like a used 159 * block and free it. 160 */ 161 162 *amount_extended = size; 163 164 old_final = the_heap->final; 165 new_final = _Addresses_Add_offset( old_final, size ); 166 /* SAME AS: _Addresses_Add_offset( starting_address, size-HEAP_OVERHEAD ); */ 167 168 the_heap->final = new_final; 169 170 old_final->front_flag = 171 new_final->back_flag = _Heap_Build_flag( size, HEAP_BLOCK_USED ); 172 new_final->front_flag = HEAP_DUMMY_FLAG; 173 174 /* 175 * Must pass in address of "user" area 176 */ 177 178 _Heap_Free( the_heap, &old_final->next ); 171 179 172 180 return HEAP_EXTEND_SUCCESSFUL; … … 393 401 ) 394 402 { 395 Heap_Block *the_block ;396 Heap_Block *next_block ;403 Heap_Block *the_block = 0; /* avoid warnings */ 404 Heap_Block *next_block = 0; /* avoid warnings */ 397 405 int notdone = 1; 398 406 -
cpukit/score/src/watchdog.c
rbf61e45c r88d594a 31 31 void _Watchdog_Handler_initialization( void ) 32 32 { 33 _Watchdog_Clear_sync(); 33 _Watchdog_Sync_count = 0; 34 _Watchdog_Sync_level = 0; 34 35 _Chain_Initialize_empty( &_Watchdog_Ticks_chain ); 35 36 _Chain_Initialize_empty( &_Watchdog_Seconds_chain ); … … 57 58 case WATCHDOG_INACTIVE: 58 59 break; 60 61 case WATCHDOG_REINSERT: 62 63 /* 64 * It is not actually on the chain so just change the state and 65 * the Insert operation we interrupted will be aborted. 66 */ 67 the_watchdog->state = WATCHDOG_INACTIVE; 68 break; 69 59 70 case WATCHDOG_ACTIVE: 60 case WATCHDOG_REINSERT:61 71 case WATCHDOG_REMOVE_IT: 62 72 … … 67 77 next_watchdog->delta_interval += the_watchdog->delta_interval; 68 78 69 if ( the_watchdog == _Watchdog_Sync)70 _Watchdog_Sync = _Watchdog_Previous( the_watchdog );79 if ( _Watchdog_Sync_count ) 80 _Watchdog_Sync_level = _ISR_Nest_level; 71 81 72 82 _Chain_Extract_unprotected( &the_watchdog->Node ); … … 95 105 Chain_Control *header, 96 106 Watchdog_Adjust_directions direction, 97 rtems_interval units107 rtems_interval units 98 108 ) 99 109 { … … 137 147 ISR_Level level; 138 148 Watchdog_Control *after; 139 140 the_watchdog->state = WATCHDOG_REINSERT; 141 the_watchdog->delta_interval = the_watchdog->initial; 149 unsigned32 insert_isr_nest_level; 150 rtems_interval delta_interval; 151 152 153 insert_isr_nest_level = _ISR_Nest_level; 154 the_watchdog->state = WATCHDOG_REINSERT; 155 156 _Watchdog_Sync_count++; 157 restart: 158 delta_interval = the_watchdog->initial; 142 159 143 160 _ISR_Disable( level ); … … 145 162 for ( after = _Watchdog_First( header ) ; 146 163 ; 147 after = _Watchdog_Next( _Watchdog_Get_sync()) ) {148 149 if ( the_watchdog->delta_interval == 0 || !_Watchdog_Next( after ) )164 after = _Watchdog_Next( after ) ) { 165 166 if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 150 167 break; 151 168 152 if ( the_watchdog->delta_interval < after->delta_interval ) {153 after->delta_interval -= the_watchdog->delta_interval;169 if ( delta_interval < after->delta_interval ) { 170 after->delta_interval -= delta_interval; 154 171 break; 155 172 } 156 173 157 the_watchdog->delta_interval -= after->delta_interval; 158 _Watchdog_Set_sync( after ); 174 delta_interval -= after->delta_interval; 159 175 160 176 /* 161 * If you experience problems comment out the _ISR_Flash line. Under 162 * certain circumstances, this flash allows interrupts to execute 163 * which violate the design assumptions. The critical section 164 * mechanism used here must be redesigned to address this. 177 * If you experience problems comment out the _ISR_Flash line. This 178 * (3.2.0) is the first release with this critical section redesigned. 179 * Under certain circumstances, the PREVIOUS critical section algorithm 180 * used around this flash point allows interrupts to execute 181 * which violated the design assumptions. The critical section 182 * mechanism used here WAS redesigned to address this. 165 183 */ 166 184 167 185 _ISR_Flash( level ); 186 187 if ( the_watchdog->state != WATCHDOG_REINSERT ) { 188 goto exit_insert; 189 } 190 191 if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 192 _Watchdog_Sync_level = insert_isr_nest_level; 193 _ISR_Enable( level ); 194 goto restart; 195 } 168 196 } 169 197 … … 171 199 _Watchdog_Activate( the_watchdog ); 172 200 201 the_watchdog->delta_interval = delta_interval; 202 173 203 _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 174 204 175 _Watchdog_Clear_sync(); 176 177 _ISR_Enable( level ); 205 exit_insert: 206 _Watchdog_Sync_level = insert_isr_nest_level; 207 _Watchdog_Sync_count--; 208 _ISR_Enable( level ); 178 209 } 179 210
Note: See TracChangeset
for help on using the changeset viewer.