comparison packages/hal/common/current/include/hal_misc.h @ 165:d63db767121d

Merge from eCos master repository on 2001-06-29-06:43:03-BST
author jlarmour
date Fri, 29 Jun 2001 07:16:25 +0000
parents 6b5f480c6929
children 5602a8379ebc
comparison
equal deleted inserted replaced
164:f7999c3a5f21 165:d63db767121d
45 //============================================================================= 45 //=============================================================================
46 46
47 #ifndef __ASSEMBLER__ 47 #ifndef __ASSEMBLER__
48 #include <cyg/infra/cyg_type.h> // types & externC 48 #include <cyg/infra/cyg_type.h> // types & externC
49 49
50 //=============================================================================
51 // Function used to call ISRs from ISR arbiters
52 // An arbiter is hooked on the shared interrupt vector and looks like this:
53 //
54 // cyg_uint32 _arbitration_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data)
55 // {
56 // cyg_uint32 isr_ret;
57 // // decode interrupt source and for each active source call the ISR
58 // if (source_A_active) {
59 // isr_ret = hal_call_isr (CYGNUM_HAL_INTERRUPT_SOURCE_A);
60 // #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN
61 // if (isr_ret & CYG_ISR_HANDLED)
62 // #endif
63 // return isr_ret;
64 // }
65 // if (source_B_active) {
66 // isr_ret = hal_call_isr (CYGNUM_HAL_INTERRUPT_SOURCE_B);
67 // #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN
68 // if (isr_ret & CYG_ISR_HANDLED)
69 // #endif
70 // return isr_ret;
71 // }
72 // ...
73 // return 0;
74 // }
75 //
76 // Remember to attach and enable the arbiter source:
77 // HAL_INTERRUPT_ATTACH(CYGNUM_HAL_INTERRUPT_ARBITER, &_arbitration_isr, 0, 0);
78 // HAL_INTERRUPT_SET_LEVEL(CYGNUM_HAL_INTERRUPT_ARBITER, 1);
79 // HAL_INTERRUPT_UNMASK(CYGNUM_HAL_INTERRUPT_ARBITER);
80 //
81
82 #include <cyg/hal/hal_intr.h> // hal_interrupt_x tables
83 #include <cyg/hal/drv_api.h> // CYG_ISR_HANDLED
84
85 typedef cyg_uint32 cyg_ISR(cyg_uint32 vector, CYG_ADDRWORD data);
86
87 extern void cyg_interrupt_post_dsr( CYG_ADDRWORD intr_obj );
88
89 static inline cyg_uint32
90 hal_call_isr (cyg_uint32 vector)
91 {
92 cyg_ISR *isr;
93 CYG_ADDRWORD data;
94 cyg_uint32 isr_ret;
95
96 isr = (cyg_ISR*) hal_interrupt_handlers[vector];
97 data = hal_interrupt_data[vector];
98
99 isr_ret = (*isr) (vector, data);
100
101 #ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
102 if (isr_ret & CYG_ISR_CALL_DSR) {
103 cyg_interrupt_post_dsr (hal_interrupt_objects[vector]);
104 }
105 #endif
106
107 return isr_ret & ~CYG_ISR_CALL_DSR;
108 }
109
110 //=============================================================================
50 externC cyg_bool cyg_hal_is_break(char *buf, int size); 111 externC cyg_bool cyg_hal_is_break(char *buf, int size);
51 externC void cyg_hal_user_break( CYG_ADDRWORD *regs ); 112 externC void cyg_hal_user_break( CYG_ADDRWORD *regs );
52 #endif 113 #endif
53 114
54 //============================================================================= 115 //=============================================================================