OsdDebug.c (114246) | OsdDebug.c (128225) |
---|---|
1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2000 BSDi 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 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 25 * SUCH DAMAGE. 26 * | 1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2000 BSDi 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 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 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/dev/acpica/Osd/OsdDebug.c 114246 2003-04-29 18:50:34Z njl $ | 27 * $FreeBSD: head/sys/dev/acpica/Osd/OsdDebug.c 128225 2004-04-14 03:39:08Z njl $ |
28 */ 29 30/* 31 * 6.8 : Debugging support 32 */ 33 34#include "opt_ddb.h" 35#include <sys/param.h> | 28 */ 29 30/* 31 * 6.8 : Debugging support 32 */ 33 34#include "opt_ddb.h" 35#include <sys/param.h> |
36#include <sys/systm.h> 37#include <sys/cons.h> | |
38#include <sys/kernel.h> | 36#include <sys/kernel.h> |
39 | |
40#include <sys/bus.h> | 37#include <sys/bus.h> |
41#include <machine/resource.h> | |
42#include <machine/bus.h> | 38#include <machine/bus.h> |
43#include <sys/rman.h> | |
44 | 39 |
45#include <ddb/ddb.h> 46#include <ddb/db_output.h> 47 | |
48#include "acpi.h" 49#include "acdebug.h" 50#include <dev/acpica/acpivar.h> 51 52UINT32 53AcpiOsGetLine(char *Buffer) 54{ 55#ifdef DDB 56 char *cp; 57 58 db_readline(Buffer, 80); 59 for (cp = Buffer; *cp != 0; cp++) 60 if (*cp == '\n') 61 *cp = 0; | 40#include "acpi.h" 41#include "acdebug.h" 42#include <dev/acpica/acpivar.h> 43 44UINT32 45AcpiOsGetLine(char *Buffer) 46{ 47#ifdef DDB 48 char *cp; 49 50 db_readline(Buffer, 80); 51 for (cp = Buffer; *cp != 0; cp++) 52 if (*cp == '\n') 53 *cp = 0; |
62 return(AE_OK); | 54 return (AE_OK); |
63#else 64 printf("AcpiOsGetLine called but no input support"); | 55#else 56 printf("AcpiOsGetLine called but no input support"); |
65 return(AE_NOT_EXIST); 66#endif | 57 return (AE_NOT_EXIST); 58#endif /* DDB */ |
67} 68 69void | 59} 60 61void |
70AcpiOsDbgAssert(void *FailedAssertion, void *FileName, UINT32 LineNumber, char *Message) | 62AcpiOsDbgAssert(void *FailedAssertion, void *FileName, UINT32 LineNumber, 63 char *Message) |
71{ 72 printf("ACPI: %s:%d - %s\n", (char *)FileName, LineNumber, Message); 73 printf("ACPI: assertion %s\n", (char *)FailedAssertion); 74} 75 76ACPI_STATUS | 64{ 65 printf("ACPI: %s:%d - %s\n", (char *)FileName, LineNumber, Message); 66 printf("ACPI: assertion %s\n", (char *)FailedAssertion); 67} 68 69ACPI_STATUS |
77AcpiOsSignal ( 78 UINT32 Function, 79 void *Info) | 70AcpiOsSignal(UINT32 Function, void *Info) |
80{ 81 ACPI_SIGNAL_FATAL_INFO *fatal; 82 char *message; 83 | 71{ 72 ACPI_SIGNAL_FATAL_INFO *fatal; 73 char *message; 74 |
84 switch(Function) { | 75 switch (Function) { |
85 case ACPI_SIGNAL_FATAL: 86 fatal = (ACPI_SIGNAL_FATAL_INFO *)Info; 87 printf("ACPI fatal signal, type 0x%x code 0x%x argument 0x%x", 88 fatal->Type, fatal->Code, fatal->Argument); 89 Debugger("AcpiOsSignal"); 90 break; 91 92 case ACPI_SIGNAL_BREAKPOINT: 93 message = (char *)Info; 94 Debugger(message); 95 break; 96 97 default: | 76 case ACPI_SIGNAL_FATAL: 77 fatal = (ACPI_SIGNAL_FATAL_INFO *)Info; 78 printf("ACPI fatal signal, type 0x%x code 0x%x argument 0x%x", 79 fatal->Type, fatal->Code, fatal->Argument); 80 Debugger("AcpiOsSignal"); 81 break; 82 83 case ACPI_SIGNAL_BREAKPOINT: 84 message = (char *)Info; 85 Debugger(message); 86 break; 87 88 default: |
98 return(AE_BAD_PARAMETER); | 89 return (AE_BAD_PARAMETER); |
99 } | 90 } |
100 return(AE_OK); | 91 92 return (AE_OK); |
101} 102 103#ifdef ACPI_DEBUGGER 104void 105acpi_EnterDebugger(void) 106{ 107 ACPI_PARSE_OBJECT obj; 108 static int initted = 0; 109 110 if (!initted) { 111 printf("Initialising ACPICA debugger...\n"); 112 AcpiDbInitialize(); 113 initted = 1; 114 } 115 116 printf("Entering ACPICA debugger...\n"); 117 AcpiDbUserCommands('A', &obj); 118} | 93} 94 95#ifdef ACPI_DEBUGGER 96void 97acpi_EnterDebugger(void) 98{ 99 ACPI_PARSE_OBJECT obj; 100 static int initted = 0; 101 102 if (!initted) { 103 printf("Initialising ACPICA debugger...\n"); 104 AcpiDbInitialize(); 105 initted = 1; 106 } 107 108 printf("Entering ACPICA debugger...\n"); 109 AcpiDbUserCommands('A', &obj); 110} |
119#endif | 111#endif /* ACPI_DEBUGGER */ |