1 /******************************************************************************
2 * Copyright (c) 2004, 2008 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
18 void uart_send_byte(unsigned char b)
20 asm volatile ("":::"3","4","5","6","7");
25 * Standard write function for the libc.
27 * @param fd file descriptor (should always be 1 or 2)
28 * @param buf pointer to the array with the output characters
29 * @param count number of bytes to be written
30 * @return the number of bytes that have been written successfully
32 ssize_t write(int fd, const void *buf, size_t count)
35 char *ptr = (char *)buf;
37 if (fd != 1 && fd != 2)
40 for (i = 0; i < count; i++) {
43 uart_send_byte(*ptr++);