RTEMS | dev/serial: Refactor the pl011 driver to be extensible (!47)

Ning Yang (@yangn0) gitlab at rtems.org
Tue Aug 20 15:47:40 UTC 2024




Ning Yang commented: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/47#note_111352


Hi @gedare,

I reduced the use of `volatile` as much as possible. And finally found that it is necessary for the following functions to use `volatile`:

`arm_pl011_write_char` : If there is no `volatile`, there will be problems with the output of printf.

`arm_pl011_is_rxfifo_empty`

`arm_pl011_is_txfifo_full`

```
  /*
   * Wait for any data in the TXFIFO to be sent then wait while the
   * transmiter is active.
   */
  while (
    (((volatile arm_pl011_uart *) regs)->base.uartfr &
      PL011_UARTFR_TXFE) == 0 ||
    (((volatile arm_pl011_uart *) regs)->base.uartfr &
      PL011_UARTFR_BUSY) != 0
  ) {
      /* Wait */
  }
```

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/47#note_111352
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240820/f60d9a6a/attachment.htm>


More information about the bugs mailing list