This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ISR/DSR without kernel present


Hi all,

It seems that all infrastructure to use ISR/DSR handling in systems
without a kernel is already present in drv-api.c. Some conditional
compiles however seem to prevent things from getting used. The attached
patches make Redboot handle interrupts flawlessly on the powerpc
platform.

Bob

-- 
----------------------------------------------------------------------
ir. Bob Koninckx
Katholieke Universiteit Leuven       
Division Production Engineering,                   tel.  +32 16 322535
Machine Design and Automation                      fax.  +32 16 322987
Celestijnenlaan 300B                  bob.koninckx@mech.kuleuven.ac.be
B-3001 Leuven Belgium               http://www.mech.kuleuven.ac.be/pma
----------------------------------------------------------------------

Index: vectors.S
===================================================================
RCS file: /usr/cvsroot/software/ecos/packages/hal/powerpc/arch/current/src/vectors.S,v
retrieving revision 1.1.1.1
diff -u -5 -r1.1.1.1 vectors.S
--- vectors.S	7 Jun 2003 09:01:33 -0000	1.1.1.1
+++ vectors.S	30 Jul 2003 12:36:34 -0000
@@ -776,12 +776,10 @@
         
         stwu    sp,-CYGARC_PPC_STACK_FRAME_SIZE(sp) # create new stack frame
                                                 # where C code can save LR
 #endif  
 
-#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
-
         # We only need to call _interrupt_end() when there is a kernel
         # present to do any tidying up.
         
         # on return r3 bit 1 will indicate whether a DSR is
         # to be posted. Pass this together with a pointer to
@@ -796,11 +794,10 @@
         lwzx    r4,r4,r15                       # load object pointer
         mr      r5,r14                          # arg3 = saved register dump
 
         .extern interrupt_end
         bl      interrupt_end                   # call into C to finish off 
-#endif
 
 restore_state:  
         # All done, restore CPU state and continue
 
         # retrieve CPU state pointer
Index: drv_api.c
===================================================================
RCS file: /usr/cvsroot/software/ecos/packages/hal/common/current/src/drv_api.c,v
retrieving revision 1.1.1.1
diff -u -5 -r1.1.1.1 drv_api.c
--- drv_api.c	7 Jun 2003 09:01:31 -0000	1.1.1.1
+++ drv_api.c	30 Jul 2003 12:37:44 -0000
@@ -133,18 +133,24 @@
     CYG_REPORT_RETURN();
     
 }
 
 //--------------------------------------------------------------------------
-// This is referenced from the HAL, although it does not actually get called.
+// This is referenced from the HAL
 
 externC void
 cyg_interrupt_call_pending_DSRs(void)
 {
     call_dsrs();
 }
 
+externC void
+cyg_interrupt_post_dsr(CYG_ADDRWORD data)
+{
+  cyg_interrupt * intr = (cyg_interrupt *)data;
+  post_dsr(intr);
+}
 
 //--------------------------------------------------------------------------
 // Interrupt end function called from HAL VSR to tidy up. This is where
 // DSRs will be called if necessary.
 
Index: hal_arbiter.h
===================================================================
RCS file: /usr/cvsroot/software/ecos/packages/hal/common/current/include/hal_arbiter.h,v
retrieving revision 1.1.1.1
diff -u -5 -r1.1.1.1 hal_arbiter.h
--- hal_arbiter.h	7 Jun 2003 09:01:31 -0000	1.1.1.1
+++ hal_arbiter.h	30 Jul 2003 12:37:14 -0000
@@ -104,15 +104,13 @@
     isr = (cyg_ISR*) hal_interrupt_handlers[vector];
     data = hal_interrupt_data[vector];
 
     isr_ret = (*isr) (vector, data);
 
-#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
     if (isr_ret & CYG_ISR_CALL_DSR) {
         cyg_interrupt_post_dsr (hal_interrupt_objects[vector]);
     }
-#endif
 
     return isr_ret & ~CYG_ISR_CALL_DSR;
 }
 
 #else

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]