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]

Re: Minor AT91 fix


Daniel Néri wrote:
Hello,

There's not much to say about the patch below,

Thanks, applied.


except that I think
there should really be some translation where eCos interrupt
priorities are suitably mapped to hardware interrupt levels.
>
E.g. using the generic 16x5x UART driver on AT91 gives a problem
because, for some reason, 99 was chosen as the interrupt priority
level.

Yes :-|. I think the attached patch is the only reasonable way forward. I rather hope 4 is a sensible alternative... I doubt 99 is.


Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/generic/16x5x/current/ChangeLog,v
retrieving revision 1.11
diff -u -5 -p -r1.11 ChangeLog
--- ChangeLog	18 Mar 2003 18:18:38 -0000	1.11
+++ ChangeLog	16 Jul 2003 02:09:00 -0000
@@ -1,5 +1,11 @@
+2003-07-16  Jonathan Larmour  <jifl@eCosCentric.com>
+
+	* src/ser_16x5x.c (CYG_IO_SERIAL_GENERIC_16X5X_INT_PRIORITY): Add
+	so that the calling hardware-specific drivers can override priorities.
+	Clarify flow control comment.
+
 2003-03-18  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/ser_16x5x.c (pc_serial_set_config): 
 	Flag for CYG_IO_SET_CONFIG_SERIAL_HW_RX_FLOW_THROTTLE is 32 bits.
 	
Index: src/ser_16x5x.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/generic/16x5x/current/src/ser_16x5x.c,v
retrieving revision 1.10
diff -u -5 -p -r1.10 ser_16x5x.c
--- src/ser_16x5x.c	18 Mar 2003 18:18:38 -0000	1.10
+++ src/ser_16x5x.c	16 Jul 2003 02:09:00 -0000
@@ -219,10 +219,15 @@ static SERIAL_FUNS(pc_serial_funs, 
                    pc_serial_stop_xmit
     );
 
 #include CYGDAT_IO_SERIAL_GENERIC_16X5X_INL
 
+#ifndef CYG_IO_SERIAL_GENERIC_16X5X_INT_PRIORITY
+# define CYG_IO_SERIAL_GENERIC_16X5X_INT_PRIORITY 4
+#endif
+
+
 // Internal function to actually configure the hardware to desired
 // baud rate, etc.
 static bool
 serial_config_port(serial_channel *chan, 
                    cyg_serial_info_t *new_config, bool init)
@@ -335,11 +340,11 @@ pc_serial_init(struct cyg_devtab_entry *
     // Really only required for interrupt driven devices
     (chan->callbacks->serial_init)(chan);
 
     if (chan->out_cbuf.len != 0) {
         cyg_drv_interrupt_create(ser_chan->int_num,
-                                 99,
+                                 CYG_IO_SERIAL_GENERIC_16X5X_INT_PRIORITY,
                                  (cyg_addrword_t)chan,
                                  pc_serial_ISR,
                                  pc_serial_DSR,
                                  &ser_chan->serial_interrupt_handle,
                                  &ser_chan->serial_interrupt);
@@ -441,11 +446,15 @@ pc_serial_set_config(serial_channel *cha
       }
       break;
     case CYG_IO_SET_CONFIG_SERIAL_HW_FLOW_CONFIG:
         // Nothing to do because we do support both RTSCTS and DSRDTR flow
         // control.
-        // Other targets would clear any unsupported flags here.
+        // Other targets would clear any unsupported flags here and
+        // would then return -ENOSUPP - the higher layer can then query
+        // what flags are set and decide what to do. This is optimised for
+        // the most common case - i.e. that authors know what their hardware
+        // is capable of.
         // We just return ENOERR.
       break;
 #endif
     default:
         return -EINVAL;

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