|
|
1.1 root 1: /******************************************************************************
2: * Copyright (c) 2004, 2011 IBM Corporation
3: * All rights reserved.
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
8: *
9: * Contributors:
10: * IBM Corporation - initial implementation
11: *****************************************************************************/
12:
13: #include <macros.h>
14: #include <cpu.h>
15:
16: .text
17:
18: /****************************************************************************
19: * prints one character to serial console
20: *
21: * Input:
22: * R3 - character
23: *
24: * Returns: -
25: *
26: * Modifies Registers:
27: * R3, R4, R5, R6, R7
28: ****************************************************************************/
29: ENTRY(io_putchar)
30: sldi r6,r3,(24+32)
31: li r3,0x58
32: li r4,0
33: li r5,1
34: .long 0x44000022
35: blr
36:
37: ENTRY(io_getchar)
38: mr r10,r3
39: li r3,0x54
40: li r4,0
41: .long 0x44000022
42: mr. r3,r4
43: beq 1f
44: srdi r3,r5,(24+32)
45: stb r3,0(r10)
46: 1: blr
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.