changeset 2790:fe2b9e9dcbe2

Fix behaviour re. linker garbage collection. Use the right init priority.
author bartv
date Wed, 11 Feb 2009 15:49:38 +0000
parents 70bc76ef308f
children cc8f8b9997d1
files packages/devs/spi/arm/at91/current/ChangeLog packages/devs/spi/arm/at91/current/cdl/spi_at91.cdl packages/devs/spi/arm/at91/current/src/spi_at91.c packages/devs/spi/arm/at91/current/src/spi_at91_init.cxx
diffstat 4 files changed, 14 insertions(+), 74 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/spi/arm/at91/current/ChangeLog
+++ b/packages/devs/spi/arm/at91/current/ChangeLog
@@ -1,3 +1,12 @@
+2009-02-11  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/spi_at91.c (cyg_spi_at91_bus_init): turn into a prioritized
+	constructor, make it a static and rename.
+
+	* cdl/spi_at91.cdl: remove src/spi_at91_init.cxx
+	
+	* src/spi_at91_init.cxx: removed, no longer needed.
+
 2008-10-19  Igor B. Poretsky <poretsky@mlbox.ru>
 	
 	* src/spi_at91.c: Typo fixes from var_io.h.  Correctly calculate
@@ -64,7 +73,7 @@ 2004-08-27  Savin Zlobec  <savin@elatec.
 // ####GPLCOPYRIGHTBEGIN####                                                
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2009 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/devs/spi/arm/at91/current/cdl/spi_at91.cdl
+++ b/packages/devs/spi/arm/at91/current/cdl/spi_at91.cdl
@@ -8,7 +8,7 @@
 ## ####ECOSGPLCOPYRIGHTBEGIN####                                            
 ## -------------------------------------------                              
 ## This file is part of eCos, the Embedded Configurable Operating System.   
-## Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+## Copyright (C) 1998, 1999, 2000, 2001, 2002, 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     
@@ -54,8 +54,6 @@ cdl_package CYGPKG_DEVS_SPI_ARM_AT91 {
     hardware
     include_dir   cyg/io
     compile       spi_at91.c
-    compile       -library=libextras.a spi_at91_init.cxx
-
 
     cdl_option CYGHWR_DEVS_SPI_ARM_AT91_BUS0 {
         display       "Enable support for SPI bus 0"
--- a/packages/devs/spi/arm/at91/current/src/spi_at91.c
+++ b/packages/devs/spi/arm/at91/current/src/spi_at91.c
@@ -8,7 +8,7 @@
 // ####ECOSGPLCOPYRIGHTBEGIN####                                            
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 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     
@@ -175,8 +175,8 @@ CYG_SPI_DEFINE_BUS_TABLE(cyg_spi_at91_de
 #endif
 // -------------------------------------------------------------------------
 
-void
-cyg_spi_at91_bus_init(void)
+static void CYGBLD_ATTRIB_C_INIT_PRI(CYG_INIT_BUS_SPI)
+spi_at91_bus_init(void)
 {
 
 #ifdef CYGHWR_DEVS_SPI_ARM_AT91_BUS0
deleted file mode 100644
--- a/packages/devs/spi/arm/at91/current/src/spi_at91_init.cxx
+++ /dev/null
@@ -1,67 +0,0 @@
-//==========================================================================
-//
-//      spi_at91_init.cxx
-//
-//      Atmel AT91 (ARM) SPI bus init 
-//
-//==========================================================================
-// ####ECOSGPLCOPYRIGHTBEGIN####                                            
-// -------------------------------------------                              
-// This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 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):     Savin Zlobec <savin@elatec.si> 
-// Date:          2004-08-25
-//
-//####DESCRIPTIONEND####
-//
-//==========================================================================
-
-#include <cyg/infra/cyg_type.h>
-
-// -------------------------------------------------------------------------
-
-externC void cyg_spi_at91_bus_init(void);
-
-class cyg_spi_at91_bus_init_class {
-public:
-    cyg_spi_at91_bus_init_class(void) {
-        cyg_spi_at91_bus_init();
-    }
-};
-
-// -------------------------------------------------------------------------
-
-static cyg_spi_at91_bus_init_class spi_at91_bus_init CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO);
-
-// -------------------------------------------------------------------------
-// EOF spi_at91_init.cxx