1
0
Fork 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
1 changed files with 6 additions and 5 deletions

View File

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