OsdStream.c revision 1.1.8.2 1 1.1.8.2 simonb /* $NetBSD: OsdStream.c,v 1.1.8.2 2006/04/22 11:38:49 simonb Exp $ */
2 1.1.8.2 simonb
3 1.1.8.2 simonb /*
4 1.1.8.2 simonb * Copyright 2001 Wasabi Systems, Inc.
5 1.1.8.2 simonb * All rights reserved.
6 1.1.8.2 simonb *
7 1.1.8.2 simonb * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 1.1.8.2 simonb *
9 1.1.8.2 simonb * Redistribution and use in source and binary forms, with or without
10 1.1.8.2 simonb * modification, are permitted provided that the following conditions
11 1.1.8.2 simonb * are met:
12 1.1.8.2 simonb * 1. Redistributions of source code must retain the above copyright
13 1.1.8.2 simonb * notice, this list of conditions and the following disclaimer.
14 1.1.8.2 simonb * 2. Redistributions in binary form must reproduce the above copyright
15 1.1.8.2 simonb * notice, this list of conditions and the following disclaimer in the
16 1.1.8.2 simonb * documentation and/or other materials provided with the distribution.
17 1.1.8.2 simonb * 3. All advertising materials mentioning features or use of this software
18 1.1.8.2 simonb * must display the following acknowledgement:
19 1.1.8.2 simonb * This product includes software developed for the NetBSD Project by
20 1.1.8.2 simonb * Wasabi Systems, Inc.
21 1.1.8.2 simonb * 4. The name of Wasabi Systems, Inc. may not be used to endorse
22 1.1.8.2 simonb * or promote products derived from this software without specific prior
23 1.1.8.2 simonb * written permission.
24 1.1.8.2 simonb *
25 1.1.8.2 simonb * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26 1.1.8.2 simonb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.1.8.2 simonb * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.1.8.2 simonb * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 1.1.8.2 simonb * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.1.8.2 simonb * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.1.8.2 simonb * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.1.8.2 simonb * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.1.8.2 simonb * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.1.8.2 simonb * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.1.8.2 simonb * POSSIBILITY OF SUCH DAMAGE.
36 1.1.8.2 simonb */
37 1.1.8.2 simonb
38 1.1.8.2 simonb /*
39 1.1.8.2 simonb * OS Services Layer
40 1.1.8.2 simonb *
41 1.1.8.2 simonb * 6.6: Stream I/O
42 1.1.8.2 simonb */
43 1.1.8.2 simonb
44 1.1.8.2 simonb #include <sys/cdefs.h>
45 1.1.8.2 simonb __KERNEL_RCSID(0, "$NetBSD: OsdStream.c,v 1.1.8.2 2006/04/22 11:38:49 simonb Exp $");
46 1.1.8.2 simonb
47 1.1.8.2 simonb #include "opt_ddb.h"
48 1.1.8.2 simonb
49 1.1.8.2 simonb #include <sys/types.h>
50 1.1.8.2 simonb #include <sys/systm.h>
51 1.1.8.2 simonb
52 1.1.8.2 simonb #include <dev/acpi/acpica.h>
53 1.1.8.2 simonb
54 1.1.8.2 simonb #ifdef DDB
55 1.1.8.2 simonb #include <ddb/db_output.h>
56 1.1.8.2 simonb #endif
57 1.1.8.2 simonb
58 1.1.8.2 simonb extern int acpi_indebugger;
59 1.1.8.2 simonb
60 1.1.8.2 simonb /*
61 1.1.8.2 simonb * AcpiOsPrintf:
62 1.1.8.2 simonb *
63 1.1.8.2 simonb * Formatted stream output.
64 1.1.8.2 simonb */
65 1.1.8.2 simonb void ACPI_INTERNAL_VAR_XFACE
66 1.1.8.2 simonb AcpiOsPrintf(const char *Format, ...)
67 1.1.8.2 simonb {
68 1.1.8.2 simonb
69 1.1.8.2 simonb va_list ap;
70 1.1.8.2 simonb
71 1.1.8.2 simonb va_start(ap, Format);
72 1.1.8.2 simonb AcpiOsVprintf(Format, ap);
73 1.1.8.2 simonb va_end(ap);
74 1.1.8.2 simonb }
75 1.1.8.2 simonb
76 1.1.8.2 simonb void
77 1.1.8.2 simonb AcpiOsVprintf(const char *Format, va_list Args)
78 1.1.8.2 simonb {
79 1.1.8.2 simonb
80 1.1.8.2 simonb #ifdef DDB
81 1.1.8.2 simonb if (acpi_indebugger)
82 1.1.8.2 simonb db_vprintf(Format, Args);
83 1.1.8.2 simonb else
84 1.1.8.2 simonb #endif
85 1.1.8.2 simonb vprintf(Format, Args);
86 1.1.8.2 simonb }
87