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.


_______________________________________________
bugs mailing list
bugs@rtems.org
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to