Add volatile qualifier (#1283)

Add volatile qualifier

This is needed to ensure that the memory mapped address it always read.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
pull/1285/head
Gaurav-Aggarwal-AWS 4 months ago committed by GitHub
parent b3e6cff1f2
commit 28a20d5a69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

1
.gitignore vendored

@ -11,6 +11,7 @@
[Oo]bj/
[Ll]og/
[Ll]ogs/
[Bb]uild/
# CodeWarrior temporary files
*.tdt

@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* https://www.FreeRTOS.org
* https://www.github.com/FreeRTOS
* https://github.com/FreeRTOS
*
*/
@ -54,12 +54,12 @@
static uint8_t readb( uintptr_t addr )
{
return *( (uint8_t *) addr );
return *( (volatile uint8_t *) addr );
}
static void writeb( uint8_t b, uintptr_t addr )
{
*( (uint8_t *) addr ) = b;
*( (volatile uint8_t *) addr ) = b;
}
void vOutNS16550( struct device *dev, unsigned char c )

Loading…
Cancel
Save