Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

sys/libiec/debug.c

Go to the documentation of this file.
00001 /*
00002  *  This program is free software; you can redistribute it and/or
00003  *  modify it under the terms of the GNU General Public License
00004  *  as published by the Free Software Foundation; either version
00005  *  2 of the License, or (at your option) any later version.
00006  *
00007  *  Copyright 2001-2004 Spiro Trikaliotis
00008  *
00009  */
00010 
00020 #if DBG
00021 
00022 #include <wdm.h>
00023 #include "cbm_driver.h"
00024 #include "i_iec.h"
00025 
00026 /* Since we need the originals of these functions here, undefine them! */
00027 #undef READ_PORT_UCHAR
00028 #undef WRITE_PORT_UCHAR
00029 
00035 VOID
00036 cbmiec_show_port(IN UCHAR *Str)
00037 {
00038     FUNC_DEF
00039 
00040     DBG_ASSERT(Str != 0);
00041 
00042     DBG_PORT((DBG_PREFIX 
00043         "%s: 0x378 = 0x%02x, 0x379 = 0x%02x, 0x37a = 0x%02x",
00044         Str,
00045         (unsigned int) READ_PORT_UCHAR((PUCHAR) 0x378),
00046         (unsigned int) READ_PORT_UCHAR((PUCHAR) 0x379),
00047         (unsigned int) READ_PORT_UCHAR((PUCHAR) 0x37A)
00048         ));
00049 }
00050 
00059 VOID
00060 DbgWp(IN PUCHAR Port, IN UCHAR Value)
00061 {
00062     FUNC_DEF 
00063 
00064     DBG_PORT((DBG_PREFIX "WRITE_PORT_UCHAR(0x%p, %02x)", Port, (int)Value));
00065 
00066     cbmiec_show_port("Before Writing");
00067 
00068     WRITE_PORT_UCHAR(Port, Value);
00069 
00070     cbmiec_show_port("After Writing ");
00071 }
00072 
00081 UCHAR
00082 DbgRp(IN PUCHAR Port)
00083 {
00084     UCHAR Value;
00085 
00086     FUNC_DEF
00087 
00088     cbmiec_show_port("Before Reading");
00089 
00090     Value = READ_PORT_UCHAR(Port);
00091 
00092     DBG_PORT((DBG_PREFIX "READ_PORT_UCHAR(0x%p) = %02x", Port, (int)Value));
00093 
00094     cbmiec_show_port("After Reading ");
00095 
00096     return Value;
00097 }
00098 
00107 VOID
00108 cbmiec_show_state(IN PDEVICE_EXTENSION Pdx, IN UCHAR *Str)
00109 {
00110     FUNC_DEF
00111 
00112     DBG_ASSERT(Pdx != 0);
00113     DBG_ASSERT(Str != 0);
00114 
00115     DBG_SUCCESS((DBG_PREFIX "%s: data=%d, clk=%d, atn=%d", Str, 
00116         CBMIEC_GET(PP_DATA_IN), CBMIEC_GET(PP_CLK_IN), CBMIEC_GET(PP_ATN_IN)));
00117 }
00118 
00119 #endif /* #if DBG */

Generated on Sun Apr 30 18:45:48 2006 for opencbm by  doxygen 1.4.2