예제 #1
0
파일: ppc64.c 프로젝트: nikunjad/SLOF
/**
 * Standard write function for the libc.
 *
 * @param fd    file descriptor (should always be 1 or 2)
 * @param buf   pointer to the array with the output characters
 * @param count number of bytes to be written
 * @return      the number of bytes that have been written successfully
 */
ssize_t write(int fd, const void *buf, size_t count)
{
	int i;
	char *ptr = (char *)buf;

	if (fd != 1 && fd != 2)
		return 0;

	for (i = 0; i < count; i++) {
		if (*ptr == '\n')
			io_putchar('\r');
		io_putchar(*ptr++);
	}

	return i;
}
예제 #2
0
파일: ppc64.c 프로젝트: nikunjad/SLOF
/* This should probably be temporary until a better solution is found */
void
asm_cout(long Character, long UART, long NVRAM __attribute__((unused)))
{
	if (UART)
		io_putchar(Character);
}
예제 #3
0
파일: ppc64.c 프로젝트: xHypervisor/WinQEMU
/* This should probably be temporary until a better solution is found */
void
asm_cout(long Character, long UART, long NVRAM ATTRIBUTE_UNUSED)
{
	if (UART)
		io_putchar(Character);
}