Changeset c64e4ed4 in rtems for c/src/exec
- Timestamp:
- 01/15/96 21:50:28 (27 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- a625ccd
- Parents:
- 5c491aef
- Location:
- c/src/exec
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libcsupport/include/rtems/assoc.h
r5c491aef rc64e4ed4 1 1 /* 2 * @(#)assoc.h 1. 2 - 95/06/282 * @(#)assoc.h 1.4 - 95/10/25 3 3 * 4 4 * … … 14 14 15 15 typedef struct { 16 c har*name;16 const char *name; 17 17 unsigned32 local_value; 18 18 unsigned32 remote_value; … … 25 25 #define RTEMS_ASSOC_DEFAULT_NAME "(default)" 26 26 27 rtems_assoc_t *rtems_assoc_ptr_by_name(rtems_assoc_t *,char *);28 rtems_assoc_t *rtems_assoc_ptr_by_value(rtems_assoc_t *, unsigned32);29 rtems_assoc_t *rtems_assoc_ptr_by_remote(rtems_assoc_t *, unsigned32);27 const rtems_assoc_t *rtems_assoc_ptr_by_name(const rtems_assoc_t *, const char *); 28 const rtems_assoc_t *rtems_assoc_ptr_by_value(const rtems_assoc_t *, unsigned32); 29 const rtems_assoc_t *rtems_assoc_ptr_by_remote(const rtems_assoc_t *, unsigned32); 30 30 31 unsigned32 rtems_assoc_remote_by_local( rtems_assoc_t *, unsigned32);32 unsigned32 rtems_assoc_local_by_remote( rtems_assoc_t *, unsigned32);33 unsigned32 rtems_assoc_remote_by_name( rtems_assoc_t *,char *);34 unsigned32 rtems_assoc_local_by_name( rtems_assoc_t *,char *);35 c har *rtems_assoc_name_by_local(rtems_assoc_t *, unsigned32);36 c har *rtems_assoc_name_by_remote(rtems_assoc_t *, unsigned32);31 unsigned32 rtems_assoc_remote_by_local(const rtems_assoc_t *, unsigned32); 32 unsigned32 rtems_assoc_local_by_remote(const rtems_assoc_t *, unsigned32); 33 unsigned32 rtems_assoc_remote_by_name(const rtems_assoc_t *, const char *); 34 unsigned32 rtems_assoc_local_by_name(const rtems_assoc_t *, const char *); 35 const char *rtems_assoc_name_by_local(const rtems_assoc_t *, unsigned32); 36 const char *rtems_assoc_name_by_remote(const rtems_assoc_t *, unsigned32); 37 37 38 unsigned32 rtems_assoc_remote_by_local_bitfield( rtems_assoc_t *, unsigned32);39 char *rtems_assoc_name_by_local_bitfield(rtems_assoc_t *, unsigned32, char *);40 char *rtems_assoc_name_by_remote_bitfield(rtems_assoc_t *, unsigned32, char *);41 unsigned32 rtems_assoc_local_by_remote_bitfield( rtems_assoc_t *ap, unsigned32);38 unsigned32 rtems_assoc_remote_by_local_bitfield(const rtems_assoc_t *, unsigned32); 39 char *rtems_assoc_name_by_local_bitfield(const rtems_assoc_t *, unsigned32, char *); 40 char *rtems_assoc_name_by_remote_bitfield(const rtems_assoc_t *, unsigned32, char *); 41 unsigned32 rtems_assoc_local_by_remote_bitfield(const rtems_assoc_t *, unsigned32); 42 42 43 43 -
c/src/exec/libcsupport/include/rtems/error.h
r5c491aef rc64e4ed4 1 1 2 /* 2 * @(#)error.h 1. 1 - 95/08/023 * @(#)error.h 1.3 - 95/10/25 3 4 * 4 5 * … … 7 8 * $Id$ 8 9 */ 10 11 #ifndef __RTEMS_ERROR_h 12 #define __RTEMS_ERROR_h 9 13 10 14 /* … … 19 23 RTEMS_ERROR_PANIC) /* all */ 20 24 21 c har *rtems_status_text(rtems_status_code);22 int rtems_error(int error_code, c har *printf_format, ...);23 void rtems_panic(c har *printf_format, ...);25 const char *rtems_status_text(rtems_status_code); 26 int rtems_error(int error_code, const char *printf_format, ...); 27 void rtems_panic(const char *printf_format, ...); 24 28 25 29 extern int rtems_panic_in_progress; 26 30 31 #endif 32 /* end of include file */ -
c/src/exec/libcsupport/include/rtems/libcsupport.h
r5c491aef rc64e4ed4 30 30 ); 31 31 32 extern void malloc_dump(void); 32 33 extern void libc_init(int reentrant); 34 extern int host_errno(void); 35 extern void fix_syscall_errno(void); 33 36 34 37 #ifdef __cplusplus … … 36 39 #endif 37 40 38 extern int host_errno(void);39 extern void fix_syscall_errno(void);40 41 41 #endif 42 42 /* end of include file */ -
c/src/exec/libcsupport/src/assoc.c
r5c491aef rc64e4ed4 1 1 /* 2 * @(#)assoc.c 1. 4 - 95/08/023 * 2 * @(#)assoc.c 1.6 - 95/10/25 3 * 4 4 * 5 5 * assoc.c … … 9 9 */ 10 10 11 12 11 #include <rtems.h> 13 12 #include "assoc.h" … … 19 18 #define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME)) 20 19 21 rtems_assoc_t *20 const rtems_assoc_t * 22 21 rtems_assoc_ptr_by_name( 23 rtems_assoc_t *ap,24 c har *name25 ) 26 { 27 rtems_assoc_t *default_ap = 0;22 const rtems_assoc_t *ap, 23 const char *name 24 ) 25 { 26 const rtems_assoc_t *default_ap = 0; 28 27 29 28 if (rtems_assoc_is_default(ap)) … … 37 36 } 38 37 39 rtems_assoc_t *38 const rtems_assoc_t * 40 39 rtems_assoc_ptr_by_local( 41 rtems_assoc_t *ap,42 unsigned32 local_value 43 ) 44 { 45 rtems_assoc_t *default_ap = 0;40 const rtems_assoc_t *ap, 41 unsigned32 local_value 42 ) 43 { 44 const rtems_assoc_t *default_ap = 0; 46 45 47 46 if (rtems_assoc_is_default(ap)) … … 56 55 57 56 58 rtems_assoc_t *57 const rtems_assoc_t * 59 58 rtems_assoc_ptr_by_remote( 60 rtems_assoc_t *ap,61 unsigned32 remote_value 62 ) 63 { 64 rtems_assoc_t *default_ap = 0;59 const rtems_assoc_t *ap, 60 unsigned32 remote_value 61 ) 62 { 63 const rtems_assoc_t *default_ap = 0; 65 64 66 65 if (rtems_assoc_is_default(ap)) … … 81 80 unsigned32 82 81 rtems_assoc_remote_by_local( 83 rtems_assoc_t *ap,84 unsigned32 local_value 85 ) 86 { 87 rtems_assoc_t *nap;82 const rtems_assoc_t *ap, 83 unsigned32 local_value 84 ) 85 { 86 const rtems_assoc_t *nap; 88 87 nap = rtems_assoc_ptr_by_local(ap, local_value); 89 88 if (nap) … … 95 94 unsigned32 96 95 rtems_assoc_local_by_remote( 97 rtems_assoc_t *ap,98 unsigned32 remote_value 99 ) 100 { 101 rtems_assoc_t *nap;96 const rtems_assoc_t *ap, 97 unsigned32 remote_value 98 ) 99 { 100 const rtems_assoc_t *nap; 102 101 nap = rtems_assoc_ptr_by_remote(ap, remote_value); 103 102 if (nap) … … 109 108 unsigned32 110 109 rtems_assoc_remote_by_name( 111 rtems_assoc_t *ap,112 c har *name113 ) 114 { 115 rtems_assoc_t *nap;110 const rtems_assoc_t *ap, 111 const char *name 112 ) 113 { 114 const rtems_assoc_t *nap; 116 115 nap = rtems_assoc_ptr_by_name(ap, name); 117 116 if (nap) … … 123 122 unsigned32 124 123 rtems_assoc_local_by_name( 125 rtems_assoc_t *ap,126 c har *name127 ) 128 { 129 rtems_assoc_t *nap;124 const rtems_assoc_t *ap, 125 const char *name 126 ) 127 { 128 const rtems_assoc_t *nap; 130 129 nap = rtems_assoc_ptr_by_name(ap, name); 131 130 if (nap) … … 140 139 */ 141 140 142 c har *141 const char * 143 142 rtems_assoc_name_bad( 144 143 unsigned32 bad_value 145 144 ) 146 145 { 146 #ifdef RTEMS_DEBUG 147 147 static char bad_buffer[32]; 148 148 149 149 sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value); 150 #else 151 static char bad_buffer[32] = "<assoc.c: BAD NAME>"; 152 #endif 150 153 return bad_buffer; 151 154 } 152 155 153 156 154 c har *157 const char * 155 158 rtems_assoc_name_by_local( 156 rtems_assoc_t *ap,157 unsigned32 local_value 158 ) 159 { 160 rtems_assoc_t *nap;159 const rtems_assoc_t *ap, 160 unsigned32 local_value 161 ) 162 { 163 const rtems_assoc_t *nap; 161 164 nap = rtems_assoc_ptr_by_local(ap, local_value); 162 165 if (nap) … … 166 169 } 167 170 168 c har *171 const char * 169 172 rtems_assoc_name_by_remote( 170 rtems_assoc_t *ap,171 unsigned32 remote_value 172 ) 173 { 174 rtems_assoc_t *nap;173 const rtems_assoc_t *ap, 174 unsigned32 remote_value 175 ) 176 { 177 const rtems_assoc_t *nap; 175 178 nap = rtems_assoc_ptr_by_remote(ap, remote_value); 176 179 if (nap) … … 186 189 187 190 unsigned32 rtems_assoc_remote_by_local_bitfield( 188 rtems_assoc_t *ap,191 const rtems_assoc_t *ap, 189 192 unsigned32 local_value 190 193 ) … … 202 205 203 206 unsigned32 rtems_assoc_local_by_remote_bitfield( 204 rtems_assoc_t *ap,207 const rtems_assoc_t *ap, 205 208 unsigned32 remote_value 206 209 ) … … 216 219 } 217 220 218 char *rtems_assoc_name_by_remote_bitfield( 219 rtems_assoc_t *ap, 221 char * 222 rtems_assoc_name_by_remote_bitfield( 223 const rtems_assoc_t *ap, 220 224 unsigned32 value, 221 225 char *buffer … … 237 241 } 238 242 239 char *rtems_assoc_name_by_local_bitfield( 240 rtems_assoc_t *ap, 243 char * 244 rtems_assoc_name_by_local_bitfield( 245 const rtems_assoc_t *ap, 241 246 unsigned32 value, 242 247 char *buffer -
c/src/exec/libcsupport/src/error.c
r5c491aef rc64e4ed4 1 1 /* 2 * @(#)error.c 1. 2 - 95/08/022 * @(#)error.c 1.6 - 95/12/12 3 3 * 4 4 * 5 * report errors and panics to RTEMS' stderr. 6 * Currently just used by RTEMS monitor. 7 * 5 * report errors and panics to RTEMS' stderr. 6 * Currently just used by RTEMS monitor. 8 7 * 9 8 * $Id$ … … 98 97 99 98 100 c har *99 const char * 101 100 rtems_status_text( 102 101 rtems_status_code status … … 109 108 static int rtems_verror( 110 109 unsigned32 error_flag, 111 c har*printf_format,110 const char *printf_format, 112 111 va_list arglist 113 112 ) … … 182 181 int rtems_error( 183 182 int error_flag, 184 c har *printf_format,183 const char *printf_format, 185 184 ... 186 185 ) … … 201 200 202 201 void rtems_panic( 203 c har *printf_format,202 const char *printf_format, 204 203 ... 205 204 ) -
c/src/exec/libcsupport/src/libio.c
r5c491aef rc64e4ed4 16 16 #include <stdio.h> /* O_RDONLY, et.al. */ 17 17 #include <fcntl.h> /* O_RDONLY, et.al. */ 18 #include <sys/fcntl.h> /* O_RDONLY, et.al. */ 18 19 19 #if defined(solaris2) 20 20 #define O_NDELAY O_NONBLOCK … … 22 22 #define O_NDELAY _FNBIO 23 23 #endif 24 24 25 #include <errno.h> 25 26 #include <string.h> /* strcmp */ … … 209 210 rc = rtems_semaphore_create( 210 211 RTEMS_LIBIO_IOP_SEM(iop - rtems_libio_iops), 211 1, 212 1, 212 213 RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, 213 214 RTEMS_NO_PRIORITY, -
c/src/exec/libcsupport/src/no_libc.c
r5c491aef rc64e4ed4 1 #if !defined(RTEMS_ LIBC) && !defined(RTEMS_NEWLIB) && !defined(RTEMS_UNIX)1 #if !defined(RTEMS_NEWLIB) && !defined(RTEMS_UNIX) 2 2 3 3 /* no_libc.h -
c/src/exec/rtems/headers/types.h
r5c491aef rc64e4ed4 34 34 typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */ 35 35 typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */ 36 typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */37 36 38 37 typedef signed8 rtems_signed8; /* signed 8-bit value */ 39 38 typedef signed16 rtems_signed16; /* signed 16-bit value */ 40 39 typedef signed32 rtems_signed32; /* signed 32-bit value */ 40 41 /* 42 * some C++ compilers (eg: HP's) don't do 'long long' 43 */ 44 #if defined(__GNUC__) 45 typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */ 41 46 typedef signed64 rtems_signed64; /* signed 64-bit value */ 47 #endif 42 48 43 49 typedef single_precision rtems_single; /* single precision float */ -
c/src/exec/rtems/include/rtems/rtems/types.h
r5c491aef rc64e4ed4 34 34 typedef unsigned16 rtems_unsigned16; /* unsigned 16-bit value */ 35 35 typedef unsigned32 rtems_unsigned32; /* unsigned 32-bit value */ 36 typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */37 36 38 37 typedef signed8 rtems_signed8; /* signed 8-bit value */ 39 38 typedef signed16 rtems_signed16; /* signed 16-bit value */ 40 39 typedef signed32 rtems_signed32; /* signed 32-bit value */ 40 41 /* 42 * some C++ compilers (eg: HP's) don't do 'long long' 43 */ 44 #if defined(__GNUC__) 45 typedef unsigned64 rtems_unsigned64; /* unsigned 64-bit value */ 41 46 typedef signed64 rtems_signed64; /* signed 64-bit value */ 47 #endif 42 48 43 49 typedef single_precision rtems_single; /* single precision float */ -
c/src/exec/score/cpu/hppa1.1/cpu.c
r5c491aef rc64e4ed4 25 25 void hppa_external_interrupt_disable(unsigned32); 26 26 void hppa_external_interrupt(unsigned32, CPU_Interrupt_frame *); 27 28 /* 29 * Our interrupt handlers take a 2nd argument: 30 * a pointer to a CPU_Interrupt_frame 31 * So we use our own prototype instead of rtems_isr_entry 32 */ 33 34 typedef void ( *hppa_rtems_isr_entry )( 35 ISR_Vector_number, 36 CPU_Interrupt_frame * 37 ); 38 39 40 /* 41 * who are we? cpu number 42 * Not used by executive proper, just kept (or not) as a convenience 43 * for libcpu and libbsp stuff that wants it. 44 * 45 * Defaults to 0. If the BSP doesn't like it, it can change it. 46 */ 47 48 int cpu_number; /* from 0; cpu number in a multi cpu system */ 49 27 void hppa_cpu_halt(unsigned32); 28 29 /* 30 * The first level interrupt handler for first 32 interrupts/traps. 31 * Indexed by vector; generally each entry is _Generic_ISR_Handler. 32 * Some TLB traps may have their own first level handler. 33 */ 34 35 extern void _Generic_ISR_Handler(void); 36 unsigned32 HPPA_first_level_interrupt_handler[HPPA_INTERNAL_INTERRUPTS]; 50 37 51 38 /* _CPU_Initialize … … 87 74 88 75 /* 76 * Init the first level interrupt handlers 77 */ 78 79 for (i=0; i <= HPPA_INTERNAL_INTERRUPTS; i++) 80 HPPA_first_level_interrupt_handler[i] = (unsigned32) _Generic_ISR_Handler; 81 82 /* 83 * Init the 2nd level interrupt handlers 84 */ 85 86 for (i=0; i <= CPU_INTERRUPT_NUMBER_OF_VECTORS; i++) 87 _ISR_Vector_table[i] = (ISR_Handler_entry) hppa_cpu_halt; 88 89 /* 89 90 * Stabilize the interrupt stuff 90 91 */ … … 97 98 98 99 iva_table = (unsigned32) IVA_Table; 100 #if defined(hppa1_1) 101 /* 102 * HACK: (from PA72000 TRM, page 4-19) 103 * "The hardware TLB miss handler will never attempt to service 104 * a non-access TLB miss or a TLB protection violation. It 105 * will only attempt to service TLB accesses that would cause 106 * Trap Numbers 6 (Instruction TLB miss) and 15 (Data TLB miss)." 107 * 108 * The LPA instruction is used to translate a virtual address to 109 * a physical address, however, if the requested virtual address 110 * is not currently resident in the TLB, the hardware TLB miss 111 * handler will NOT insert it. In this situation Trap Number 112 * #17 is invoked (Non-access Data TLB miss fault). 113 * 114 * To work around this, a dummy data access is first performed 115 * to the virtual address prior to the LPA. The dummy access 116 * causes the TLB entry to be inserted (if not already present) 117 * and then the following LPA instruction will not generate 118 * a non-access data TLB miss fault. 119 * 120 * It is unclear whether or not this behaves the same way for 121 * the PA8000. 122 * 123 */ 124 iva = *(volatile unsigned32 *)iva_table; /* dummy access */ 125 #endif 126 99 127 HPPA_ASM_LPA(0, iva_table, iva); 100 128 set_iva(iva); … … 113 141 HPPA_ASM_SSM(0, level); /* change no bits; just get copy */ 114 142 if (level & HPPA_PSW_I) 115 return 1;116 return 0;143 return 0; 144 return 1; 117 145 } 118 146 … … 185 213 * 186 214 * TODO: 187 * delete interrupt.c etc.188 215 * Count interrupts 189 216 * make sure interrupts disabled properly 190 * should handler check again for more interrupts before exit?191 * How to enable interrupts from an interrupt handler?192 * Make sure there is an entry for everything in ISR_Vector_Table193 217 */ 194 218 … … 209 233 210 234 /* mark them all unused */ 211 212 235 DISABLE(~0); 213 236 DISMISS(~0); 214 237 215 238 /* install the external interrupt handler */ 216 _CPU_ISR_install_vector( 217 HPPA_INTERRUPT_EXTERNAL_INTERRUPT, 218 (proc_ptr)hppa_external_interrupt, 219 &ignore 220 ); 239 _CPU_ISR_install_vector( 240 HPPA_INTERRUPT_EXTERNAL_INTERRUPT, 241 (proc_ptr)hppa_external_interrupt, &ignore 242 ); 221 243 } 222 244 … … 257 279 vector, iframe->Interrupt.pcoqfront); 258 280 */ 259 DISMISS(VECTOR_TO_MASK(vector)); 260 DISABLE(VECTOR_TO_MASK(vector)); 261 } 262 263 void 264 hppa_external_interrupt_report_spurious(unsigned32 spurious, 281 } 282 283 void 284 hppa_external_interrupt_report_spurious(unsigned32 spurious_mask, 265 285 CPU_Interrupt_frame *iframe) 266 286 { 267 287 int v; 268 288 for (v=0; v < HPPA_EXTERNAL_INTERRUPTS; v++) 269 if (VECTOR_TO_MASK(v) & spurious) 289 if (VECTOR_TO_MASK(v) & spurious_mask) 290 { 291 DISMISS(VECTOR_TO_MASK(v)); 292 DISABLE(VECTOR_TO_MASK(v)); 270 293 hppa_external_interrupt_spurious_handler(v, iframe); 271 DISMISS(spurious); 294 } 295 DISMISS(spurious_mask); 272 296 } 273 297 … … 305 329 DISMISS(m); 306 330 mask &= ~m; 307 (*handler)(global_vector, iframe);331 handler(global_vector, iframe); 308 332 } 309 333 } … … 311 335 if (mask != 0) { 312 336 if ( _CPU_Table.spurious_handler ) 313 (*((hppa_rtems_isr_entry) _CPU_Table.spurious_handler))(314 mask,315 iframe316 );337 { 338 handler = (hppa_rtems_isr_entry) _CPU_Table.spurious_handler; 339 handler(mask, iframe); 340 } 317 341 else 318 hppa_external_interrupt_report_spurious(mask, iframe);342 hppa_external_interrupt_report_spurious(mask, iframe); 319 343 } 320 344 } … … 331 355 332 356 void 333 hppa_cpu_halt(unsigned32 type_of_halt, 334 unsigned32 the_error) 357 hppa_cpu_halt(unsigned32 the_error) 335 358 { 336 359 unsigned32 isrlevel; … … 338 361 _CPU_ISR_Disable(isrlevel); 339 362 340 asm volatile( "copy %0,%%r1" : : "r" (the_error));363 HPPA_ASM_LABEL("_hppa_cpu_halt"); 341 364 HPPA_ASM_BREAK(1, 0); 342 365 } -
c/src/exec/score/cpu/hppa1.1/cpu.h
r5c491aef rc64e4ed4 197 197 198 198 /* 199 * Our interrupt handlers take a 2nd argument: 200 * a pointer to a CPU_Interrupt_frame 201 * So we use our own prototype instead of rtems_isr_entry 202 */ 203 204 typedef void ( *hppa_rtems_isr_entry )( 205 unsigned32, 206 CPU_Interrupt_frame * 207 ); 208 209 /* 199 210 * The following table contains the information required to configure 200 211 * the HPPA specific parameters. … … 227 238 unsigned32 external_interrupt[HPPA_EXTERNAL_INTERRUPTS]; 228 239 229 void (*spurious_handler)( unsigned32 mask, CPU_Interrupt_frame *);240 hppa_rtems_isr_entry spurious_handler; 230 241 231 242 unsigned32 itimer_clicks_per_microsecond; /* for use by Clock driver */ … … 239 250 EXTERN void *_CPU_Interrupt_stack_high; 240 251 252 /* entry points */ 253 void hppa_external_interrupt_spurious_handler(unsigned32, CPU_Interrupt_frame *); 254 241 255 #endif /* ! ASM */ 242 256 243 257 /* 244 * context size area for floating point258 * context sizes 245 259 */ 246 260 247 261 #ifndef ASM 248 #define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp ) 262 #define CPU_CONTEXT_SIZE sizeof( Context_Control ) 263 #define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp ) 249 264 #endif 250 265 … … 440 455 */ 441 456 442 void hppa_cpu_halt(unsigned32 t ype_of_halt, unsigned32 the_error);457 void hppa_cpu_halt(unsigned32 the_error); 443 458 #define _CPU_Fatal_halt( _error ) \ 444 hppa_cpu_halt( 0,_error)459 hppa_cpu_halt(_error) 445 460 446 461 /* end of Fatal Error manager macros */ -
c/src/exec/score/cpu/hppa1.1/cpu_asm.s
r5c491aef rc64e4ed4 50 50 isr_arg0 .reg %cr24 51 51 isr_r9 .reg %cr25 52 isr_r8 .reg %cr26 52 53 53 54 # … … 106 107 # The following macro and the 32 instantiations of the macro 107 108 # are necessary to determine which interrupt vector occurred. 108 # The following macro allows a unique entry point to be defined 109 # for each vector. 110 # 111 # r9 was loaded with the vector before branching here 112 # scratch registers available: gr1, gr8, gr9, gr16, gr17, gr24 113 # 114 # NOTE: 115 # .align 32 doesn not seem to work in the continuation below 116 # so just have to count 8 instructions 117 # 118 # NOTE: 119 # this whole scheme needs to be rethought for TLB traps which 120 # have requirements about what tlb faults they can incur. 121 # ref: TLB Operation Requirements in 1.1 arch book 109 # 110 # r9 is loaded with the vector number and then we jump to 111 # the first level interrupt handler. In most cases this 112 # is _Generic_ISR_Handler. In a few cases (such as TLB misc) 113 # it may be to some other entry point. 114 # 115 116 # table for first level interrupt handlers 117 .import HPPA_first_level_interrupt_handler, data 122 118 123 119 #define THANDLER(vector) \ 124 mtctl %r9, isr_r9 ! 125 b _Generic_ISR_Handler!\126 ldi vector, %r9 !\127 nop! \128 nop! \129 nop! \130 nop! \131 nop120 mtctl %r9, isr_r9 ! \ 121 mtctl %r8, isr_r8 ! \ 122 ldi vector, %r9 ! \ 123 ldil L%HPPA_first_level_interrupt_handler,%r8 ! \ 124 ldo R%HPPA_first_level_interrupt_handler(%r8),%r8 ! \ 125 ldwx,s %r9(%r8),%r8 ! \ 126 bv 0(%r8) ! \ 127 mfctl isr_r8, %r8 132 128 133 129 .align 4096 … … 211 207 .ENTRY 212 208 213 # Turn on the D bit in psw so we can start saving stuff on stack214 # (interrupt context pieces that need to be saved before the RFI)215 216 ssm HPPA_PSW_D, %r0217 209 mtctl arg0, isr_arg0 218 210 … … 236 228 mfctl %sar, arg0 237 229 stw arg0, SAR_OFFSET(sp) 238 239 # Prepare to re-enter virtual mode240 # We need Q in case the interrupt handler enables interrupts241 #242 243 ldil L%CPU_PSW_DEFAULT, arg0244 ldo R%CPU_PSW_DEFAULT(arg0), arg0245 mtctl arg0, ipsw246 247 # Now jump to "rest_of_isr_handler" with the rfi248 # We are assuming the space queues are all correct already249 250 ldil L%rest_of_isr_handler, arg0251 ldo R%rest_of_isr_handler(arg0), arg0252 mtctl arg0, pcoq253 ldo 4(arg0), arg0254 mtctl arg0, pcoq255 256 rfi257 nop258 259 # At this point we are back in virtual mode and all our260 # normal addressing is once again ok.261 262 rest_of_isr_handler:263 230 264 231 # … … 282 249 stw %r7,R7_OFFSET(sp) 283 250 stw %r8,R8_OFFSET(sp) 284 stw %r9,R9_OFFSET(sp) 251 # skip r9 285 252 stw %r10,R10_OFFSET(sp) 286 253 stw %r11,R11_OFFSET(sp) … … 299 266 stw %r24,R24_OFFSET(sp) 300 267 stw %r25,R25_OFFSET(sp) 301 stw %r26,R26_OFFSET(sp) 268 # skip arg0 302 269 stw %r27,R27_OFFSET(sp) 303 270 stw %r28,R28_OFFSET(sp) … … 325 292 # At this point we are done with isr_arg0, and isr_r9 control registers 326 293 # 327 294 # Prepare to re-enter virtual mode 295 # We need Q in case the interrupt handler enables interrupts 296 # 297 298 ldil L%CPU_PSW_DEFAULT, arg0 299 ldo R%CPU_PSW_DEFAULT(arg0), arg0 300 mtctl arg0, ipsw 301 302 # Now jump to "rest_of_isr_handler" with the rfi 303 # We are assuming the space queues are all correct already 304 305 ldil L%rest_of_isr_handler, arg0 306 ldo R%rest_of_isr_handler(arg0), arg0 307 mtctl arg0, pcoq 308 ldo 4(arg0), arg0 309 mtctl arg0, pcoq 310 311 rfi 312 nop 313 314 # At this point we are back in virtual mode and all our 315 # normal addressing is once again ok. 316 # 317 # It is now ok to take an exception or trap 318 # 319 320 rest_of_isr_handler: 328 321 329 322 # Point to beginning of float context and … … 409 402 # (_ISR_Nest_level == 0) 410 403 411 rsm HPPA_PSW_I , %r0404 rsm HPPA_PSW_I + HPPA_PSW_R, %r0 412 405 ldw -4(sp), sp 413 406 … … 449 442 comibt,=,n 0,%r8,isr_restore 450 443 444 451 445 # OK, something happened while in ISR and we need to switch to a task 452 446 # other than the one which was interrupted or the … … 466 460 ldo -128(sp),sp 467 461 468 rsm HPPA_PSW_I, %r0469 470 462 isr_restore: 463 464 # enable interrupts during most of restore 465 ssm HPPA_PSW_I, %r0 471 466 472 467 # Get a pointer to beginning of our stack frame … … 489 484 .EXPORT _CPU_Context_restore 490 485 _CPU_Context_restore: 491 492 # Turn off Q & I so we can write pcoq493 rsm HPPA_PSW_Q + HPPA_PSW_I, %r0494 495 ldw IPSW_OFFSET(arg0), %r8496 mtctl %r8, ipsw497 498 ldw SAR_OFFSET(arg0), %r9499 mtctl %r9, sar500 501 ldw PCOQFRONT_OFFSET(arg0), %r10502 mtctl %r10, pcoq503 504 ldw PCOQBACK_OFFSET(arg0), %r11505 mtctl %r11, pcoq506 486 507 487 # … … 532 512 ldw R23_OFFSET(arg0),%r23 533 513 ldw R24_OFFSET(arg0),%r24 534 ldw R25_OFFSET(arg0),%r25 535 # skipping r26 (a ka arg0) until we are done with it514 # skipping r25; used as scratch register below 515 # skipping r26 (arg0) until we are done with it 536 516 ldw R27_OFFSET(arg0),%r27 537 517 ldw R28_OFFSET(arg0),%r28 … … 540 520 ldw R31_OFFSET(arg0),%r31 541 521 542 # Must load r26 last since it is arg0 522 # Turn off Q & R & I so we can write interrupt control registers 523 rsm HPPA_PSW_Q + HPPA_PSW_R + HPPA_PSW_I, %r0 524 525 ldw IPSW_OFFSET(arg0), %r25 526 mtctl %r25, ipsw 527 528 ldw SAR_OFFSET(arg0), %r25 529 mtctl %r25, sar 530 531 ldw PCOQFRONT_OFFSET(arg0), %r25 532 mtctl %r25, pcoq 533 534 ldw PCOQBACK_OFFSET(arg0), %r25 535 mtctl %r25, pcoq 536 537 # Load r25 with interrupts off 538 ldw R25_OFFSET(arg0),%r25 539 # Must load r26 (arg0) last 543 540 ldw R26_OFFSET(arg0),%r26 544 541 -
c/src/exec/score/cpu/hppa1.1/hppa.h
r5c491aef rc64e4ed4 1 1 /* 2 * @(#)hppa.h 1.13 - 95/09/213 * 2 * @(#)hppa.h 1.17 - 95/12/13 3 * 4 4 * 5 5 * Description: … … 210 210 #define HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER HPPA_INTERRUPT_EXTERNAL_0 211 211 #define HPPA_EXTERNAL_INTERRUPTS 32 212 #define HPPA_INTERNAL_INTERRUPTS 32 212 213 213 214 /* BSP defined interrupts begin here */ … … 647 648 648 649 649 #ifndef ASM 650 /* 651 * this won't work in ASM or non-GNU compilers 652 */ 653 654 #if !defined(ASM) && defined(__GNUC__) 650 655 651 656 /* … … 700 705 EMIT_CONTROLS(tr7, HPPA_CR31); /* CR31 */ 701 706 707 #endif /* ASM and GNU */ 708 702 709 /* 703 710 * If and How to invoke the debugger (a ROM debugger generally) 704 711 */ 705 706 #ifdef SIMHPPA_ROM 707 /* invoke the pflow debugger */ 708 #define CPU_INVOKE_DEBUGGER \ 712 #define CPU_INVOKE_DEBUGGER \ 709 713 do { \ 710 extern void debugger_break(void); \ 711 debugger_break(); \ 714 HPPA_ASM_BREAK(1,1); \ 712 715 } while (0) 713 #endif714 715 716 #endif /* ASM */717 716 718 717 #ifdef __cplusplus -
c/src/exec/score/cpu/unix/cpu.c
r5c491aef rc64e4ed4 88 88 89 89 sigemptyset(&posix_empty_mask); 90 90 91 91 /* 92 92 * Block all the signals except SIGTRAP for the debugger … … 603 603 extern boolean _Context_Switch_necessary; 604 604 605 606 605 if (_ISR_Nest_level++ == 0) { 607 606 /* switch to interrupt stack */ … … 636 635 void _CPU_Stray_signal(int sig_num) 637 636 { 638 char buffer[ 4 ]; 639 640 /* 641 * We avoid using the stdio section of the library. 642 * The following is generally safe. 643 */ 644 645 buffer[ 0 ] = (sig_num >> 4) + 0x30; 646 buffer[ 1 ] = (sig_num & 0xf) + 0x30; 647 buffer[ 2 ] = '\n'; 648 649 write( 2, "Stray signal 0x", 12 ); 650 write( 2, buffer, 3 ); 637 char buffer[ 4 ]; 638 639 /* 640 * print "stray" msg about ones which that might mean something 641 * Avoid using the stdio section of the library. 642 * The following is generally safe. 643 */ 644 645 switch (sig_num) 646 { 647 case SIGCLD: 648 break; 649 650 default: 651 { 652 /* 653 * We avoid using the stdio section of the library. 654 * The following is generally safe. 655 */ 656 657 buffer[ 0 ] = (sig_num >> 4) + 0x30; 658 buffer[ 1 ] = (sig_num & 0xf) + 0x30; 659 buffer[ 2 ] = '\n'; 660 661 write( 2, "Stray signal 0x", 12 ); 662 write( 2, buffer, 3 ); 663 } 664 } 651 665 652 666 /* -
c/src/exec/score/cpu/unix/cpu.h
r5c491aef rc64e4ed4 279 279 */ 280 280 281 #ifdef __GNUC__ 281 282 #define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (32))) 283 #else 284 #define CPU_STRUCTURE_ALIGNMENT 285 #endif 282 286 283 287 /* -
c/src/exec/score/cpu/unix/unixtypes.h
r5c491aef rc64e4ed4 25 25 26 26 /* 27 * some C++ compilers (eg: HP's) don't do 'signed' or 'volatile' 28 */ 29 #if defined(__cplusplus) && !defined(__GNUC__) 30 #define signed 31 #define volatile 32 #endif 33 34 /* 27 35 * This section defines the basic types for this processor. 28 36 */ … … 31 39 typedef unsigned short unsigned16; /* unsigned 16-bit integer */ 32 40 typedef unsigned int unsigned32; /* unsigned 32-bit integer */ 33 typedef unsigned long long unsigned64; /* unsigned 64-bit integer */34 41 35 42 typedef unsigned16 Priority_Bit_map_control; … … 38 45 typedef signed short signed16; /* 16-bit signed integer */ 39 46 typedef signed int signed32; /* 32-bit signed integer */ 47 48 /* 49 * some C++ compilers (eg: HP's) don't do 'long long' 50 */ 51 #if defined(__GNUC__) 52 typedef unsigned long long unsigned64; /* unsigned 64-bit integer */ 40 53 typedef signed long long signed64; /* 64 bit signed integer */ 54 #endif 41 55 42 56 typedef unsigned32 boolean; /* Boolean value */ -
c/src/exec/score/headers/system.h
r5c491aef rc64e4ed4 57 57 58 58 #ifdef USE_INLINES 59 #define STATIC static 60 #define INLINE __inline__ 59 # define STATIC static 60 # ifdef __GNUC__ 61 # define INLINE __inline__ 62 # else 63 # define INLINE inline 64 # endif 61 65 #else 62 /* 63 #error Only the GNU C compiler is currently supported!!! 64 */ 65 #define STATIC 66 #define INLINE 66 # define STATIC 67 # define INLINE 67 68 #endif 68 69 -
c/src/exec/score/include/rtems/system.h
r5c491aef rc64e4ed4 57 57 58 58 #ifdef USE_INLINES 59 #define STATIC static 60 #define INLINE __inline__ 59 # define STATIC static 60 # ifdef __GNUC__ 61 # define INLINE __inline__ 62 # else 63 # define INLINE inline 64 # endif 61 65 #else 62 /* 63 #error Only the GNU C compiler is currently supported!!! 64 */ 65 #define STATIC 66 #define INLINE 66 # define STATIC 67 # define INLINE 67 68 #endif 68 69 -
c/src/exec/score/inline/address.inl
r5c491aef rc64e4ed4 59 59 ) 60 60 { 61 return ( left -right);61 return ((char *) left - (char *) right); 62 62 } 63 63 -
c/src/exec/score/inline/coremsg.inl
r5c491aef rc64e4ed4 18 18 #define __CORE_MESSAGE_QUEUE_inl 19 19 20 #include <string.h> /* needed for memcpy */ 21 20 22 /*PAGE 21 23 * -
c/src/exec/score/inline/rtems/score/address.inl
r5c491aef rc64e4ed4 59 59 ) 60 60 { 61 return ( left -right);61 return ((char *) left - (char *) right); 62 62 } 63 63 -
c/src/exec/score/inline/rtems/score/coremsg.inl
r5c491aef rc64e4ed4 18 18 #define __CORE_MESSAGE_QUEUE_inl 19 19 20 #include <string.h> /* needed for memcpy */ 21 20 22 /*PAGE 21 23 * -
c/src/exec/score/inline/rtems/score/thread.inl
r5c491aef rc64e4ed4 242 242 Objects_Classes the_class; 243 243 Objects_Information *information; 244 Thread_Control *tp = (Thread_Control *) 0; 244 245 245 246 if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { 246 247 _Thread_Disable_dispatch(); 247 248 *location = OBJECTS_LOCAL; 248 return( _Thread_Executing ); 249 tp = _Thread_Executing; 250 goto done; 249 251 } 250 252 … … 253 255 if ( the_class > OBJECTS_CLASSES_LAST ) { 254 256 *location = OBJECTS_ERROR; 255 return (Thread_Control *) 0;257 goto done; 256 258 } 257 259 … … 260 262 if ( !information || !information->is_thread ) { 261 263 *location = OBJECTS_ERROR; 262 return (Thread_Control *) 0;264 goto done; 263 265 } 264 266 265 return (Thread_Control *) _Objects_Get( information, id, location ); 266 } 267 tp = (Thread_Control *) _Objects_Get( information, id, location ); 268 269 done: 270 return tp; 271 } 272 267 273 268 274 /* -
c/src/exec/score/inline/thread.inl
r5c491aef rc64e4ed4 242 242 Objects_Classes the_class; 243 243 Objects_Information *information; 244 Thread_Control *tp = (Thread_Control *) 0; 244 245 245 246 if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { 246 247 _Thread_Disable_dispatch(); 247 248 *location = OBJECTS_LOCAL; 248 return( _Thread_Executing ); 249 tp = _Thread_Executing; 250 goto done; 249 251 } 250 252 … … 253 255 if ( the_class > OBJECTS_CLASSES_LAST ) { 254 256 *location = OBJECTS_ERROR; 255 return (Thread_Control *) 0;257 goto done; 256 258 } 257 259 … … 260 262 if ( !information || !information->is_thread ) { 261 263 *location = OBJECTS_ERROR; 262 return (Thread_Control *) 0;264 goto done; 263 265 } 264 266 265 return (Thread_Control *) _Objects_Get( information, id, location ); 266 } 267 tp = (Thread_Control *) _Objects_Get( information, id, location ); 268 269 done: 270 return tp; 271 } 272 267 273 268 274 /*
Note: See TracChangeset
for help on using the changeset viewer.