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

Ning Yang (@yangn0) gitlab at rtems.org
Thu Aug 15 17:58:24 UTC 2024




Ning Yang commented on a discussion on bsps/shared/dev/serial/arm-pl011.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/47#note_111105

 > +  size_t n
 > +)
 > +{
 > +  arm_pl011_context *context = (arm_pl011_context *) base;
 > +  volatile pl011_base *regs = arm_pl011_get_regs(base);
 > +  size_t i = 0;
 > +
 > +  if (n > 0) {
 > +    arm_pl011_enable_irq(regs, PL011_UARTI_TXI);
 > +    /*
 > +     * When write_buffer writes the first character, if txfifo is full,
 > +     * it will return directly. This will cause this character to be lost.
 > +     * If txfifo is full, wait for it to be not full.
 > +     */
 > +    while (arm_pl011_is_txfifo_full(regs));
 > +    while (!arm_pl011_is_txfifo_full(regs) && i < n) {

I added `volatile` to `regs` in line 450. Will it work in line 461? Is it correct to use `volatile` in this way?

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/47#note_111105
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/20240815/bd7f7256/attachment-0001.htm>


More information about the bugs mailing list