00001 /*++ 00002 00003 Copyright (c) 1990 Microsoft Corporation 00004 Copyright (c) 1998 Intel Corporation 00005 00006 Module Name: 00007 00008 kdpcpu.h 00009 00010 Abstract: 00011 00012 Machine specific kernel debugger data types and constants 00013 00014 Author: 00015 00016 Mark Lucovsky (markl) 29-Aug-1990 00017 00018 Revision History: 00019 00020 --*/ 00021 00022 #ifndef _KDPCPU_ 00023 #define _KDPCPU_ 00024 00025 // IA64 instruction is in a 128-bit bundle. Each bundle consists of 3 instruction slots. 00026 // Each instruction slot is 41-bit long. 00027 // 00028 // 00029 // 127 87 86 46 45 5 4 1 0 00030 // ------------------------------------------------------------ 00031 // | slot 2 | slot 1 | slot 0 |template|S| 00032 // ------------------------------------------------------------ 00033 // 00034 // 127 96 95 64 63 32 31 0 00035 // ------------------------------------------------------------ 00036 // | byte 3 | byte 2 | byte 1 | byte 0 | 00037 // ------------------------------------------------------------ 00038 // 00039 // This presents two incompatibilities with conventional processors: 00040 // 1. The IA64 IP address is at the bundle bundary. The instruction slot number is 00041 // stored in ISR.ei at the time of exception. 00042 // 2. The 41-bit instruction format is not byte-aligned. 00043 // 00044 // Break instruction insertion must be done with proper bit-shifting to align with the selected 00045 // instruction slot. Further, to insert break instruction insertion at a specific slot, we must 00046 // be able to specify instruction slot as part of the address. We therefore define an EM address as 00047 // bundle address + slot number with the least significant two bit always zero: 00048 // 00049 // 31 4 3 2 1 0 00050 // -------------------------------- 00051 // | bundle address |slot#|0 0| 00052 // -------------------------------- 00053 // 00054 // The EM address as defined is the byte-aligned address that is closest to the actual instruction slot. 00055 // i.e., The EM instruction address of slot #0 is equal to bundle address. 00056 // slot #1 is equal to bundle address + 4. 00057 // slot #2 is equal to bundle address + 8. 00058 00059 // 00060 // Upon exception, the bundle address is kept in IIP, and the instruction slot which caused 00061 // the exception is in ISR.ei. Kernel exception handler will construct the flat address and 00062 // export it in ExceptionRecord.ExceptionAddress. 00063 00064 00065 #define KDP_BREAKPOINT_TYPE ULONGLONG // 64-bit ULONGLONG type is needed to cover 41-bit EM break instruction. 00066 #define KDP_BREAKPOINT_ALIGN 0x3 // An EM address consists of bundle and slot number and is 32-bit aligned. 00067 #define KDP_BREAKPOINT_VALUE (BREAK_INSTR | (DEBUG_STOP_BREAKPOINT << 6)) 00068 00069 #endif // _KDPCPU_