summaryrefslogtreecommitdiff
path: root/sys/arch/mvmeppc/stand/libbug/putchar.c
blob: e99ee1eb346caa28e6d9b8e95a10af2f4b7edbfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*	$OpenBSD: putchar.c,v 1.2 2004/01/24 21:12:38 miod Exp $ */

/*
 * putchar: easier to do this with outstr than to add more macros to
 * handle byte passing on the stack
 */

#include <sys/types.h>

#include "libbug.h"

void
putchar(c)
	int c;
{
	char ca;
	ca = (char)c & 0xFF;
	if (ca == '\n')
		putchar('\r');
	
	asm  volatile ("mr 3, %0" :: "r" (ca));
	MVMEPROM_CALL(MVMEPROM_OUTCHR);
}