Changeset 05d9dd89 in mainline
- Timestamp:
- 2005-11-03T21:55:52Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dd118f0
- Parents:
- 0259524
- Location:
- arch/ia64
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia64/include/asm.h
r0259524 r05d9dd89 93 93 } 94 94 95 /** Read ITV (Interval Timer Vector) register. 96 * 97 * @return Current vector and mask bit. 98 */ 99 static inline __u64 itv_read(void) 100 { 101 __u64 v; 102 103 __asm__ volatile ("mov %0 = cr.itv\n" : "=r" (v)); 104 105 return v; 106 } 107 95 108 /** Write ITV (Interval Timer Vector) register. 96 109 * 97 * @param New vector and mask edbit.110 * @param New vector and mask bit. 98 111 */ 99 112 static inline void itv_write(__u64 v) -
arch/ia64/include/interrupt.h
r0259524 r05d9dd89 30 30 #define __ia64_INTERRUPT_H__ 31 31 32 #define INTERRUPT_TIMER 0 33 #define INTERRUPT_SPURIOUS 15 34 32 35 extern void external_interrupt(void); 33 36 -
arch/ia64/include/register.h
r0259524 r05d9dd89 33 33 34 34 #define CR_IVR_MASK 0xf 35 36 35 #define PSR_I_MASK 0x4000 37 36 37 /** External Interrupt Vector Register */ 38 union cr_ivr { 39 __u8 vector; 40 __u64 value; 41 }; 42 43 typedef union cr_ivr cr_ivr_t; 44 45 /** Task Priority Register */ 46 union cr_tpr { 47 struct { 48 unsigned : 4; 49 unsigned mic: 4; /**< Mask Interrupt Class. */ 50 unsigned : 8; 51 unsigned mmi: 1; /**< Mask Maskable Interrupts. */ 52 } __attribute__ ((packed)); 53 __u64 value; 54 }; 55 56 typedef union cr_tpr cr_tpr_t; 57 58 /** Interval Timer Vector */ 59 union cr_itv { 60 struct { 61 unsigned vector : 8; 62 unsigned : 4; 63 unsigned : 1; 64 unsigned : 3; 65 unsigned m : 1; /**< Mask. */ 66 } __attribute__ ((packed)); 67 __u64 value; 68 }; 69 70 typedef union cr_itv cr_itv_t; 71 38 72 #endif -
arch/ia64/include/types.h
r0259524 r05d9dd89 36 36 typedef unsigned char __u8; 37 37 typedef unsigned short __u16; 38 typedef unsigned long__u32;39 typedef longlong __u64;38 typedef unsigned int __u32; 39 typedef unsigned long __u64; 40 40 41 41 typedef __u64 __address; -
arch/ia64/src/ia64.c
r0259524 r05d9dd89 29 29 #include <arch.h> 30 30 #include <arch/ski/ski.h> 31 #include <arch/asm.h> 32 #include <arch/register.h> 33 #include <arch/barrier.h> 34 #include <arch/interrupt.h> 35 36 /** TODO: read ticks per second from firmware */ 37 #define IT_DELTA 50000000 31 38 32 39 void arch_pre_mm_init(void) … … 37 44 void arch_post_mm_init(void) 38 45 { 46 cr_itv_t itv; 47 48 /* initialize Interval Timer external interrupt vector */ 49 itv.value = itv_read(); 50 itv.vector = INTERRUPT_TIMER; 51 itv.m = 0; 52 itv_write(itv.value); 53 srlz_d(); 54 55 /* set Interval Timer Counter to zero */ 56 itc_write(0); 57 srlz_d(); 58 59 /* generate first Interval Timer interrupt in IT_DELTA ticks */ 60 itm_write(IT_DELTA); 61 srlz_d(); 39 62 } -
arch/ia64/src/interrupt.c
r0259524 r05d9dd89 30 30 #include <arch/interrupt.h> 31 31 #include <panic.h> 32 #include <print.h> 32 33 #include <arch/types.h> 33 34 #include <arch/asm.h> 34 35 #include <arch/barrier.h> 35 36 #include <arch/register.h> 37 #include <arch.h> 36 38 37 39 void external_interrupt(void) 38 40 { 39 __u8ivr;41 cr_ivr_t ivr; 40 42 41 srlz_d(); 42 ivr = ivr_read() & CR_IVR_MASK; 43 ivr.value = ivr_read(); 43 44 srlz_d(); 44 45 45 switch(ivr) { 46 switch(ivr.value) { 47 case INTERRUPT_TIMER: 48 panic("cpu%d: timer interrupt\n", CPU->id); 49 break; 50 case INTERRUPT_SPURIOUS: 51 printf("cpu%d: spurious interrupt\n", CPU->id); 52 break; 46 53 default: 47 panic("\nUnhandled External Interrupt Vector %d\n", ivr); 54 panic("\nUnhandled External Interrupt Vector %d\n", ivr.vector); 55 break; 48 56 } 49 57 }
Note:
See TracChangeset
for help on using the changeset viewer.