changeset 2787:e56d0554cf04

Make linker garbage collection work properly for this driver.
author bartv
date Tue, 10 Feb 2009 22:32:03 +0000
parents 856d1552c172
children 6d113aa28eb1
files packages/devs/spi/cortexm/stm32/current/ChangeLog packages/devs/spi/cortexm/stm32/current/cdl/spi_stm32.cdl packages/devs/spi/cortexm/stm32/current/src/spi_stm32.c packages/devs/spi/cortexm/stm32/current/src/spi_stm32_init.cxx
diffstat 4 files changed, 11 insertions(+), 66 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/spi/cortexm/stm32/current/ChangeLog
+++ b/packages/devs/spi/cortexm/stm32/current/ChangeLog
@@ -1,3 +1,12 @@
+2009-02-10  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/spi_stm32.c (cyg_spi_cortexm_stm32_init): mark as
+	prioritized constructor and rename.
+
+	* cdl/spi_stm32.cdl: stop building spi_stm32_init.cxx
+
+	* src/spi_stm32_init.cxx: removed, no longer needed.
+
 2009-02-10  Chris Holgate  <chris@zynaptic.com>
 
 	* src/spi_stm32.c: 
--- a/packages/devs/spi/cortexm/stm32/current/cdl/spi_stm32.cdl
+++ b/packages/devs/spi/cortexm/stm32/current/cdl/spi_stm32.cdl
@@ -59,7 +59,6 @@ cdl_package CYGPKG_DEVS_SPI_CORTEXM_STM3
     hardware
     include_dir   cyg/io
     compile       spi_stm32.c
-    compile       -library=libextras.a spi_stm32_init.cxx
 
 cdl_option CYGNUM_DEVS_SPI_CORTEXM_STM32_PIN_TOGGLE_RATE {
     display       "Pin toggle rate"
--- a/packages/devs/spi/cortexm/stm32/current/src/spi_stm32.c
+++ b/packages/devs/spi/cortexm/stm32/current/src/spi_stm32.c
@@ -611,8 +611,8 @@ static void spi_transaction_dma
 //-----------------------------------------------------------------------------
 // Initialise SPI interfaces on startup.
 
-void cyg_spi_cortexm_stm32_init 
-  (void)
+static void CYGBLD_ATTRIB_C_INIT_PRI(CYG_INIT_BUS_SPI)
+stm32_spi_init(void)
 {
 #if defined(CYGHWR_DEVS_SPI_CORTEXM_STM32_BUS3) && \
     defined(CYGHWR_DEVS_SPI_CORTEXM_STM32_BUS3_DISABLE_DEBUG_PORT)
deleted file mode 100644
--- a/packages/devs/spi/cortexm/stm32/current/src/spi_stm32_init.cxx
+++ /dev/null
@@ -1,63 +0,0 @@
-//=============================================================================
-//
-//      spi_stm32_init.c
-//
-//      SPI driver startup for STM32
-//
-//=============================================================================
-// ####ECOSGPLCOPYRIGHTBEGIN####                                            
-// -------------------------------------------                              
-// This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 2008, 2009 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     
-// Software Foundation; either version 2 or (at your option) any later      
-// version.                                                                 
-//
-// eCos is distributed in the hope that it will be useful, but WITHOUT      
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
-// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
-// for more details.                                                        
-//
-// You should have received a copy of the GNU General Public License        
-// along with eCos; if not, write to the Free Software Foundation, Inc.,    
-// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
-//
-// As a special exception, if other files instantiate templates or use      
-// macros or inline functions from this file, or you compile this file      
-// and link it with other works to produce a work based on this file,       
-// this file does not by itself cause the resulting work to be covered by   
-// the GNU General Public License. However the source code for this file    
-// must still be made available in accordance with section (3) of the GNU   
-// General Public License v2.                                               
-//
-// This exception does not invalidate any other reasons why a work based    
-// on this file might be covered by the GNU General Public License.         
-// -------------------------------------------                              
-// ####ECOSGPLCOPYRIGHTEND####                                              
-//=============================================================================
-//#####DESCRIPTIONBEGIN####
-//
-// Author(s):   Chris Holgate
-// Date:        2008-11-27
-// Purpose:     STM32 SPI driver startup
-//
-//####DESCRIPTIONEND####
-//
-//=============================================================================
-
-#include <cyg/infra/cyg_type.h>
-
-externC void cyg_spi_cortexm_stm32_init (void);
-
-class cyg_spi_cortexm_stm32_init_class {
-public:
-  cyg_spi_cortexm_stm32_init_class (void) {
-    cyg_spi_cortexm_stm32_init ();
-  }
-};
-
-static cyg_spi_cortexm_stm32_init_class spi_cortexm_stm32_init CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_BUS_SPI);
-
-//=============================================================================