Changeset 4162 for branches/Grace/src
- Timestamp:
- Sep 2, 2000, 10:49:29 PM (25 years ago)
- Location:
- branches/Grace/src/win32k
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Grace/src/win32k/dev16/d16globl.c
r2898 r4162 1 /* $Id: d16globl.c,v 1.1 2000-02-25 18:19:24bird Exp $1 /* $Id: d16globl.c,v 1.1.4.1 2000-09-02 20:49:09 bird Exp $ 2 2 * 3 3 * d16globals - global data (16-bit) … … 18 18 *******************************************************************************/ 19 19 #include <os2.h> 20 #include "devSegDf.h" 20 21 #include "options.h" 21 22 #include "log.h" 23 22 24 23 25 /******************************************************************************* … … 27 29 /* Note: All global variables must be initialized! * 28 30 * Uninitialized variables ends up in DATA32. */ 31 PFN Device_Help = NULL; 32 ULONG TKSSBase16 = 0; 33 USHORT R0FlatCS16 = 0; 34 USHORT R0FlatDS16 = 0; 35 BOOL fInitTime = TRUE; 36 struct options 37 DATA16_GLOBAL options = DEFAULT_OPTION_ASSIGMENTS; 29 38 30 PFN Device_Help = NULL; 31 ULONG TKSSBase16 = 0; 32 USHORT R0FlatCS16 = 0; 33 USHORT R0FlatDS16 = 0; 34 BOOL fInitTime = TRUE; 39 CHAR szBuildDate[] = {__DATE__}; 40 CHAR szBuildTime[] = {__TIME__}; 35 41 36 struct options options = DEFAULT_OPTION_ASSIGMENTS;37 -
branches/Grace/src/win32k/dev16/d16strat.c
r4117 r4162 1 /* $Id: d16strat.c,v 1.8.4. 2 2000-08-30 04:11:26bird Exp $1 /* $Id: d16strat.c,v 1.8.4.3 2000-09-02 20:49:09 bird Exp $ 2 2 * 3 3 * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr) … … 30 30 /* Note that C-library function are only allowed during init! */ 31 31 32 #include "devSegDf.h" 32 33 #include "dev1632.h" 33 34 #include "dev16.h" … … 121 122 * @param pRp Request packet. 122 123 */ 123 USHORT dev0GenIOCtl(PRP_GENIOCTL pRp)124 USHORT NEAR dev0GenIOCtl(PRP_GENIOCTL pRp) 124 125 { 125 126 USHORT rc; … … 219 220 * @param pRp Request packet. 220 221 */ 221 USHORT dev1GenIOCtl(PRP_GENIOCTL pRp)222 USHORT NEAR dev1GenIOCtl(PRP_GENIOCTL pRp) 222 223 { 223 224 if (pRp->Category == IOCTL_W32K_K32 || pRp->Category == IOCTL_W32K_ELF) -
branches/Grace/src/win32k/dev32/devfirst.asm
r4010 r4162 1 ; $Id: devfirst.asm,v 1.5.4. 2 2000-08-14 08:57:06bird Exp $1 ; $Id: devfirst.asm,v 1.5.4.3 2000-09-02 20:49:12 bird Exp $ 2 2 ; 3 3 ; DevFirst - entrypoint and segment definitions … … 19 19 ; 20 20 public CODE16START 21 public CODE16_INITSTART 21 22 public DATA16START 22 23 public DATA16START 23 24 public DATA16_BSSSTART 24 25 public DATA16_CONSTSTART 26 public DATA16_INITSTART 25 27 public CODE16START 26 28 public CODE32START … … 103 105 call far ptr FLAT:GETKERNELINFO32 104 106 pop ds 105 ret n107 ret 106 108 _CallGetKernelInfo32 ENDP 107 109 … … 157 159 ; @author knut st. osmundsen 158 160 ; @remark es is cs, not ds! 159 _SSToDS_16a proc near161 _SSToDS_16a proc NEAR 160 162 assume CS:CODE16, DS:DATA16, ES:NOTHING 161 163 mov edx, ds:_TKSSBase16 ; get pointer held by _TKSSBase16 (pointer to stack base) … … 170 172 mov edx, eax 171 173 shr edx, 16 ; dx high 16-bit of 32-bit stack pointer. 172 ret 174 retn 173 175 _SSToDS_16a endp 174 176 … … 220 222 CODE32 ends 221 223 224 CODE16_INIT segment 225 CODE16_INITSTART label byte 226 CODE16_INIT ends 222 227 223 228 DATA16 segment … … 233 238 DATA16_CONST ends 234 239 240 DATA16_INIT segment 241 DATA16_INITSTART label byte 242 DATA16_INIT ends 243 235 244 DATA32 segment 236 245 DATA32START label byte -
branches/Grace/src/win32k/dev32/devlast.asm
r2898 r4162 1 ; $Id: devlast.asm,v 1.5 2000-02-25 18:15:03 bird Exp $1 ; $Id: devlast.asm,v 1.5.4.1 2000-09-02 20:49:13 bird Exp $ 2 2 ; 3 3 ; DevLast - the object file termintating the resident part of the objects. … … 21 21 ; Exported symbols 22 22 ; 23 public CODE16END24 23 public DATA16END 25 24 public DATA16_BSSEND 26 25 public DATA16_CONSTEND 26 public DATA16_INITEND 27 public DATA16_INIT_BSSEND 28 public DATA16_INIT_CONSTEND 27 29 public CODE16END 30 public CODE16_INITEND 28 31 public CODE32END 29 32 public DATA32END … … 32 35 public _VFTEND 33 36 public EH_DATAEND 37 34 38 public _CallR0Init32 35 39 public _CallVerifyImportTab32 … … 52 56 DATA16_CONST ends 53 57 58 DATA16_INIT segment 59 DATA16_INITEND db ? 60 DATA16_INIT ends 61 62 DATA16_INIT_BSS segment 63 DATA16_INIT_BSSEND db ? 64 DATA16_INIT_BSS ends 65 66 DATA16_INIT_CONST segment 67 DATA16_INIT_CONSTEND db ? 68 DATA16_INIT_CONST ends 69 70 CODE16 segment 71 CODE16END db ? 72 CODE16 ends 54 73 55 74 extrn R0INIT32:FAR 56 75 extrn VERIFYIMPORTTAB32:FAR 57 76 58 CODE16 segment 59 CODE16END db ? 60 77 CODE16_INIT segment 61 78 ;; 62 79 ; Thunk procedure for R0Init32. … … 67 84 ; @author knut st. osmundsen 68 85 _CallR0Init32 PROC NEAR 69 ASSUME CS:CODE16 86 ASSUME CS:CODE16_INIT 70 87 push ds 71 88 push word ptr [esp+6] ; push high word. … … 73 90 call far ptr FLAT:R0INIT32 74 91 pop ds 75 ret n92 ret 76 93 _CallR0Init32 ENDP 77 94 … … 84 101 ; @author knut st. osmundsen 85 102 _CallVerifyImportTab32 PROC NEAR 86 ASSUME CS:CODE16 103 ASSUME CS:CODE16_INIT 87 104 push ds 88 105 call far ptr FLAT:VERIFYIMPORTTAB32 89 106 pop ds 90 ret n107 ret 91 108 _CallVerifyImportTab32 ENDP 92 109 93 CODE16 ends 110 CODE16_INITEND LABEL BYTE 111 CODE16_INIT ends 94 112 95 113 … … 118 136 EH_DATA ends 119 137 138 120 139 END 121 140 -
branches/Grace/src/win32k/include/dev16.h
r2898 r4162 1 /* $Id: dev16.h,v 1.8 2000-02-25 18:15:04bird Exp $1 /* $Id: dev16.h,v 1.8.4.1 2000-09-02 20:49:13 bird Exp $ 2 2 * dev16 - 16-bit specific. Should not be used in 32-bit C/C++. 3 3 * … … 113 113 USHORT NEAR R0Init16(PRP_GENIOCTL pRp); 114 114 USHORT NEAR initGetDosTableData(void); 115 115 #if 0 /*ndef CODE16_INIT*/ 116 #pragma alloc_text(CODE16_INIT, dev0Init, dev1Init, R0Init16, initGetDosTableData) 117 #endif 116 118 117 119 /* … … 123 125 USHORT NEAR CallElfIOCtl(LIN pRpIOCtl); 124 126 USHORT NEAR CallWin32kIOCtl(LIN pRpIOCtl); 127 #if 0 /*ndef CODE16_INIT*/ 128 #pragma alloc_text(CODE16_INIT, CallR0Init32, CallVerifyImportTab32, CallGetKernelInfo32) 129 #endif 125 130 126 131 … … 148 153 #define SSToDS_16(pStackVar) (SSToDS_16a((void NEAR *)pStackVar)) 149 154 150 extern LIN 155 extern LIN NEAR SSToDS_16a(void NEAR *pStackVar); 151 156 152 157 /* 153 158 * START and END labels. NOTE: these are not bytes only assembly labels. 154 159 */ 155 extern char PASCAL CODE16START ;156 extern char PASCAL DATA16START ;157 160 extern char PASCAL DATA16START ; 158 161 extern char PASCAL DATA16_BSSSTART ; 159 162 extern char PASCAL DATA16_CONSTSTART; 163 extern char PASCAL DATA16_INITSTART ; 164 extern char PASCAL DATA16_INIT_BSSSTART ; 165 extern char PASCAL DATA16_INIT_CONSTSTART; 160 166 extern char PASCAL CODE16START ; 167 extern char PASCAL CODE16_INITSTART ; 161 168 extern char PASCAL CODE32START ; 162 169 extern char PASCAL DATA32START ; … … 168 175 extern char PASCAL CODE16END ; 169 176 extern char PASCAL DATA16END ; 170 extern char PASCAL DATA16END ;171 177 extern char PASCAL DATA16_BSSEND ; 172 178 extern char PASCAL DATA16_CONSTEND; 179 extern char PASCAL DATA16_INITEND ; 180 extern char PASCAL DATA16_INIT_BSSEND ; 181 extern char PASCAL DATA16_INIT_CONSTEND; 173 182 extern char PASCAL CODE16END ; 183 extern char PASCAL CODE16_INITEND ; 174 184 extern char PASCAL CODE32END ; 175 185 extern char PASCAL DATA32END ; … … 180 190 181 191 182 183 184 192 #endif -
branches/Grace/src/win32k/include/dev1632.h
r3834 r4162 1 /* $Id: dev1632.h,v 1.5.4. 1 2000-07-16 22:43:28bird Exp $1 /* $Id: dev1632.h,v 1.5.4.2 2000-09-02 20:49:14 bird Exp $ 2 2 * dev1632.h - Common header file for 16-bit and 32-bit C 3 3 * … … 64 64 65 65 #pragma pack() 66 67 68 /* 69 * Global data... 70 */ 71 extern CHAR DATA16_GLOBAL szBuildDate[]; 72 extern CHAR DATA16_GLOBAL szBuildTime[]; 73 #if defined(__IBMC__) || defined(__IBMCPP__) 74 #pragma map( szBuildDate , "_szBuildDate" ) 75 #pragma map( szBuildTime , "_szBuildTime" ) 66 76 #endif 77 78 #endif -
branches/Grace/src/win32k/include/dev32.h
r4010 r4162 1 /* $Id: dev32.h,v 1.8.4. 2 2000-08-14 08:57:06bird Exp $1 /* $Id: dev32.h,v 1.8.4.3 2000-09-02 20:49:14 bird Exp $ 2 2 * 3 3 * dev32 - header file for 32-bit part of the driver. … … 100 100 * START and END labels. NOTE: these are not bytes only assembly labels. 101 101 */ 102 extern char CODE16START ;103 extern char DATA16START ;104 102 extern char DATA16START ; 105 103 extern char DATA16_BSSSTART ; 106 104 extern char DATA16_CONSTSTART; 105 extern char DATA16_INITSTART ; 106 extern char DATA16_INIT_BSSSTART ; 107 extern char DATA16_INIT_CONSTSTART; 107 108 extern char CODE16START ; 109 extern char CODE16_INITSTART ; 108 110 extern char CODE32START ; 109 111 extern char DATA32START ; … … 115 117 extern char CODE16END ; 116 118 extern char DATA16END ; 117 extern char DATA16END ;118 119 extern char DATA16_BSSEND ; 119 120 extern char DATA16_CONSTEND; 121 extern char DATA16_INITEND ; 122 extern char DATA16_INIT_BSSEND ; 123 extern char DATA16_INIT_CONSTEND; 120 124 extern char CODE16END ; 125 extern char CODE16_INITEND ; 121 126 extern char CODE32END ; 122 127 extern char DATA32END ; … … 126 131 extern char EH_DATAEND ; 127 132 128 129 130 131 133 #endif -
branches/Grace/src/win32k/include/devSegDf.inc
r4005 r4162 1 ; $Id: devSegDf.inc,v 1.5.4. 2 2000-08-13 09:23:59bird Exp $1 ; $Id: devSegDf.inc,v 1.5.4.3 2000-09-02 20:49:15 bird Exp $ 2 2 ; 3 3 ; Segment definitions for win32k.sys. … … 18 18 DATA16_CONST ends 19 19 20 DATA16_GROUP group DATA16, DATA16_CONST, DATA16_BSS 20 DATA16_GLOBAL segment word public 'FAR_DATA' use16 21 DATA16_GLOBAL ends 22 23 ;DATA16_GROUP group DATA16, DATA16_CONST, DATA16_BSS, DATA16_GLOBAL 24 25 26 DATA16_INIT segment word public 'FAR_DATA' use16 27 DATA16_INIT ends 28 29 DATA16_INIT_CONST segment word public 'FAR_DATA' use16 30 DATA16_INIT_CONST ends 31 32 DATA16_INIT_BSS segment word public 'FAR_DATA' use16 33 DATA16_INIT_BSS ends 34 35 ;DATA16_INIT_GROUP group DATA16_INIT, DATA16_INIT_CONST, DATA16_INIT_BSS 36 ; 37 ;A bad trick to make all the 16-bit data segments one 38 ; 39 DATA16_GROUP group DATA16, DATA16_CONST, DATA16_BSS, DATA16_GLOBAL, DATA16_INIT, DATA16_INIT_CONST, DATA16_INIT_BSS 21 40 22 41 23 42 CODE16 segment word public 'CODE' use16 24 43 CODE16 ends 44 45 CODE16_INIT segment word public 'CODE' use16 46 CODE16_INIT ends 25 47 26 48 CODE16_IOSEG segment word public 'CODE' use16 -
branches/Grace/src/win32k/include/log.h
r3834 r4162 1 /* $Id: log.h,v 1.4.4. 1 2000-07-16 22:43:30bird Exp $1 /* $Id: log.h,v 1.4.4.2 2000-09-02 20:49:15 bird Exp $ 2 2 * 3 3 * log - C-style logging - kprintf. … … 25 25 #define OUTPUT_COM1 0x3f8 26 26 #define OUTPUT_COM2 0x2f8 27 #define OUTPUT_COM3 0x3e8 28 #define OUTPUT_COM4 0x2e8 27 29 28 30 -
branches/Grace/src/win32k/include/rmalloc.h
r2506 r4162 1 /* $Id: rmalloc.h,v 1.2 2000-01-24 01:44:08bird Exp $1 /* $Id: rmalloc.h,v 1.2.4.1 2000-09-02 20:49:15 bird Exp $ 2 2 * 3 3 * Resident Heap. … … 20 20 #endif 21 21 /* XLATON */ 22 /******************************************************************************* 23 * Structures and Typedefs * 24 *******************************************************************************/ 25 typedef struct HeapState_s /* note: this is used by both swappable and resident heaps */ 26 { 27 ULONG cbHeapSize; /* Amount of memory used by the heap free and used++. */ 28 ULONG cbHeapFree; /* Amount of used space. */ 29 ULONG cbHeapUsed; /* Amount of free space reserved. */ 30 ULONG cBlocksUsed; /* Count of used blocks. */ 31 ULONG cBlocksFree; /* Count of free blocks. */ 32 } HEAPSTATE, *PHEAPSTATE; 33 22 34 23 35 /******************************************************************************* … … 33 45 int _res_validptr2(void *, unsigned); 34 46 unsigned _res_memfree(void); 47 unsigned _res_memused(void); 48 int _res_state(PHEAPSTATE); 35 49 int _res_heap_check(void); 36 50 void _res_heapmin(void); 37 51 void _res_dump_subheaps(void); 38 52 void _res_dump_allocated(unsigned); 53 54 extern unsigned cbResHeapMax; /* Maximum amount of memory used by the heap. */ 55 39 56 40 57 /* XLATOFF */ -
branches/Grace/src/win32k/include/smalloc.h
r2506 r4162 1 /* $Id: smalloc.h,v 1.1 2000-01-24 01:44:08bird Exp $1 /* $Id: smalloc.h,v 1.1.4.1 2000-09-02 20:49:16 bird Exp $ 2 2 * 3 3 * Swappable Heap. … … 21 21 /* XLATON */ 22 22 23 struct HeapState_s; 24 23 25 /******************************************************************************* 24 26 * Exported Functions and Variables * … … 33 35 int _swp_validptr2(void *, unsigned); 34 36 unsigned _swp_memfree(void); 37 unsigned _swp_memused(void); 38 int _swp_state(struct HeapState_s *); 35 39 int _swp_heap_check(void); 36 40 void _swp_heapmin(void); 37 41 void _swp_dump_subheaps(void); 38 42 void _swp_dump_allocated(unsigned); 43 44 extern unsigned cbSwpHeapMax; /* Maximum amount of memory used by the heap. */ 39 45 40 46 /* XLATOFF */ -
branches/Grace/src/win32k/include/vprntf16.h
r2898 r4162 1 /* $Id: vprntf16.h,v 1.1 2000-02-25 18:15:06 bird Exp $1 /* $Id: vprntf16.h,v 1.1.4.1 2000-09-02 20:49:16 bird Exp $ 2 2 * 3 3 * printf/vprintf header file - 16bit. … … 30 30 * Function prototypes 31 31 */ 32 int printf16(const char *pszFormat, ...); 33 int vprintf16(const char *pszFormat, va_list args); 32 int FAR printf16(const char *pszFormat, ...); 33 int FAR vprintf16(const char *pszFormat, va_list args); 34 35 /*#pragma alloc_text(CODE16, printf16, vprintf16)*/ 34 36 35 37 -
branches/Grace/src/win32k/k32/k32QueryOTEs.cpp
r4112 r4162 1 /* $Id: k32QueryOTEs.cpp,v 1.1.2. 1 2000-08-29 19:47:02bird Exp $1 /* $Id: k32QueryOTEs.cpp,v 1.1.2.2 2000-09-02 20:49:17 bird Exp $ 2 2 * 3 3 * k32QueryOTEs - Get's the object table entries (OTEs) for a given … … 26 26 *******************************************************************************/ 27 27 #include <os2.h> 28 #include "devSegDf.h" /* Win32k segment definitions. */ 28 29 #include "OS2Krnl.h" 29 30 #include "ldrCalls.h" -
branches/Grace/src/win32k/ldr/myLDRQAppType.cpp
r4108 r4162 1 /* $Id: myLDRQAppType.cpp,v 1.3.4. 3 2000-08-28 22:44:24bird Exp $1 /* $Id: myLDRQAppType.cpp,v 1.3.4.4 2000-09-02 20:49:18 bird Exp $ 2 2 * 3 3 * _myLDRQAppType - _LDRQAppType overload. … … 23 23 #include <os2.h> 24 24 25 #include "devSegDf.h" /* Win32k segment definitions. */ 25 26 #include "OS2Krnl.h" 26 27 #include "avl.h" -
branches/Grace/src/win32k/ldr/myldrClose.cpp
r4065 r4162 1 /* $Id: myldrClose.cpp,v 1.5.4. 2 2000-08-21 22:59:39bird Exp $1 /* $Id: myldrClose.cpp,v 1.5.4.3 2000-09-02 20:49:18 bird Exp $ 2 2 * 3 3 * myldrClose - ldrClose … … 23 23 #include <stdlib.h> 24 24 25 #include "devSegDf.h" /* Win32k segment definitions. */ 25 26 #include "log.h" 26 27 #include "avl.h" -
branches/Grace/src/win32k/misc/avl.c
r3168 r4162 1 /* $Id: avl.c,v 1.4 2000-03-19 16:00:11 bird Exp $1 /* $Id: avl.c,v 1.4.4.1 2000-09-02 20:49:21 bird Exp $ 2 2 * 3 3 * AVL-Tree (lookalike) implementation. … … 24 24 *******************************************************************************/ 25 25 #include <os2.h> 26 #include "devSegDf.h" /* Win32k segment definitions. */ 26 27 #include "avl.h" 27 28 #if defined(RING0) || defined(RING3) -
branches/Grace/src/win32k/misc/cout.cpp
r1467 r4162 1 /* $Id: cout.cpp,v 1.2 1999-10-27 02:02:59bird Exp $1 /* $Id: cout.cpp,v 1.2.4.1 2000-09-02 20:49:21 bird Exp $ 2 2 * 3 3 * cout - cout replacement. … … 25 25 #include <stdarg.h> 26 26 27 #include "devSegDf.h" /* Win32k segment definitions. */ 27 28 #include "cout.h" 28 29 #include "options.h" -
branches/Grace/src/win32k/misc/log.c
r847 r4162 1 /* $Id: log.c,v 1.1 1999-09-06 02:20:02bird Exp $1 /* $Id: log.c,v 1.1.4.1 2000-09-02 20:49:21 bird Exp $ 2 2 * 3 3 * log - C-style logging - kprintf. … … 23 23 #include <builtin.h> 24 24 25 #include "devSegDf.h" /* Win32k segment definitions. */ 25 26 #include "dev32.h" 26 27 #include "options.h" -
branches/Grace/src/win32k/misc/malloc.c
r3834 r4162 1 /* $Id: malloc.c,v 1.6.4. 1 2000-07-16 22:43:40bird Exp $1 /* $Id: malloc.c,v 1.6.4.2 2000-09-02 20:49:22 bird Exp $ 2 2 * 3 3 * Common Heap - this forwards to the swappable heap! … … 20 20 ******************************************************************************/ 21 21 #include <os2.h> 22 #include "devSegDf.h" /* Win32k segment definitions. */ 22 23 #include "smalloc.h" 23 24 #include "rmalloc.h" -
branches/Grace/src/win32k/misc/new.cpp
r2540 r4162 1 /* $Id: new.cpp,v 1.4 2000-01-27 23:46:57bird Exp $1 /* $Id: new.cpp,v 1.4.4.1 2000-09-02 20:49:22 bird Exp $ 2 2 * 3 3 * new - new and delete operators. … … 21 21 #include <os2.h> 22 22 23 #include "devSegDf.h" /* Win32k segment definitions. */ 23 24 #include "new.h" 24 25 #include "rmalloc.h" -
branches/Grace/src/win32k/misc/rmalloc.c
r2507 r4162 1 /* $Id: rmalloc.c,v 1.3 2000-01-24 01:45:20bird Exp $1 /* $Id: rmalloc.c,v 1.3.4.1 2000-09-02 20:49:23 bird Exp $ 2 2 * 3 3 * Resident Heap. … … 50 50 ******************************************************************************/ 51 51 #include <os2.h> 52 #include "devSegDf.h" /* Win32k segment definitions. */ 52 53 #ifdef RING0 53 54 #include "dev32hlp.h" -
branches/Grace/src/win32k/misc/rmalloc_avl.c
r2511 r4162 1 /* $Id: rmalloc_avl.c,v 1.5 2000-01-24 18:19:00bird Exp $1 /* $Id: rmalloc_avl.c,v 1.5.4.1 2000-09-02 20:49:23 bird Exp $ 2 2 * 3 3 * Resident Heap - AVL. … … 47 47 ******************************************************************************/ 48 48 #include <os2.h> 49 #include "devSegDf.h" /* Win32k segment definitions. */ 49 50 #ifdef RING0 50 51 #include "dev32hlp.h" … … 120 121 static PHEAPANCHOR phaFirst; /* Pointer to the first anchor block.*/ 121 122 static PHEAPANCHOR phaLast; /* Pointer to the last anchor block.*/ 122 static unsignedcbResHeapMax; /* Maximum amount of memory used by the heap. */123 unsigned cbResHeapMax; /* Maximum amount of memory used by the heap. */ 123 124 124 125 #ifndef RING0 … … 898 899 899 900 /** 901 * Get amount of used memory (in bytes) 902 * @returns Amount of used memory (in bytes). 903 */ 904 unsigned _res_memused(void) 905 { 906 PHEAPANCHOR pha = phaFirst; 907 unsigned cb; 908 909 #ifdef ALLWAYS_HEAPCHECK 910 if (!_res_heap_check()) 911 kprintf(("_res_memused: _res_heap_check failed!\n")); 912 #endif 913 914 for (cb = 0; pha != NULL; pha = pha->pNext) 915 cb += pha->cbUsed; 916 917 return cb; 918 } 919 920 921 /** 922 * Collects the heap state. 923 * @returns 0 on success. 924 * -1 on error. 925 * @param pState Pointer to a RES_HEAPSTATE structure which is 926 * filled upon successful return. 927 */ 928 int _res_state(PHEAPSTATE pState) 929 { 930 PHEAPANCHOR pha; 931 932 #ifdef ALLWAYS_HEAPCHECK 933 if (!_res_heap_check()) 934 { 935 kprintf(("_res_state: _res_heap_check failed!\n")); 936 return -1; 937 } 938 #endif 939 940 if (pState == NULL) 941 return -1; 942 943 /* 944 * Loop thru all the anchor blocks and all memory blocks 945 * building the stats. 946 */ 947 memset(pState, 0, sizeof(HEAPSTATE)); 948 for (pha = phaFirst; pha != NULL; pha = pha->pNext) 949 { 950 AVLENUMDATA EnumData; 951 PAVLENUMDATA pEnumData = SSToDS(&EnumData); 952 PMEMBLOCK pmb; 953 954 /* count of free blocks */ 955 pmb = (PMEMBLOCK)AVLBeginEnumTree((PPAVLNODECORE)&pha->pmbFree, pEnumData, TRUE); 956 while (pmb) 957 { 958 pState->cBlocksFree++; 959 pmb = (PMEMBLOCK)AVLGetNextNode(pEnumData); 960 } 961 962 /* count of used blocks */ 963 pmb = (PMEMBLOCK)AVLBeginEnumTree((PPAVLNODECORE)&pha->pmbUsed, pEnumData, TRUE); 964 while (pmb) 965 { 966 pState->cBlocksUsed++; 967 pmb = (PMEMBLOCK)AVLGetNextNode(pEnumData); 968 } 969 970 /* sizes */ 971 pState->cbHeapSize += pha->cbSize; 972 pState->cbHeapFree += pha->cbFree; 973 pState->cbHeapUsed += pha->cbUsed; 974 } 975 976 return 0; 977 } 978 979 980 /** 900 981 * Checks heap integrety. 901 982 * @returns TRUE when ok. -
branches/Grace/src/win32k/misc/smalloc_avl.c
r2511 r4162 1 /* $Id: smalloc_avl.c,v 1.3 2000-01-24 18:19:00bird Exp $1 /* $Id: smalloc_avl.c,v 1.3.4.1 2000-09-02 20:49:24 bird Exp $ 2 2 * 3 3 * Swappable Heap - AVL. … … 59 59 ******************************************************************************/ 60 60 #include <os2.h> 61 #include "devSegDf.h" /* Win32k segment definitions. */ 61 62 #ifdef RING0 62 63 #include "dev32hlp.h" … … 140 141 static PHEAPANCHOR phaFirst; /* Pointer to the first anchor block.*/ 141 142 static PHEAPANCHOR phaLast; /* Pointer to the last anchor block.*/ 142 static unsignedcbSwpHeapMax; /* Maximum amount of memory used by the heap. */143 static PMEMBLOCKCHUNK pmcFirst; 143 unsigned cbSwpHeapMax; /* Maximum amount of memory used by the heap. */ 144 static PMEMBLOCKCHUNK pmcFirst; /* Pointer to the first memblock chunk. */ 144 145 145 146 #ifndef RING0 … … 1066 1067 1067 1068 return cb; 1069 } 1070 1071 1072 /** 1073 * Get amount of used memory (in bytes) 1074 * @returns Amount of used memory (in bytes). 1075 */ 1076 unsigned _swp_memused(void) 1077 { 1078 PHEAPANCHOR pha = phaFirst; 1079 unsigned cb; 1080 1081 #ifdef ALLWAYS_HEAPCHECK 1082 if (!_swp_heap_check()) 1083 kprintf(("_swp_memused: _swp_heap_check failed!\n")); 1084 #endif 1085 1086 for (cb = 0; pha != NULL; pha = pha->pNext) 1087 cb += pha->cbUsed; 1088 1089 return cb; 1090 } 1091 1092 1093 /** 1094 * Collects the heap state. 1095 * @returns 0 on success. 1096 * -1 on error. 1097 * @param pState Pointer to a HEAPSTATE structure which is 1098 * filled upon successful return. 1099 */ 1100 int _swp_state(PHEAPSTATE pState) 1101 { 1102 PHEAPANCHOR pha; 1103 1104 #ifdef ALLWAYS_HEAPCHECK 1105 if (!_res_heap_check()) 1106 { 1107 kprintf(("_res_state: _res_heap_check failed!\n")); 1108 return -1; 1109 } 1110 #endif 1111 1112 if (pState == NULL) 1113 return -1; 1114 1115 /* 1116 * Loop thru all the anchor blocks and all memory blocks 1117 * building the stats. 1118 */ 1119 memset(pState, 0, sizeof(HEAPSTATE)); 1120 for (pha = phaFirst; pha != NULL; pha = pha->pNext) 1121 { 1122 AVLENUMDATA EnumData; 1123 PAVLENUMDATA pEnumData = SSToDS(&EnumData); 1124 PMEMBLOCK pmb; 1125 1126 /* count of free blocks */ 1127 pmb = (PMEMBLOCK)AVLBeginEnumTree((PPAVLNODECORE)&pha->pcoreFree, pEnumData, TRUE); 1128 while (pmb) 1129 { 1130 pState->cBlocksFree++; 1131 pmb = (PMEMBLOCK)AVLGetNextNode(pEnumData); 1132 } 1133 1134 /* count of used blocks */ 1135 pmb = (PMEMBLOCK)AVLBeginEnumTree((PPAVLNODECORE)&pha->pcoreUsed, pEnumData, TRUE); 1136 while (pmb) 1137 { 1138 pState->cBlocksUsed++; 1139 pmb = (PMEMBLOCK)AVLGetNextNode(pEnumData); 1140 } 1141 1142 /* sizes */ 1143 pState->cbHeapSize += pha->cbSize; 1144 pState->cbHeapFree += pha->cbFree; 1145 pState->cbHeapUsed += pha->cbUsed; 1146 } 1147 1148 return 0; 1068 1149 } 1069 1150 -
branches/Grace/src/win32k/pe2lx/makefile
r3041 r4162 1 1 ############################################################################## 2 # $Id: makefile,v 1.20 2000-03-08 09:22:21bird Exp $2 # $Id: makefile,v 1.20.4.1 2000-09-02 20:49:25 bird Exp $ 3 3 # 4 4 # PD-Win32 API … … 20 20 OBJEXT = pe_obj 21 21 22 23 22 ############################################################################## 24 23 # Tools and Flags Addjustments 25 24 ############################################################################## 25 OBJDIR = $(WIN32KOBJ) 26 26 CINCLUDES = -I$(WIN32KINCLUDE) 27 27 28 28 CFLAGS = $(CINCLUDES) $(CFLAGS) -DRING3 -DPE2LX \ 29 -Ge+ - Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- -Gm- -Gn- -Ti+ -Rn29 -Ge+ -Gm- -Gn- -Ti+ -Rn -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- 30 30 CXXFLAGS = $(CINCLUDES) $(CXXFLAGS) -DRING3 -DPE2LX \ 31 -Ge+ - Wall+ppt-ppc-inl-cnv-gnr-vft- -Gm- -Gn- -Ti+ -Gx -Rn31 -Ge+ -Gm- -Gn- -Ti+ -Rn -Gx -Wall+ppt-ppc-inl-cnv-gnr-vft- 32 32 33 LD = ilink 34 LDFLAGS = /nologo /NOI /A:16 /NOE /packcode /packdata /pmtype:vio /Stack:4096 \ 33 LD2FLAGS = /nologo /NOI /A:16 /NOE /NOD /packcode /packdata /pmtype:vio /Stack:4096 \ 35 34 !ifdef DEBUG 36 35 !ifndef NODEBUGINFO … … 85 84 # Main targets. 86 85 ############################################################################## 87 TARGET 86 TARGET = pe2lx 88 87 89 OBJS = $(OBJDIR)\pe2lx.$(OBJEXT) \ 90 $(OBJDIR)\pe2lxmain.$(OBJEXT) \ 91 $(OBJDIR)\modulebase.$(OBJEXT) \ 92 $(OBJDIR)\malloc.$(OBJEXT) \ 93 $(OBJDIR)\smalloc_avl.$(OBJEXT) \ 94 $(OBJDIR)\avl.$(OBJEXT) \ 95 $(OBJDIR)\rmalloc_avl.$(OBJEXT) \ 96 $(OBJDIR)\new.$(OBJEXT) \ 97 $(OBJDIR)\stricmp.$(OBJEXT) \ 98 $(OBJDIR)\vprintf.$(OBJEXT) 88 OBJS =\ 89 $(OBJDIR)\pe2lx.$(OBJEXT)\ 90 $(OBJDIR)\pe2lxmain.$(OBJEXT)\ 91 $(OBJDIR)\modulebase.$(OBJEXT)\ 92 $(OBJDIR)\malloc.$(OBJEXT)\ 93 $(OBJDIR)\smalloc_avl.$(OBJEXT)\ 94 $(OBJDIR)\avl.$(OBJEXT)\ 95 $(OBJDIR)\rmalloc_avl.$(OBJEXT)\ 96 $(OBJDIR)\new.$(OBJEXT)\ 97 $(OBJDIR)\stricmp.$(OBJEXT)\ 98 $(OBJDIR)\vprintf.$(OBJEXT) 99 100 LIBS =\ 101 !if "$(CCENV)" == "VAC36" 102 $(VACPATH)\lib\cpprni36.lib \ 103 !else 104 $(VACPATH)\lib\cppon30.lib \ 105 !endif 99 106 100 107 101 102 all: $(OBJDIR) $(OBJDIR)\$(TARGET).exe 108 all: $(WIN32KBIN)\$(TARGET).exe 103 109 104 110 105 $( OBJDIR)\$(TARGET).exe: $(OBJS)111 $(WIN32KBIN)\$(TARGET).exe: $(OBJS) makefile 106 112 @echo linking $@ 107 $(LD) $(LDFLAGS) /OUT:$@ /MAP:$*.map $** 113 $(LD2) @<<$(OBJDIR)\$(@B).lnk 114 $(LD2FLAGS) 115 /OUT:$@ 116 /MAP:$*.map 117 $(OBJS: =^ 118 ) 119 $(LIBS) 120 os2386.lib 121 <<KEEP 108 122 $(CP) $@ $(PDWIN32_BIN) 109 123 … … 113 127 ############################################################################## 114 128 dep: 115 $(DEPEND) -obj$(OBJEXT) -o$$(OBJDIR) $(CINCLUDES) ..\misc\*.c* ..\include\*.h 129 $(DEPEND) -obj$(OBJEXT) -o$$(OBJDIR) $(CINCLUDES) \ 130 *.c* ..\misc\*.c* ..\include\*.h 116 131 117 132
Note:
See TracChangeset
for help on using the changeset viewer.