1
0

pl011: use types.h definition of uint32 instead of 'unsigned long'

This commit is contained in:
Aaron Lindsay 2012-09-29 23:11:30 -04:00
parent fa96f9293b
commit e550deab5c

View File

@ -18,6 +18,8 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <types.h>
#define PL011_SERIAL_BASE 0x10009000 #define PL011_SERIAL_BASE 0x10009000
#define PL011_SERIAL_FLAG_REGISTER 0x18 #define PL011_SERIAL_FLAG_REGISTER 0x18
#define PL011_SERIAL_BUFFER_FULL (1 << 5) #define PL011_SERIAL_BUFFER_FULL (1 << 5)
@ -25,9 +27,8 @@
void pl011_putc(char c) void pl011_putc(char c)
{ {
/* Wait until the serial buffer is empty */ /* Wait until the serial buffer is empty */
while (*(volatile unsigned long*)(PL011_SERIAL_BASE + PL011_SERIAL_FLAG_REGISTER) while (*(volatile uint32*)(PL011_SERIAL_BASE + PL011_SERIAL_FLAG_REGISTER) & (PL011_SERIAL_BUFFER_FULL));
& (PL011_SERIAL_BUFFER_FULL));
/* When it's empty, put our character at the base */ /* When it's empty, put our character at the base */
*(volatile unsigned long*)PL011_SERIAL_BASE = c; *(volatile uint32*)PL011_SERIAL_BASE = c;
} }