xref: /kvm-unit-tests/lib/powerpc/io.c (revision 7d36db351752e29ad27eaafe3f102de7064e429b)
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License, version 2, as
4  * published by the Free Software Foundation.
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9  * GNU General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public License
12  * along with this program; if not, write to the Free Software
13  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
14  *
15  * Copyright IBM Corp. 2008
16  *
17  * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18  */
19 
20 #include "libcflat.h"
21 
22 #define BASE 0xf0000000
23 #define _putc ((volatile char *)(BASE))
24 #define _exit ((volatile char *)(BASE+1))
25 
26 void puts(const char *s)
27 {
28 	while (*s != '\0')
29 		*_putc = *s++;
30 }
31 
32 void exit(int code)
33 {
34 	*_exit = code;
35 }
36