comparison target-utils/libcommon/serio.S @ 11:40f607bb0a2c

target-utils refactored
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Wed, 01 May 2013 07:39:35 +0000
parents loadagent/serio.S@da98dc08f575
children d7591faa1258
comparison
equal deleted inserted replaced
10:e2e80a09338e 11:40f607bb0a2c
1 #include "ns16550.h"
2
3 @ this module implements the elementary serial I/O operations
4
5 .text
6 .code 32
7 .global serial_out
8 serial_out:
9 ldr r1, =uart_base
10 ldr r2, [r1]
11 1: ldrb r3, [r2, #NS16550_LSR]
12 tst r3, #NS16550_LSR_THRE
13 beq 1b
14 strb r0, [r2, #NS16550_THR]
15 bx lr
16
17 .global serial_in_poll
18 serial_in_poll:
19 ldr r1, =uart_base
20 ldr r2, [r1]
21 ldrb r3, [r2, #NS16550_LSR]
22 tst r3, #NS16550_LSR_DR
23 mvneq r0, #1
24 bxeq lr
25 ldrb r0, [r2, #NS16550_RBR]
26 bx lr