[Cbe-oss-dev] [PATCH] libspe2: fix interface of spe_out_mbox_read

Kazunori Asayama asayama at sm.sony.co.jp
Thu Nov 16 12:56:12 EST 2006


Attached is a patch to fix the bug in libspe2 below:

	- The function prototype of spe_out_mbox_read is not conformed
	  to the specification.

--
(ASAYAMA Kazunori
  (asayama at sm.sony.co.jp))
t
	
-------------- next part --------------
Index: libspe2/libspe2.c
===================================================================
--- libspe2.orig/libspe2.c
+++ libspe2/libspe2.c
@@ -234,9 +234,9 @@ int spe_mfcio_tag_status_read(spe_contex
  * SPE Mailbox Facility
  */
  
-int spe_out_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count, int behavior) 
+int spe_out_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count) 
 {
-	return _base_spe_out_mbox_read(spe, mbox_data, count, behavior);
+	return _base_spe_out_mbox_read(spe, mbox_data, count);
 }
 
 int spe_out_mbox_status (spe_context_ptr_t spe)
Index: libspe2/libspe2.h
===================================================================
--- libspe2.orig/libspe2.h
+++ libspe2/libspe2.h
@@ -147,7 +147,7 @@ int spe_mfcio_tag_status_read(spe_contex
 /*
  * SPE Mailbox Facility
  */ 
-int spe_out_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count, int behavior);
+int spe_out_mbox_read (spe_context_ptr_t spe, unsigned int *mbox_data, int count);
 
 int spe_out_mbox_status (spe_context_ptr_t spe);
 
Index: libspe2/spebase/mbox.c
===================================================================
--- libspe2.orig/spebase/mbox.c
+++ libspe2/spebase/mbox.c
@@ -32,8 +32,7 @@
 
 int _base_spe_out_mbox_read(spe_context_ptr_t spectx, 
                         unsigned int mbox_data[], 
-                        int count, 
-                        int behavior_flag)
+                        int count)
 {
 	int rc;
 
Index: libspe2/spebase/spebase.h
===================================================================
--- libspe2.orig/spebase/spebase.h
+++ libspe2/spebase/spebase.h
@@ -396,12 +396,7 @@ int _base_spe_mfcio_getf(spe_context_ptr
  *        The _base_spe_out_mbox_read function reads the contents of the SPE outbound interrupting
  *        mailbox for the SPE thread speid.
  * 
- *        If the behavior flag indicates ALL_BLOCKING the call will try to read exactly count mailbox entries
- *        and block until the read request is satisfied, i.e., exactly count mailbox entries
- *        have been read.
- *        If the behavior flag indicates ANY_BLOCKING the call will try to read up to count mailbox entries,
- *        and block until the read request is satisfied, i.e., at least 1 mailbox entry has been read.
- *        If the behavior flag indicates ANY_NON_BLOCKING the call will not block until the read request is satisfied,
+ *        The call will not block until the read request is satisfied,
  *        but instead return up to count currently available mailbox entries.
  * 
  *        spe_stat_out_intr_mbox can be called to ensure that data is available prior 
@@ -410,10 +405,6 @@ int _base_spe_mfcio_getf(spe_context_ptr
  * @param spectx  Specifies the SPE thread whose outbound mailbox is to be read.
  * @param mbox_data
  * @param count
- * @param behavior_flag 
- *           ALL_BLOCKING\n
- *           ANY_BLOCKING\n
- *           ANY_NON_BLOCKING\n
  * 
  *  
  * @retval       >0       the number of 32-bit mailbox messages read
@@ -425,8 +416,7 @@ int _base_spe_mfcio_getf(spe_context_ptr
  */
 int _base_spe_out_mbox_read(spe_context_ptr_t spectx, 
 			unsigned int mbox_data[], 
-			int count, 
-			int behavior_flag);
+			int count);
 
 /**
  *        The _base_spe_in_mbox_write function writes mbox_data to the SPE inbound


More information about the cbe-oss-dev mailing list