move the generic arm kernel & exec to arm-native
[AROS.git] / arch / arm-native / kernel / kernel_debug.c
blob0111da71a18d6bd0401683aad398622f0e0200bf
1 /*
2 Copyright © 2013-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/kernel.h>
7 #include <inttypes.h>
9 #include <kernel_base.h>
10 #include <kernel_debug.h>
11 #include <kernel_intern.h>
12 #include <hardware/pl011uart.h>
14 void (*_KrnPutC)(char) = NULL;
16 inline void krnWaitSerOut()
18 while(1)
20 if ((*(volatile uint32_t *)(PL011_0_BASE + PL011_FR) & PL011_FR_TXFF) == 0) break;
25 inline void krnSerPutC(uint8_t chr)
27 krnWaitSerOut();
29 if (chr == '\n')
31 *(volatile uint32_t *)(PL011_0_BASE + PL011_DR) = '\r';
32 krnWaitSerOut();
34 *(volatile uint32_t *)(PL011_0_BASE + PL011_DR) = chr;
37 int krnPutC(int chr, struct KernelBase *KernelBase)
39 if (chr == 0x03)
40 _KrnPutC = NULL;
41 else
43 if (_KrnPutC)
44 _KrnPutC(chr);
46 krnSerPutC(chr);