This is the mail archive of the ecos-patches@sourceware.org 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]

Moving AUX_CHANNELS, NUM_CHANNELS logic into platform hal


Hi there,

This patch moves a conflicting logic to define
CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS, that was being defined in
redboot.h and in hal_if.c; to the platform hal, and implemented in a
more general way, that allows more modules to increase the number of
channels.

Have fun.

David Fernandez.

Index: redboot/current/cdl/redboot.cdl
===================================================================
RCS file: /home/cvs/cvsroot/dfernandez/Projects/ecos/packages/redboot/current/cdl/redboot.cdl,v
retrieving revision 1.2
diff -u -5 -B -b -w -p -r1.2 redboot.cdl
--- redboot/current/cdl/redboot.cdl	2006/06/26 13:33:48	1.2
+++ redboot/current/cdl/redboot.cdl	2006/11/24 15:42:12
@@ -327,19 +327,17 @@ cdl_package CYGPKG_REDBOOT {
         cdl_component CYGPKG_REDBOOT_NETWORKING {
             display       "Redboot Networking"
             flavor        bool
             active_if     CYGPKG_IO_ETH_DRIVERS
             default_value 1
+            implements    CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS
             implements    CYGINT_REDBOOT_LOAD_METHOD
             compile net/bootp.c net/udp.c net/ip.c net/pktbuf.c net/cksum.c
             compile net/enet.c net/icmp.c net/tcp.c net/timers.c net/arp.c
             compile net/inet_addr.c
             compile -library=libextras.a net/ping.c net/net_io.c 
             description "This option includes networking support in RedBoot."
-            define_proc {
-                puts $::cdl_system_header "#define CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS 1"
-            }
     
             cdl_option CYGDBG_REDBOOT_NET_DEBUG {
                 display          "Print net debug information"
                 flavor           bool
                 default_value    0
Index: redboot/current/include/redboot.h
===================================================================
RCS file: /home/cvs/cvsroot/dfernandez/Projects/ecos/packages/redboot/current/include/redboot.h,v
retrieving revision 1.1.1.1
diff -u -5 -B -b -w -p -r1.1.1.1 redboot.h
--- redboot/current/include/redboot.h	2006/06/26 10:53:48	1.1.1.1
+++ redboot/current/include/redboot.h	2006/11/24 15:42:43
@@ -310,18 +310,10 @@ externC void init_opts(struct option_inf
                        int arg_type, void *arg, bool *arg_set, char *name);
 externC bool scan_opts(int argc, char *argv[], int first, 
                        struct option_info *opts, int num_opts, 
                        void *def_arg, int def_arg_type, char *def_descr);
 
-#ifdef CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS
-#define CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS \
-  (CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS+CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS)
-#else
-#define CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS \
-  CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS
-#endif
-
 #ifdef CYGPKG_REDBOOT_NETWORKING
 //-----------------------------------------------------------------------------
 // DNS wrapper
 #ifdef CYGPKG_REDBOOT_NETWORKING_DNS
 
Index: hal/i386/pc/current/cdl/hal_i386_pc.cdl
===================================================================
RCS file: /home/cvs/cvsroot/dfernandez/Projects/ecos/packages/hal/i386/pc/current/cdl/hal_i386_pc.cdl,v
retrieving revision 1.1.1.1
diff -u -5 -B -b -w -p -r1.1.1.1 hal_i386_pc.cdl
--- hal/i386/pc/current/cdl/hal_i386_pc.cdl	2006/06/26 10:53:35	1.1.1.1
+++ hal/i386/pc/current/cdl/hal_i386_pc.cdl	2006/11/24 15:48:44
@@ -177,11 +177,30 @@ cdl_package CYGPKG_HAL_I386_PC {
         legal_values	1 to 3
 	default_value	{ CYGSEM_HAL_I386_PC_DIAG_SCREEN ? 3 : 2 }
 	description	"
 	    This define the number of serial ports that will be used by the HAL.
 	    Ports 0 and 1 equate to COM1 and COM2 and port 2 is the PC screen and
-	    keyboard."
+            keyboard.
+        "
+    }
+
+    cdl_interface CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS {
+        display         "Number of auxiliary communications channels"
+    }
+    
+    cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS {
+        display         "Number of communications and auxiliary channels"
+        description     "
+            Allows other agents to increase the number of efective channels
+            as needed, to include alternative media channels like ethernet.
+            Just implement the interface CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS
+            as many times as needed.
+        "
+        flavor          data
+        calculated      { CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS   \
+                        + CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS
+                        }
     }
  
     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
         display          "Debug serial port"
         flavor data
Index: hal/common/current/src/hal_if.c
===================================================================
RCS file: /home/cvs/cvsroot/dfernandez/Projects/ecos/packages/hal/common/current/src/hal_if.c,v
retrieving revision 1.2
diff -u -5 -B -b -w -p -r1.2 hal_if.c
--- hal/common/current/src/hal_if.c	2006/06/26 13:33:46	1.2
+++ hal/common/current/src/hal_if.c	2006/11/24 15:51:12
@@ -317,19 +317,10 @@ nop_service(void)
 #endif
 
 //----------------------------------
 // Comm controls
 #ifdef CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_COMMS
-
-#ifdef CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS
-#define CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS \
-  (CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS+CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS)
-#else
-#define CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS \
-  CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS
-#endif
-
 static hal_virtual_comm_table_t comm_channels[CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS+1];
 
 static int
 set_debug_comm(int __comm_id)
 {
Index: redboot/current/ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/dfernandez/Projects/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.2
diff -u -5 -B -b -w -p -r1.2 ChangeLog
--- redboot/current/ChangeLog	2006/06/26 13:33:48	1.2
+++ redboot/current/ChangeLog	2006/11/24 16:04:15
@@ -1,5 +1,17 @@
+2006-11-24  David Fernandez  <dfernandez@cct.co.uk>
+
+	* cdl/redboot.cdl: Modified to change the proc block that adds a
+	  static definition for CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS into
+	  an interface implementation that can be done by more than one
+	  module. The interface and additional logic will be put in
+	  platform hal.
+	* include/redboot.h: Modified to remove the static logic about
+	  CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS, this will be moved to the
+	  platform hal avoiding conflicts with hal_if.c for example, that
+	  defines the same thing and includes redboot.h too.
+
 2006-03-09  David Fernandez <dfernandez@cct.co.uk>
 
 	* src/main.c: functions cyg_start and do_go modified when calling the
 	  macro HAL_THREAD_INIT_CONTEXT, so that they don't cast the l-value
 	  workspace_end, as the macro will cast it whenever it is necessary,
Index: hal/i386/pc/current/ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/dfernandez/Projects/ecos/packages/hal/i386/pc/current/ChangeLog,v
retrieving revision 1.1.1.1
diff -u -5 -B -b -w -p -r1.1.1.1 ChangeLog
--- hal/i386/pc/current/ChangeLog	2006/06/26 10:53:35	1.1.1.1
+++ hal/i386/pc/current/ChangeLog	2006/11/24 16:10:05
@@ -1,5 +1,15 @@
+2006-11-24  David Fernandez  <dfernandez@cct.co.uk>
+
+	* cdl/hal_i386_pc.cdl: Added the interface
+	  CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS, and the option
+	  CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS, with a calculated value
+	  equal to the sum of the previous interface and the COMM_CHANNELS
+	  macro. This will implement the old logic used in redboot.h and
+	  hal_if.c in a more general way, and within a wider scope, avoiding
+	  conflicts among .h files and .c files defining local versions.
+
 2005-06-20  Frank Pagliughi <fpagliughi@mindspring.com>
 
 	* cdl/hal_i386_pc.cdl, include/pkgconf/mlt_i386_pc_grub_hi.*:
 	Support for booting with GRUB in the High Memory.
 
Index: hal/common/current/ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/dfernandez/Projects/ecos/packages/hal/common/current/ChangeLog,v
retrieving revision 1.1.1.1
diff -u -5 -B -b -w -p -r1.1.1.1 ChangeLog
--- hal/common/current/ChangeLog	2006/06/26 10:53:29	1.1.1.1
+++ hal/common/current/ChangeLog	2006/11/24 16:13:31
@@ -1,5 +1,13 @@
+2006-11-24  David Fernandez  <dfernandez@cct.co.uk>
+
+	* src/hal_if.c: Modified to remove the definition of ...NUM_CHANNELS
+	  to avoid conflicts with redboot.h, that defines the same, and is
+	  included under some circunstances. That logic is moved to the
+	  platform hal to be implemented in a more general way that avoids
+	  these conflicts.
+
 2005-06-27  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* include/hal_tables.h (CYG_HAL_TABLE_{QUALIFIED_}ENTRY): added
 	CYGBLD_ATTRIB_USED so that gcc 3.4.4 does not discard entries
 	which are not refereced explicitly. Problem reported by

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