revert between 56095 -> 55830 in arch
[AROS.git] / arch / .unmaintained / m68k-pp-native / exec / rawputchar.c
blob799e2fa61f6be3eda5888fade97a420b73627f84
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Emit one character via raw IO
6 Lang: english
7 */
9 #include <aros/config.h>
11 #ifdef DO_SERIAL_DEBUG
12 # include <asm/registers.h>
13 #endif
15 /*****i***********************************************************************
17 NAME */
18 #include <proto/exec.h>
20 AROS_LH1(void, RawPutChar,
22 /* SYNOPSIS */
23 AROS_LHA(UBYTE, chr, D0),
25 /* LOCATION */
26 struct ExecBase *, SysBase, 86, Exec)
28 /* FUNCTION
29 Emits a single character.
31 INPUTS
32 chr - The character to emit
34 RESULT
35 None.
37 NOTES
38 This function is for very low level debugging only.
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 RawIOInit(), RawPutChar(), RawMayGetChar()
47 INTERNALS
49 HISTORY
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 #ifdef DO_SERIAL_DEBUG
57 * This does not work with xcopilot...
59 if (chr) {
61 * Wait until FIFO is half empty
63 while (0 == (RREG_W(UTX1) & FIFO_HALF_F)) {
65 WREG_W(UTX1) = (UWORD)chr;
67 #else
68 #ifdef AROS_PALM_DEBUG_HACK
69 /* This requires a patched XCopilot which turns writes to
70 address 0xdddddebc into output going to Linux shell
71 through a fprintf(stderr, chr). */
73 /* Don't write 0 bytes */
74 if (chr) {
75 *(UBYTE *)0xdddddebc = chr;
77 #endif
78 #endif
80 AROS_LIBFUNC_EXIT
81 } /* RawPutChar */