1/*	$NetBSD: putstr.S,v 1.1 2003/04/16 13:24:10 dsl Exp $	*/
2
3/*-
4 * Copyright (c) 2003 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by David Laight.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include <machine/asm.h>
33
34/*
35 * Diagnostic print routines callable from 32bit C code during early
36 * parts of the boot process.
37 */
38
39/*
40 * void putstr(const char *)
41 *
42 * display message on console
43 * bugs: message address must be less than 64k
44 */
45
46	.globl	_C_LABEL(putstr)
47_C_LABEL(putstr):
48	.code32
49	movl	4(%esp), %eax
50	pusha
51	movl	%eax, %esi
52
53	call	_C_LABEL(prot_to_real)
54	.code16
55
56	movl	%esi, %eax
57	call	message
58
59	calll	_C_LABEL(real_to_prot)
60	.code32
61	popa
62	ret
63
64/*
65 * void putint(int)
66 *
67 * display value on console as 8 hex digits followed by a space
68 */
69
70	.globl	_C_LABEL(putint)
71_C_LABEL(putint):
72	.code32
73	movl	4(%esp), %eax
74	pusha
75
76	call	_C_LABEL(prot_to_real)
77	.code16
78
79	call	dump_eax
80
81	calll	_C_LABEL(real_to_prot)
82	.code32
83	popa
84	ret
85