Changeset 1467 for trunk/src/win32k/misc
- Timestamp:
- Oct 27, 1999, 4:03:01 AM (26 years ago)
- Location:
- trunk/src/win32k/misc
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/misc/asmutils.asm
r909 r1467 1 ; $Id: asmutils.asm,v 1. 2 1999-09-12 00:26:27bird Exp $1 ; $Id: asmutils.asm,v 1.3 1999-10-27 02:02:59 bird Exp $ 2 2 ; 3 3 ; asmutils - assembly utility functions … … 5 5 ; Copyright (c) 1998-1999 knut st. osmundsen 6 6 ; 7 ; Project Odin Software License can be found in LICENSE.TXT 7 8 ; 8 9 .386p … … 12 13 ; 13 14 include devsegdf.inc 14 include sas.inc15 15 16 16 ; … … 26 26 public _memrevmov@12 27 27 public _memmov@12 28 public GetOS2KrnlMTE29 28 ; public DisableInterrupts 30 29 ; public EnableInterrupts … … 196 195 197 196 198 ; gets the FLAT pointer to the OS2 Kernel MTE.199 ; eax is flat pointer to OS2 Kernel MTE.200 GetOS2KrnlMTE PROC NEAR201 push es202 203 mov ax, SAS_selector ;70h - Read-only SAS selector.204 mov es, ax205 xor ebx, ebx206 assume ebx: PTR SAS207 mov bx, [ebx].SAS_vm_data ;SAS_vm_data (0ch)208 assume ebx: PTR SAS_vm_section209 mov eax,[ebx].SAS_vm_krnl_mte ;SAS_vm_krnl_mte (0ch)210 211 pop es212 ret213 GetOS2KrnlMTE ENDP214 215 216 197 CODE32 ends 217 198 end -
trunk/src/win32k/misc/cout.cpp
r847 r1467 1 /* $Id: cout.cpp,v 1. 1 1999-09-06 02:20:02bird Exp $1 /* $Id: cout.cpp,v 1.2 1999-10-27 02:02:59 bird Exp $ 2 2 * 3 3 * cout - cout replacement. 4 4 * 5 * Note: use of cout is discurraged. 6 * 5 7 * Copyright (c) 1998-1999 knut st. osmundsen 8 * 9 * Project Odin Software License can be found in LICENSE.TXT 6 10 * 7 11 */ -
trunk/src/win32k/misc/malloc.c
r1271 r1467 1 /* $Id: malloc.c,v 1. 2 1999-10-14 01:19:21bird Exp $1 /* $Id: malloc.c,v 1.3 1999-10-27 02:03:00 bird Exp $ 2 2 * 3 3 * Heap. … … 10 10 */ 11 11 12 12 #define static 13 13 /****************************************************************************** 14 14 * Defined macros and constants … … 289 289 290 290 #ifdef RING0 291 pFree = D32Hlp_VMAlloc(VMDHA_SWAP | VMDHA_USEHIGHMEM, cbSize, ~0UL);291 pFree = D32Hlp_VMAlloc(VMDHA_SWAP, cbSize, ~0UL); 292 292 #else 293 293 if (DosAllocMem((void*)&pFree, cbSize, PAG_COMMIT | PAG_READ | PAG_WRITE) != 0) -
trunk/src/win32k/misc/vprintf.c
r1271 r1467 1 /* $Id: vprintf.c,v 1. 1 1999-10-14 01:19:22bird Exp $1 /* $Id: vprintf.c,v 1.2 1999-10-27 02:03:00 bird Exp $ 2 2 * 3 3 * vprintf and printf … … 31 31 #include <stdarg.h> 32 32 33 #include "dev32.h" 34 #include "vprintf.h" 33 35 #ifdef RING0 34 #include "dev32.h" 35 #else 36 #define SSToDS(a) (a) 36 #include <builtin.h> 37 #include "options.h" 37 38 #endif 38 #include "vprintf.h" 39 39 40 41 /******************************************************************************* 42 * Global Variables * 43 *******************************************************************************/ 44 static char chNewLine = '\n'; 45 static char chReturn = '\r'; 40 46 41 47 /******************************************************************************* … … 44 50 static int _atoi_skip(const char **ppsz); 45 51 static unsigned _strnlen(const char *psz, unsigned cchMax); 46 _Inline void chout(int ch); 52 static void chout(int ch); 53 static char * strout(char *psz, signed cchMax); 47 54 48 55 … … 162 169 #if 0 163 170 else if (!(fFlags & NTSF_LEFT) && cchWidth > 0) 164 { /* not supported! */171 { /* not yet supported! */ 165 172 /* 166 173 for (j = i-1; j >= 0; j--) … … 207 214 int vprintf(const char *pszFormat, va_list args) 208 215 { 216 #ifdef RING0 217 if (options.fQuiet) 218 return 0; 219 #else 220 int cch = 0; 221 #endif 222 209 223 while (*pszFormat != '\0') 210 224 { 211 225 if (*pszFormat == '%') 212 226 { 227 #ifndef RING0 228 if (cch > 0) 229 { 230 strout((char*)(pszFormat - cch), cch); 231 cch = 0; 232 } 233 #endif 234 213 235 pszFormat++; /* skip '%' */ 214 236 if (*pszFormat == '%') /* '%%'-> '%' */ … … 306 328 case 's': /* string */ 307 329 { 308 int i;309 330 int cchStr; 310 331 char *pszStr = va_arg(args, char*); … … 316 337 while (--cchWidth >= cchStr) 317 338 chout(' '); 318 for (i = cchStr; i > 0; i--) 319 chout(*pszStr++);339 340 pszStr = strout(pszStr, cchStr); 320 341 321 342 while (--cchWidth >= cchStr) … … 352 373 } 353 374 else 354 chout(*pszFormat++); 355 } 375 { 376 #ifdef RING0 377 chout(*pszFormat++); 378 #else 379 cch++; 380 pszFormat++; 381 #endif 382 } 383 } 384 385 #ifndef RING0 386 if (cch > 0) 387 { 388 strout((char*)(pszFormat - cch), cch); 389 cch = 0; 390 } 391 #endif 356 392 357 393 return 0UL; … … 376 412 va_list arguments; 377 413 414 #ifdef RING0 415 if (options.fQuiet) 416 return 0; 417 #endif 418 378 419 va_start(arguments, pszFormat); 379 420 cch = vprintf(pszFormat, arguments); … … 390 431 va_list arguments; 391 432 433 #ifdef RING0 434 if (options.fQuiet) 435 return 0; 436 #endif 437 392 438 va_start(arguments, pszFormat); 393 439 cch = vprintf(pszFormat, arguments); … … 402 448 int cch; 403 449 va_list arguments; 450 451 #ifdef RING0 452 if (options.fQuiet) 453 return 0; 454 #endif 404 455 405 456 va_start(arguments, pszFormat); … … 419 470 * @author knut st. osmundsen 420 471 */ 421 _Inline void chout(int ch) 422 { 423 #ifdef RING0 424 425 #else 472 static void chout(int ch) 473 { 474 #ifndef RING0 426 475 ULONG ulWrote; 427 476 #endif … … 431 480 if (ch == '\n') 432 481 { 433 static char chReturn = '\r';434 482 #ifdef RING0 435 483 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 484 _outp(options.usCom, chReturn); /* Put the char. */ 436 485 #else 437 486 DosWrite(1, (void*)&chReturn, 1, &ulWrote); … … 439 488 } 440 489 #ifdef RING0 441 490 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 491 _outp(options.usCom, ch); /* Put the char. */ 442 492 #else 443 493 DosWrite(1, (void*)&ch, 1, &ulWrote); … … 446 496 } 447 497 498 499 /** 500 * Write a string to the output device. 501 * @returns pointer end of string. 502 * @param psz Pointer to the string to write. 503 * @param cchMax Max count of chars to write. (or until '\0') 504 * @status completely implemented. 505 * @author knut st. osmundsen 506 */ 507 static char *strout(char *psz, signed cchMax) 508 { 509 while (cchMax > 0 && *psz != '\0') 510 { 511 ULONG cch = 0; 512 ULONG ul; 513 514 while (cchMax - cch > 0 && psz[cch] != '\0' && psz[cch] != '\r' && psz[cch] != '\n') 515 cch++; 516 517 /* write string part */ 518 #ifdef RING0 519 for (ul = 0; ul < cch; ul++) 520 { 521 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 522 _outp(options.usCom, psz[ul]); /* Put the char. */ 523 } 524 #else 525 DosWrite(1, (void*)psz, cch, &ul); 526 #endif 527 528 /* cr and lf check + skip */ 529 if (psz[cch] == '\n' || psz[cch] == '\r') 530 { 531 if (psz[cch] == '\n') 532 { 533 #ifdef RING0 534 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 535 _outp(options.usCom, chReturn); /* Put the char. */ 536 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 537 _outp(options.usCom, chNewLine); /* Put the char. */ 538 #else 539 DosWrite(1, (void*)&chReturn, 1, &ul); 540 DosWrite(1, (void*)&chNewLine, 1, &ul); 541 #endif 542 543 } 544 545 while (cchMax - cch > 0 && (psz[cch] == '\r' || psz[cch] == '\n')) 546 cch++; 547 } 548 549 /* next */ 550 psz += cch; 551 cchMax -= cch; 552 } 553 return psz; 554 } 555 -
trunk/src/win32k/misc/vsprintf.c
r1271 r1467 1 /* $Id: vsprintf.c,v 1. 2 1999-10-14 01:19:22bird Exp $1 /* $Id: vsprintf.c,v 1.3 1999-10-27 02:03:00 bird Exp $ 2 2 * 3 3 * vsprintf and sprintf … … 31 31 #include <stdarg.h> 32 32 33 #ifdef RING0 34 #include "dev32.h" 35 #else 36 #define SSToDS(a) (a) 37 #endif 33 #include "dev32.h" 38 34 #include "sprintf.h" 39 35
Note:
See TracChangeset
for help on using the changeset viewer.