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 *****************************************************************************/
13 #include "calculatecrc.h"
14 #include "calculatecrc.h"
18 /****************************************************************************
19 * prints a 0-terminated string to serial console
22 * R3 - pointer to string in memory
27 * R3, R4, R5, R6, R7, R8, R9
28 ****************************************************************************/
44 /****************************************************************************
45 * prints Hex integer to the UART and the NVRAM (using board io_putchar)
48 * R3 - integer to print
53 * R3, R4, R5, R6, R7, R8, R9
54 ****************************************************************************/
55 #define _io_gen_print_nib(reg, src, shift) \
56 srdi reg, src, shift; \
57 andi. reg, reg, 0x0F; \
60 addi reg, reg, ('A'-'0'-10); \
65 ASM_ENTRY(io_printhex64)
70 _io_gen_print_nib(r3, r9, 60)
71 _io_gen_print_nib(r3, r9, 56)
72 _io_gen_print_nib(r3, r9, 52)
73 _io_gen_print_nib(r3, r9, 48)
74 _io_gen_print_nib(r3, r9, 44)
75 _io_gen_print_nib(r3, r9, 40)
76 _io_gen_print_nib(r3, r9, 36)
77 _io_gen_print_nib(r3, r9, 32)
79 _io_gen_print_nib(r3, r9, 28)
80 _io_gen_print_nib(r3, r9, 24)
81 _io_gen_print_nib(r3, r9, 20)
82 _io_gen_print_nib(r3, r9, 16)
84 _io_gen_print_nib(r3, r9, 12)
85 _io_gen_print_nib(r3, r9, 8)
87 _io_gen_print_nib(r3, r9, 4)
88 _io_gen_print_nib(r3, r9, 0)
93 ASM_ENTRY(io_printhex32)
98 ASM_ENTRY(io_printhex16)
103 ASM_ENTRY(io_printhex8)
109 /****************************************************************************
110 * print the address and its contents as 64-bit hex values
113 * R3 - Address to read from
117 * Modifies Registers:
118 * R3, R4, R5, R6, R7, R8, R9, R10
119 ****************************************************************************/
120 #if 0 /* currently unused */