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
*****************************************************************************/
16
/****************************************************************************
17
* prints a 0-terminated string to serial console
20
* R3 - pointer to string in memory
25
* R3, R4, R5, R6, R7, R8, R9
26
****************************************************************************/
42
/****************************************************************************
43
* prints Hex integer to the UART and the NVRAM (using board io_putchar)
46
* R3 - integer to print
51
* R3, R4, R5, R6, R7, R8, R9
52
****************************************************************************/
53
#define _io_gen_print_nib(reg, src, shift) \
54
srdi reg, src, shift; \
55
andi. reg, reg, 0x0F; \
58
addi reg, reg, ('A'-'0'-10); \
63
ASM_ENTRY(io_printhex64)
68
_io_gen_print_nib(r3, r9, 60)
69
_io_gen_print_nib(r3, r9, 56)
70
_io_gen_print_nib(r3, r9, 52)
71
_io_gen_print_nib(r3, r9, 48)
72
_io_gen_print_nib(r3, r9, 44)
73
_io_gen_print_nib(r3, r9, 40)
74
_io_gen_print_nib(r3, r9, 36)
75
_io_gen_print_nib(r3, r9, 32)
77
_io_gen_print_nib(r3, r9, 28)
78
_io_gen_print_nib(r3, r9, 24)
79
_io_gen_print_nib(r3, r9, 20)
80
_io_gen_print_nib(r3, r9, 16)
82
_io_gen_print_nib(r3, r9, 12)
83
_io_gen_print_nib(r3, r9, 8)
85
_io_gen_print_nib(r3, r9, 4)
86
_io_gen_print_nib(r3, r9, 0)
91
ASM_ENTRY(io_printhex32)
96
ASM_ENTRY(io_printhex16)
101
ASM_ENTRY(io_printhex8)
107
/****************************************************************************
108
* print the address and its contents as 64-bit hex values
111
* R3 - Address to read from
115
* Modifies Registers:
116
* R3, R4, R5, R6, R7, R8, R9, R10
117
****************************************************************************/
118
#if 0 /* currently unused */