Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

debugsup.c File Reference

#include "mi.h"

Go to the source code of this file.

Functions

PVOID MmDbgReadCheck (IN PVOID VirtualAddress)
PVOID MmDbgWriteCheck (IN PVOID VirtualAddress)
PVOID64 MmDbgReadCheck64 (IN PVOID64 VirtualAddress)
PVOID64 MmDbgWriteCheck64 (IN PVOID64 VirtualAddress)
PVOID MmDbgTranslatePhysicalAddress (IN PHYSICAL_ADDRESS PhysicalAddress)


Function Documentation

PVOID MmDbgReadCheck IN PVOID  VirtualAddress  ) 
 

Definition at line 28 of file ppc/debugsup.c.

References KSEG0_BASE, KSEG2_BASE, MmIsAddressValid(), NULL, and PAGE_SIZE.

Referenced by IopWriteDriverList(), KdpMoveMemory(), KdpReadIoSpace(), KdpReadVirtualMemory(), KdpSearchMemory(), KeDumpMachineState(), KiDumpParameterImages(), KiPcToFileHeader(), KiScanBugCheckCallbackList(), and MmDbgReadCheck64().

00034 : 00035 00036 PowerPC implementation specific: 00037 00038 This routine returns the virtual address which is valid (mapped) 00039 for read access. 00040 00041 The address may be within the PowerPC kernel BAT or may be 00042 otherwise valid and readable. 00043 00044 Arguments: 00045 00046 VirtualAddress - Supplies the virtual address to check. 00047 00048 Return Value: 00049 00050 Returns NULL if the address is not valid or readable, otherwise 00051 returns the virtual address. 00052 00053 Environment: 00054 00055 Kernel mode IRQL at DISPATCH_LEVEL or greater. 00056 00057 --*/ 00058 00059 { 00060 if ((VirtualAddress >= (PVOID)KSEG0_BASE) && 00061 (VirtualAddress < (PVOID)KSEG2_BASE)) { 00062 return VirtualAddress; 00063 } 00064 00065 if ((VirtualAddress >= (PVOID)KIPCR) && 00066 (VirtualAddress < (PVOID)(KIPCR2 + PAGE_SIZE))) { 00067 return VirtualAddress; 00068 } 00069 00070 if (!MmIsAddressValid (VirtualAddress)) { 00071 return NULL; 00072 } 00073 00074 return VirtualAddress; 00075 }

PVOID64 MmDbgReadCheck64 IN PVOID64  VirtualAddress  ) 
 

Definition at line 156 of file ppc/debugsup.c.

References NULL.

Referenced by KdpReadVirtualMemory(), and KdpReadVirtualMemory64().

00162 : 00163 00164 PowerPC implementation specific: 00165 00166 This routine returns the virtual address which is valid (mapped) 00167 for read access. 00168 00169 The address may be within the PowerPC kernel BAT or may be 00170 otherwise valid and readable. 00171 00172 NO 64-bit suport, return NULL. 00173 00174 Arguments: 00175 00176 VirtualAddress - Supplies the virtual address to check. 00177 00178 Return Value: 00179 00180 Returns NULL if the address is not valid or readable, otherwise 00181 returns the virtual address. 00182 00183 Environment: 00184 00185 Kernel mode IRQL at DISPATCH_LEVEL or greater. 00186 00187 --*/ 00188 00189 { 00190 return NULL; 00191 }

PVOID MmDbgTranslatePhysicalAddress IN PHYSICAL_ADDRESS  PhysicalAddress  ) 
 

Definition at line 233 of file ppc/debugsup.c.

References BYTE_OFFSET, KiFlushSingleTb(), MiGetVirtualAddressMappedByPte, MmDebugPte, PAGE_SHIFT, TRUE, _MMPTE::u, and ValidKernelPte.

Referenced by KdpReadPhysicalMemory(), KdpWritePhysicalMemory(), and MmDbgWriteCheck().

00239 : 00240 00241 PowerPC implementation specific: 00242 00243 This routine maps the specified physical address and returns 00244 the virtual address which maps the physical address. 00245 00246 The next call to MmDbgTranslatePhyiscalAddress removes the 00247 previous phyiscal address translation, hence on a single 00248 physical address can be examined at a time (can't cross page 00249 boundaries). 00250 00251 Arguments: 00252 00253 PhysicalAddress - Supplies the phyiscal address to map and translate. 00254 00255 Return Value: 00256 00257 The virtual address which corresponds to the phyiscal address. 00258 00259 Environment: 00260 00261 Kernel mode IRQL at DISPATCH_LEVEL or greater. 00262 00263 --*/ 00264 00265 { 00266 PVOID BaseAddress; 00267 00268 BaseAddress = MiGetVirtualAddressMappedByPte (MmDebugPte); 00269 00270 KiFlushSingleTb (TRUE, BaseAddress); 00271 00272 *MmDebugPte = ValidKernelPte; 00273 MmDebugPte->u.Hard.PageFrameNumber = PhysicalAddress.LowPart >> PAGE_SHIFT; 00274 00275 return (PVOID)((ULONG)BaseAddress + BYTE_OFFSET(PhysicalAddress.LowPart)); 00276 } }

PVOID MmDbgWriteCheck IN PVOID  VirtualAddress  ) 
 

Definition at line 78 of file ppc/debugsup.c.

References KSEG0_BASE, KSEG2_BASE, MiGetPteAddress, MmDbgTranslatePhysicalAddress(), MmGetPhysicalAddress(), MmIsAddressValid(), NULL, PAGE_SIZE, and _MMPTE::u.

Referenced by KdpAddBreakpoint(), KdpMoveMemory(), KdpWriteIoSpace(), KdpWriteVirtualMemory(), KdSetOwedBreakpoints(), and MmDbgWriteCheck64().

00084 : 00085 00086 PowerPC implementation specific: 00087 00088 This routine returns the virtual address which is valid (mapped) 00089 for write access. 00090 00091 The address may be within the PowerPC kernel BAT or may be 00092 otherwise valid and writable. 00093 00094 Arguments: 00095 00096 VirtualAddress - Supplies the virtual address to check. 00097 00098 Return Value: 00099 00100 Returns NULL if the address is not valid or writable, otherwise 00101 returns the virtual address. 00102 00103 Environment: 00104 00105 Kernel mode IRQL at DISPATCH_LEVEL or greater. 00106 00107 --*/ 00108 00109 { 00110 PMMPTE PointerPte; 00111 00112 if ((VirtualAddress >= (PVOID)KSEG0_BASE) && 00113 (VirtualAddress < (PVOID)KSEG2_BASE)) { 00114 return VirtualAddress; 00115 } 00116 00117 if ((VirtualAddress >= (PVOID)KIPCR) && 00118 (VirtualAddress < (PVOID)(KIPCR2 + PAGE_SIZE))) { 00119 return VirtualAddress; 00120 } 00121 00122 if (!MmIsAddressValid (VirtualAddress)) { 00123 return NULL; 00124 } 00125 00126 // 00127 // This is being added back in permanently since the PowerPC 00128 // hardware debug registers break in before the instruction 00129 // is executed. This will generally allow the kernel debugger 00130 // to step over the instruction that triggered the hardware 00131 // debug register breakpoint. 00132 // 00133 00134 if (VirtualAddress <= MM_HIGHEST_USER_ADDRESS) { 00135 00136 // This code is similar in spirit to that in the MIPS version. 00137 // It returns a writable alias for breakpoints in user pages. 00138 // However, it uses the virtual address reserved for the debugger, 00139 // rather than the wired-in KSEG0 translation available in MIPS. 00140 // 00141 // N.B. Microsoft says kernel debugger can't do user code at all. 00142 00143 return MmDbgTranslatePhysicalAddress ( 00144 MmGetPhysicalAddress (VirtualAddress) ); 00145 } 00146 00147 PointerPte = MiGetPteAddress (VirtualAddress); 00148 if (PointerPte->u.Hard.Write == 0) { 00149 return NULL; 00150 } 00151 00152 return VirtualAddress; 00153 }

PVOID64 MmDbgWriteCheck64 IN PVOID64  VirtualAddress  ) 
 

Definition at line 194 of file ppc/debugsup.c.

References NULL.

Referenced by KdpWriteVirtualMemory(), and KdpWriteVirtualMemory64().

00200 : 00201 00202 PowerPC implementation specific: 00203 00204 This routine returns the virtual address which is valid (mapped) 00205 for write access. 00206 00207 The address may be within the PowerPC kernel BAT or may be 00208 otherwise valid and writable. 00209 00210 NO 64-bit suport, return NULL. 00211 00212 Arguments: 00213 00214 VirtualAddress - Supplies the virtual address to check. 00215 00216 Return Value: 00217 00218 Returns NULL if the address is not valid or writable, otherwise 00219 returns the virtual address. 00220 00221 Environment: 00222 00223 Kernel mode IRQL at DISPATCH_LEVEL or greater. 00224 00225 --*/ 00226 00227 { 00228 00229 return NULL; 00230 }


Generated on Sat May 15 19:43:25 2004 for test by doxygen 1.3.7