You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/12/20 15:23:28 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5017: libc: Enable terminal api regardless of CONFIG_SERIAL_TERMIOS setting

xiaoxiang781216 commented on a change in pull request #5017:
URL: https://github.com/apache/incubator-nuttx/pull/5017#discussion_r772452911



##########
File path: drivers/serial/serial.c
##########
@@ -1332,12 +1333,28 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
             }
             break;
 
-#ifdef CONFIG_SERIAL_TERMIOS
           case TCFLSH:
             {
               /* Empty the tx/rx buffers */
 
-              irqstate_t flags = enter_critical_section();
+              irqstate_t flags;
+
+              /* tcdrain is a cancellation point */
+
+              if (enter_cancellation_point())

Review comment:
       > Why was the cancellation point check moved into the switch statement inside the ioctl?
   
   This change try to unify terminal function implementation:
   
   1. All functions are simple userspace wrappers around ioctl
   2. No special syscall function(tcdrain) anymore
   
   > We usually have it in the API itself (as it was), which make it easy to read and identify.
   
   How about add uart_tcdrain static function?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org