changeset 2995:05d279424483

* cortexm/arch/current/src/vectors.S (hal_default_interrupt_vsr): Save interrupt state if CYGINT_HAL_COMMON_SAVED_INTERRUPT_STATE_REQUIRED is implemented. * common/current/cdl/hal.cdl: Add a CDL interface to control whether interrupt state must be saved. * common/current/cdl/debugging.cdl: Implement the new interface within GDB Ctrl-C break options. * common/current/src/hal_if.c: Make declaration of the hal_saved_interrupt_state variable conditional on an implementation of the new CDL interface.
author jld
date Thu, 13 Jan 2011 17:59:21 +0000
parents 9df777181d2a
children e84953768371
files packages/hal/common/current/ChangeLog packages/hal/common/current/cdl/debugging.cdl packages/hal/common/current/cdl/hal.cdl packages/hal/common/current/src/hal_if.c packages/hal/cortexm/arch/current/ChangeLog packages/hal/cortexm/arch/current/src/vectors.S
diffstat 6 files changed, 44 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/packages/hal/common/current/ChangeLog
+++ b/packages/hal/common/current/ChangeLog
@@ -1,3 +1,12 @@
+2011-01-13  John Dallaway  <john@dallaway.org.uk>
+
+	* cdl/hal.cdl: Add a CDL interface to control whether interrupt
+	state must be saved. [ Bugzilla 1001111 ]
+	* cdl/debugging.cdl: Implement the new interface within GDB Ctrl-C
+	break options.
+	* src/hal_if.c: Make declaration of the hal_saved_interrupt_state
+	variable conditional on an implementation of the new CDL interface.
+
 2010-11-20  John Dallaway  <john@dallaway.org.uk>
 
 	* cdl/hal.cdl: Suppress -fprofile-arcs (which implies -lgcov) when
@@ -2351,7 +2360,7 @@ 1998-08-18  Nick Garnett  <nickg@cygnus.
 // ####GPLCOPYRIGHTBEGIN####                                                
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2010 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2010, 2011 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
--- a/packages/hal/common/current/cdl/debugging.cdl
+++ b/packages/hal/common/current/cdl/debugging.cdl
@@ -8,7 +8,7 @@
 ## ####ECOSGPLCOPYRIGHTBEGIN####                                            
 ## -------------------------------------------                              
 ## This file is part of eCos, the Embedded Configurable Operating System.   
-## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2011 Free Software Foundation, Inc.
 ##
 ## eCos is free software; you can redistribute it and/or modify it under    
 ## the terms of the GNU General Public License as published by the Free     
@@ -41,7 +41,7 @@
 #
 # Author(s):      jskov
 # Original data:  nickg,jskov,jlarmour
-# Contributors:
+# Contributors:   jld
 # Date:           1999-07-02
 #
 #####DESCRIPTIONEND####
@@ -89,6 +89,7 @@ cdl_option CYGDBG_HAL_DEBUG_GDB_BREAK_SU
     active_if     CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
     requires      CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
     default_value CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+    implements    CYGINT_HAL_COMMON_SAVED_INTERRUPT_STATE_REQUIRED
     description   "
         This option causes the GDB stub to add a serial interrupt handler
         which will listen for GDB break packets. This lets you stop the
@@ -109,6 +110,7 @@ cdl_option CYGDBG_HAL_DEBUG_GDB_CTRLC_SU
     active_if     { CYGSEM_HAL_USE_ROM_MONITOR || CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS }
     active_if     { CYGINT_HAL_DEBUG_GDB_CTRLC_UNSUPPORTED == 0 }
     default_value { !CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS }
+    implements    CYGINT_HAL_COMMON_SAVED_INTERRUPT_STATE_REQUIRED
     description   "
         This option adds an interrupt handler for the GDB serial line
         which will listen for GDB break packets. This lets you stop the
--- a/packages/hal/common/current/cdl/hal.cdl
+++ b/packages/hal/common/current/cdl/hal.cdl
@@ -8,7 +8,7 @@
 ## ####ECOSGPLCOPYRIGHTBEGIN####                                            
 ## -------------------------------------------                              
 ## This file is part of eCos, the Embedded Configurable Operating System.   
-## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2010 Free Software Foundation, Inc.
+## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2010, 2011 Free Software Foundation, Inc.
 ##
 ## eCos is free software; you can redistribute it and/or modify it under    
 ## the terms of the GNU General Public License as published by the Free     
@@ -41,7 +41,7 @@
 #
 # Author(s):      bartv
 # Original data:  nickg,jskov,jlarmour
-# Contributors:   dmoseley
+# Contributors:   dmoseley, jld
 # Date:           1999-06-13
 #
 #####DESCRIPTIONEND####
@@ -397,7 +397,7 @@ cdl_package CYGPKG_HAL {
 
     # Does platform need special I/O initializations?
     cdl_interface     CYGINT_HAL_PLF_IF_INIT {
-        display       "Platform defined I/O channels."
+        display       "Platform defined I/O channels"
         description   "
           Platforms which provide additional I/O channels can implement
           this interface, indicating that the function plf_if_init()
@@ -406,12 +406,22 @@ cdl_package CYGPKG_HAL {
 
     # Does platform provide IDE I/O macros?
     cdl_interface     CYGINT_HAL_PLF_IF_IDE {
-        display       "Platform IDE I/O support."
+        display       "Platform IDE I/O support"
         description   "
           Platforms which provide IDE controllers can implement
           this interface, indicating that IDE I/O macros are
           available."
     }
+
+    # Does anything require access to saved interrupt state?
+    cdl_interface     CYGINT_HAL_COMMON_SAVED_INTERRUPT_STATE_REQUIRED {
+        display       "Saved interrupt state required"
+        description   "
+          Components requiring access to saved interrupt state via the
+          hal_saved_interrupt_state symbol should implement this
+          interface."
+    }
+
     cdl_option CYGPKG_HAL_GDB_FILEIO {
         display       "File I/O operations via GDB"
         default_value 0
--- a/packages/hal/common/current/src/hal_if.c
+++ b/packages/hal/common/current/src/hal_if.c
@@ -8,7 +8,7 @@
 // ####ECOSGPLCOPYRIGHTBEGIN####                                            
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011 Free Software Foundation, Inc.
 //
 // eCos is free software; you can redistribute it and/or modify it under    
 // the terms of the GNU General Public License as published by the Free     
@@ -40,7 +40,7 @@
 //#####DESCRIPTIONBEGIN####
 //
 // Author(s):   jskov
-// Contributors:jskov, woehler
+// Contributors:jskov, woehler, jld
 // Date:        2000-06-07
 //
 //####DESCRIPTIONEND####
@@ -887,11 +887,13 @@ hal_if_diag_read_char(char *c)
 // CtrlC support
 //=============================================================================
 
+#if CYGINT_HAL_COMMON_SAVED_INTERRUPT_STATE_REQUIRED > 0
+struct Hal_SavedRegisters *hal_saved_interrupt_state;
+#endif
+
 #if defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT) \
     || defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT)
 
-struct Hal_SavedRegisters *hal_saved_interrupt_state;
-
 void
 hal_ctrlc_isr_init(void)
 {
--- a/packages/hal/cortexm/arch/current/ChangeLog
+++ b/packages/hal/cortexm/arch/current/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-13  John Dallaway  <john@dallaway.org.uk>
+
+	* src/vectors.S (hal_default_interrupt_vsr): Save interrupt state
+	if CYGINT_HAL_COMMON_SAVED_INTERRUPT_STATE_REQUIRED is implemented.
+	[ Bugzilla 1001111 ]
+
 2011-01-02  Sergei Gavrikov  <sergei.gavrikov@gmail.com>
 
 	* cdl/hal_cortexm.cdl: Eliminate some warnings. [ Bugzilla
@@ -82,7 +88,7 @@ 2008-10-06  Nick Garnett  <nickg@ecoscen
 // ####GPLCOPYRIGHTBEGIN####                                                
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 2008 Free Software Foundation, Inc.                        
+// Copyright (C) 2008, 2011 Free Software Foundation, Inc.                        
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
--- a/packages/hal/cortexm/arch/current/src/vectors.S
+++ b/packages/hal/cortexm/arch/current/src/vectors.S
@@ -8,7 +8,7 @@
 // ####ECOSGPLCOPYRIGHTBEGIN####                                            
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 2008 Free Software Foundation, Inc.                        
+// Copyright (C) 2008, 2011 Free Software Foundation, Inc.                        
 //
 // eCos is free software; you can redistribute it and/or modify it under    
 // the terms of the GNU General Public License as published by the Free     
@@ -201,12 +201,10 @@ hal_default_interrupt_vsr:
         push    {lr}                    // Save return link
         sub     sp,#4                   // Realign SP to 8 bytes
         
-#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) || \
-    defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT)
+#if CYGINT_HAL_COMMON_SAVED_INTERRUPT_STATE_REQUIRED > 0
         // If we are supporting Ctrl-C interrupts from GDB, we must squirrel
         // away a pointer to the saved interrupt state here so that we can
-        // plant a breakpoint at some later time. We only need to make a
-        // full interrupt saved state in that case.
+        // plant a breakpoint at some later time.
 
        .extern  hal_saved_interrupt_state
         mrs     r1,psp                  // Get PSP