2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2000 BSDi
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * $FreeBSD: src/sys/dev/acpica/Osd/OsdDebug.c,v 1.9 2004/09/02 04:28:05 njl Exp $
28 * $DragonFly: src/sys/dev/acpica5/Osd/OsdDebug.c,v 1.3 2006/07/05 15:43:50 y0netan1 Exp $
32 * 6.8 : Debugging support
36 #include <sys/param.h>
37 #include <sys/kernel.h>
39 #include <machine/bus.h>
41 #include <ddb/db_output.h>
45 #include <dev/acpica5/acpivar.h>
48 AcpiOsGetLine(char *Buffer)
53 db_readline(Buffer, 80);
54 for (cp = Buffer; *cp != 0; cp++)
59 printf("AcpiOsGetLine called but no input support");
60 return (AE_NOT_EXIST);
65 AcpiOsDbgAssert(void *FailedAssertion, void *FileName, UINT32 LineNumber,
68 printf("ACPI: %s:%d - %s\n", (char *)FileName, LineNumber, Message);
69 printf("ACPI: assertion %s\n", (char *)FailedAssertion);
73 AcpiOsSignal(UINT32 Function, void *Info)
75 ACPI_SIGNAL_FATAL_INFO *fatal;
78 case ACPI_SIGNAL_FATAL:
79 fatal = (ACPI_SIGNAL_FATAL_INFO *)Info;
80 printf("ACPI fatal signal, type 0x%x code 0x%x argument 0x%x",
81 fatal->Type, fatal->Code, fatal->Argument);
82 Debugger("AcpiOsSignal");
85 case ACPI_SIGNAL_BREAKPOINT:
87 Debugger((char *)Info);
92 return (AE_BAD_PARAMETER);
99 acpi_EnterDebugger(void)
101 ACPI_PARSE_OBJECT obj;
102 static int initted = 0;
105 printf("Initialising ACPICA debugger...\n");
110 printf("Entering ACPICA debugger...\n");
111 AcpiDbUserCommands('A', &obj);
113 #endif /* ACPI_DEBUGGER */