Changeset 86699 in vbox for trunk/src/VBox/VMM/include
- Timestamp:
- Oct 25, 2020 10:44:39 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 141083
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/DBGFInternal.h
r86683 r86699 54 54 #define DBGF_TRACER_EVT_SZ (DBGF_TRACER_EVT_HDR_SZ + DBGF_TRACER_EVT_PAYLOAD_SZ) 55 55 56 57 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS 58 /** @name Breakpoint handling defines. 59 * @{ */ 60 /** Maximum number of breakpoints supported (power of two). */ 61 #define DBGF_BP_COUNT_MAX _1M 62 /** Size of a single breakpoint structure in bytes. */ 63 #define DBGF_BP_ENTRY_SZ 64 64 /** Number of breakpoints handled in one chunk (power of two). */ 65 #define DBGF_BP_COUNT_PER_CHUNK _64K 66 /** Number of chunks required to support all breakpoints. */ 67 #define DBGF_BP_CHUNK_COUNT (DBGF_BP_COUNT_MAX / DBGF_BP_COUNT_PER_CHUNK) 68 /** @} */ 69 #endif 56 70 57 71 … … 763 777 typedef DBGFBPSEARCHOPT *PDBGFBPSEARCHOPT; 764 778 #else 779 780 /** An invalid breakpoint chunk ID. */ 781 #define DBGF_BP_CHUNK_ID_INVALID UINT32_MAX 782 /** Generates a unique breakpoint handle from the given chunk ID and entry inside the chunk. */ 783 #define DBGF_BP_HND_CREATE(a_idChunk, a_idEntry) RT_MAKE_U32(a_idEntry, a_idChunk); 784 /** Returns the chunk ID from the given breakpoint handle. */ 785 #define DBGF_BP_HND_GET_CHUNK_ID(a_hBp) ((uint32_t)RT_HI_U16(a_hBp)) 786 /** Returns the entry index inside a chunk from the given breakpoint handle. */ 787 #define DBGF_BP_HND_GET_ENTRY(a_hBp) ((uint32_t)RT_LO_U16(a_hBp)) 788 789 790 /** 791 * The internal breakpoint state, shared part. 792 */ 793 typedef struct DBGFBPINT 794 { 795 /** The publicly visible part. */ 796 DBGFBPPUB Pub; 797 /** The opaque user argument for the owner callback, Ring-3 Ptr. */ 798 R3PTRTYPE(void *) pvUserR3; 799 } DBGFBPINT; 800 AssertCompileSize(DBGFBPINT, DBGF_BP_ENTRY_SZ); 801 /** Pointer to an internal breakpoint state. */ 802 typedef DBGFBPINT *PDBGFBPINT; 803 /** Pointer to an const internal breakpoint state. */ 804 typedef const DBGFBPINT *PCDBGFBPINT; 805 806 807 /** 808 * The internal breakpoint state, R0 part. 809 */ 810 typedef struct DBGFBPINTR0 811 { 812 /** The owner handle. */ 813 DBGFBPOWNER hOwner; 814 /** Flag whether the breakpoint is in use. */ 815 bool fInUse; 816 /** Padding to 8 byte alignment. */ 817 bool afPad[3]; 818 /** Opaque user data for the owner callback, Ring-0 Ptr. */ 819 R0PTRTYPE(void *) pvUserR0; 820 } DBGFBPINTR0; 821 AssertCompileMemberAlignment(DBGFBPINTR0, pvUserR0, 8); 822 AssertCompileSize(DBGFBPINTR0, 16); 823 /** Pointer to an internal breakpoint state - Ring-0 Ptr. */ 824 typedef R0PTRTYPE(DBGFBPINTR0 *) PDBGFBPINTR0; 825 826 765 827 /** 766 828 * Hardware breakpoint state. … … 769 831 { 770 832 /** The flat GC address of the breakpoint. */ 771 RTGCUINTPTR GCPtr;772 /** The breakpoint handle if active, NIL_DBGFBP if disabled. */773 DBGFBPhBp;833 RTGCUINTPTR GCPtr; 834 /** The breakpoint handle if active, NIL_DBGFBP if not in use. */ 835 volatile DBGFBP hBp; 774 836 /** The access type (one of the X86_DR7_RW_* value). */ 775 uint8_t fType;837 uint8_t fType; 776 838 /** The access size. */ 777 uint8_t cb;839 uint8_t cb; 778 840 /** Flag whether the breakpoint is currently enabled. */ 779 boolfEnabled;841 volatile bool fEnabled; 780 842 /** Padding. */ 781 uint8_t bPad;843 uint8_t bPad; 782 844 } DBGFBPHW; 783 845 AssertCompileSize(DBGFBPHW, 16); … … 786 848 /** Pointer to a const hardware breakpoint state. */ 787 849 typedef const DBGFBPHW *PCDBGFBPHW; 850 851 852 /** 853 * A breakpoint table chunk, ring-3 state. 854 */ 855 typedef struct DBGFBPCHUNKR3 856 { 857 /** Pointer to the R3 base of the chunk. */ 858 R3PTRTYPE(PDBGFBPINT) pBpBaseR3; 859 /** Bitmap of free/occupied breakpoint entries. */ 860 R3PTRTYPE(volatile void *) pbmAlloc; 861 /** Number of free breakpoints in the chunk. */ 862 volatile uint32_t cBpsFree; 863 /** The chunk index this tracking structure refers to. */ 864 uint32_t idChunk; 865 } DBGFBPCHUNKR3; 866 /** Pointer to a breakpoint table chunk - Ring-3 Ptr. */ 867 typedef DBGFBPCHUNKR3 *PDBGFBPCHUNKR3; 868 /** Pointer to a const breakpoint table chunk - Ring-3 Ptr. */ 869 typedef const DBGFBPCHUNKR3 *PCDBGFBPCHUNKR3; 870 871 872 /** 873 * Breakpoint table chunk, ring-0 state. 874 */ 875 typedef struct DBGFBPCHUNKR0 876 { 877 /** The chunks memory. */ 878 RTR0MEMOBJ hMemObj; 879 /** The ring-3 mapping object. */ 880 RTR0MEMOBJ hMapObj; 881 /** Pointer to the breakpoint entries base. */ 882 R0PTRTYPE(PDBGFBPINT) paBpBaseSharedR0; 883 /** Pointer to the Ring-0 only part of the breakpoints. */ 884 PDBGFBPINTR0 paBpBaseR0Only; 885 } DBGFBPCHUNKR0; 886 /** Pointer to a breakpoint table chunk - Ring-0 Ptr. */ 887 typedef R0PTRTYPE(DBGFBPCHUNKR0 *) PDBGFBPCHUNKR0; 788 888 #endif 789 889 … … 875 975 DBGFBPSEARCHOPT Int3; 876 976 #else 977 /** @name Breakpoint handling related state. 978 * @{ */ 877 979 /** Array of hardware breakpoints (0..3). 878 980 * This is shared among all the CPUs because life is much simpler that way. */ 879 DBGFBPHW aHwBreakpoints[4]; 981 DBGFBPHW aHwBreakpoints[4]; 982 /** @} */ 880 983 #endif 881 984 … … 1017 1120 /** Pointer to the tracer instance if enabled. */ 1018 1121 R0PTRTYPE(struct DBGFTRACERINSR0 *) pTracerR0; 1122 1123 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS 1124 /** @name Breakpoint handling related state, Ring-0 only part. 1125 * @{ */ 1126 /** Global breakpoint table chunk array. */ 1127 DBGFBPCHUNKR0 aBpChunks[DBGF_BP_CHUNK_COUNT]; 1128 /** The L1 lookup tables memory object. */ 1129 RTR0MEMOBJ hMemObjBpLocL1; 1130 /** The L1 lookup tables mapping object. */ 1131 RTR0MEMOBJ hMapObjBpLocL1; 1132 /** Base pointer to the L1 locator table. */ 1133 R0PTRTYPE(volatile uint32_t *) paBpLocL1R0; 1134 /** Flag whether the breakpoint manager was initialized (on demand). */ 1135 bool fInit; 1136 /** @} */ 1137 #endif 1019 1138 } DBGFR0PERVM; 1020 1139 … … 1091 1210 /** @} */ 1092 1211 1212 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS 1213 /** @name Breakpoint handling related state. 1214 * @{ */ 1215 /** Global breakpoint table chunk array. */ 1216 DBGFBPCHUNKR3 aBpChunks[DBGF_BP_CHUNK_COUNT]; 1217 /** Base pointer to the L1 locator table. */ 1218 R3PTRTYPE(volatile uint32_t *) paBpLocL1R3; 1219 /** @} */ 1220 #endif 1221 1093 1222 /** The type database lock. */ 1094 1223 RTSEMRW hTypeDbLock; … … 1138 1267 void dbgfR3AsRelocate(PUVM pUVM, RTGCUINTPTR offDelta); 1139 1268 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS 1140 DECLHIDDEN(int) dbgfR3BpInit(P VM pVM);1141 DECLHIDDEN(int) dbgfR3BpTerm(P VM pVM);1269 DECLHIDDEN(int) dbgfR3BpInit(PUVM pUVM); 1270 DECLHIDDEN(int) dbgfR3BpTerm(PUVM pUVM); 1142 1271 #else 1143 1272 int dbgfR3BpInit(PVM pVM); … … 1188 1317 #ifdef IN_RING0 1189 1318 DECLHIDDEN(void) dbgfR0TracerDestroy(PGVM pGVM, PDBGFTRACERINSR0 pTracer); 1319 DECLHIDDEN(void) dbgfR0BpInit(PGVM pGVM); 1320 DECLHIDDEN(void) dbgfR0BpDestroy(PGVM pGVM); 1190 1321 #endif /* !IN_RING0 */ 1191 1322
Note:
See TracChangeset
for help on using the changeset viewer.