changeset 39:1cad8f70dc64

8057585: UART: The bit flags used for notification status are not set/reset properly Reviewed-by: jld Contributed-by: alexey.karaksin@oracle.com
author alkonsta
date Fri, 05 Sep 2014 18:48:02 +0400
parents 510e625c9bcf
children 2b18411e8c54
files src/share/linux/native/com/oracle/dio/uart/uart.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/linux/native/com/oracle/dio/uart/uart.c	Wed Sep 03 12:04:14 2014 -0400
+++ b/src/share/linux/native/com/oracle/dio/uart/uart.c	Fri Sep 05 18:48:02 2014 +0400
@@ -48,7 +48,7 @@
     if (port->subscribedEvents & SERIAL_OUT_EMPTY) {
         if(!(port->notifiedEvents & SERIAL_OUT_EMPTY)){
             javanotify_uart_event(OUTPUT_BUFFER_EMPTY, handle, param, res);
-            port->notifiedEvents != SERIAL_OUT_EMPTY;
+            port->notifiedEvents |= SERIAL_OUT_EMPTY;
         }
     }else{
         javanotify_serial_event(JAVACALL_EVENT_SERIAL_WRITE, handle, res);
@@ -59,7 +59,7 @@
     uart_handle port = (uart_handle)handle;
     if ( (port->subscribedEvents & SERIAL_IN_OVERRUN) && !(port->notifiedEvents & SERIAL_IN_OVERRUN)) {
         javanotify_uart_event(INPUT_BUFFER_OVERRUN, (javacall_handle) port, 0, error);
-        port->notifiedEvents != SERIAL_IN_OVERRUN;
+        port->notifiedEvents |= SERIAL_IN_OVERRUN;
     }
 }
 
@@ -68,7 +68,7 @@
     if ( port->subscribedEvents & SERIAL_IN_AVAILABLE){
         if(!(port->notifiedEvents & SERIAL_IN_AVAILABLE)) {
             javanotify_uart_event(INPUT_DATA_AVAILABLE, (javacall_handle) port, param, res);
-            port->notifiedEvents != SERIAL_IN_AVAILABLE;
+            port->notifiedEvents |= SERIAL_IN_AVAILABLE;
         }
     }else{
     //unblock midp thread
@@ -160,6 +160,8 @@
 
     ((serial_handle)handle)->out_total_written = 0;
 
+        ((uart_handle)handle)->notifiedEvents &= ~SERIAL_OUT_EMPTY;
+
     javacall_result result = jc_serial_write_common(handle, buffer, size, bytesWritten);
 
     if(JAVACALL_WOULD_BLOCK == result && ((uart_handle)handle)->subscribedEvents & SERIAL_OUT_EMPTY){