- Timestamp:
- Jul 13, 2007 2:51:00 PM (18 years ago)
- Location:
- trunk/src/recompiler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/VBoxREMWrapper.cpp
r3581 r3615 90 90 * %r12-r15 callee-saved registers 91 91 * [Preserved] 92 * %xmm0 %xmm1 used to pass and return floating point arguments92 * %xmm0-%xmm1 used to pass and return floating point arguments 93 93 * [Not preserved] 94 * %xmm2 %xmm7 used to pass floating point arguments94 * %xmm2-%xmm7 used to pass floating point arguments 95 95 * [Not preserved] 96 * %xmm8 %xmm15 temporary registers96 * %xmm8-%xmm15 temporary registers 97 97 * [Not preserved] 98 * %mmx0 %mmx7 temporary registers98 * %mmx0-%mmx7 temporary registers 99 99 * [Not preserved] 100 100 * %st0 temporary register; used to return long double arguments … … 102 102 * %st1 temporary registers; used to return long double arguments 103 103 * [Not preserved] 104 * %st2 %st7 temporary registers104 * %st2-%st7 temporary registers 105 105 * [Not preserved] 106 106 * %fs Reserved for system use (as thread specific data register) … … 214 214 /** The parameter size if REMPARMDESC_FLAGS_SIZE is set. */ 215 215 uint8_t cb; 216 /** Pointer to additional data. 217 * For REMPARMDESC_FLAGS_PFN this is a PREMFNDESC. */ 218 void *pvExtra; 219 216 220 } REMPARMDESC, *PREMPARMDESC; 217 221 /** Pointer to a constant parameter descriptor. */ … … 236 240 /** The parameter is a va_list. */ 237 241 #define REMPARMDESC_FLAGS_VALIST 7 242 /** The parameter is a function pointer. pvExtra is a PREMFNDESC. */ 243 #define REMPARMDESC_FLAGS_PFN 8 238 244 /** The parameter type mask. */ 239 #define REMPARMDESC_FLAGS_TYPE_MASK 7245 #define REMPARMDESC_FLAGS_TYPE_MASK 15 240 246 /** The parameter size field is valid. */ 241 247 #define REMPARMDESC_FLAGS_SIZE BIT(7) … … 367 373 static const REMPARMDESC g_aArgsBreakpoint[] = 368 374 { 369 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },370 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINTPTR) }375 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 376 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINTPTR), NULL } 371 377 }; 372 378 static const REMPARMDESC g_aArgsA20Set[] = 373 379 { 374 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },375 { REMPARMDESC_FLAGS_INT, sizeof(bool) }380 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 381 { REMPARMDESC_FLAGS_INT, sizeof(bool), NULL } 376 382 }; 377 383 static const REMPARMDESC g_aArgsNotifyPhysRamRegister[] = 378 384 { 379 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },380 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },381 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) },382 { REMPARMDESC_FLAGS_INT, sizeof(void *) },383 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) }385 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 386 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 387 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT), NULL }, 388 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 389 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL } 384 390 }; 385 391 static const REMPARMDESC g_aArgsNotifyPhysRamChunkRegister[] = 386 392 { 387 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },388 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },389 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) },390 { REMPARMDESC_FLAGS_INT, sizeof(RTHCUINTPTR) },391 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) }393 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 394 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 395 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT), NULL }, 396 { REMPARMDESC_FLAGS_INT, sizeof(RTHCUINTPTR), NULL }, 397 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL } 392 398 }; 393 399 static const REMPARMDESC g_aArgsNotifyPhysReserve[] = 394 400 { 395 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },396 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },397 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) }401 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 402 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 403 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT), NULL } 398 404 }; 399 405 static const REMPARMDESC g_aArgsNotifyPhysRomRegister[] = 400 406 { 401 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },402 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },403 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) },404 { REMPARMDESC_FLAGS_INT, sizeof(void *) }407 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 408 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 409 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT), NULL }, 410 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL } 405 411 }; 406 412 static const REMPARMDESC g_aArgsNotifyHandlerPhysicalModify[] = 407 413 { 408 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },409 { REMPARMDESC_FLAGS_INT, sizeof(PGMPHYSHANDLERTYPE) },410 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },411 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },412 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },413 { REMPARMDESC_FLAGS_INT, sizeof(bool) },414 { REMPARMDESC_FLAGS_INT, sizeof(void *) }414 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 415 { REMPARMDESC_FLAGS_INT, sizeof(PGMPHYSHANDLERTYPE), NULL }, 416 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 417 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 418 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 419 { REMPARMDESC_FLAGS_INT, sizeof(bool), NULL }, 420 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL } 415 421 }; 416 422 static const REMPARMDESC g_aArgsNotifyHandlerPhysicalRegister[] = 417 423 { 418 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },419 { REMPARMDESC_FLAGS_INT, sizeof(PGMPHYSHANDLERTYPE) },420 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },421 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },422 { REMPARMDESC_FLAGS_INT, sizeof(bool) }424 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 425 { REMPARMDESC_FLAGS_INT, sizeof(PGMPHYSHANDLERTYPE), NULL }, 426 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 427 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 428 { REMPARMDESC_FLAGS_INT, sizeof(bool), NULL } 423 429 }; 424 430 static const REMPARMDESC g_aArgsNotifyHandlerPhysicalDeregister[] = 425 431 { 426 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },427 { REMPARMDESC_FLAGS_INT, sizeof(PGMPHYSHANDLERTYPE) },428 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },429 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },430 { REMPARMDESC_FLAGS_INT, sizeof(bool) },431 { REMPARMDESC_FLAGS_INT, sizeof(void *) }432 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 433 { REMPARMDESC_FLAGS_INT, sizeof(PGMPHYSHANDLERTYPE), NULL }, 434 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 435 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 436 { REMPARMDESC_FLAGS_INT, sizeof(bool), NULL }, 437 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL } 432 438 }; 433 439 static const REMPARMDESC g_aArgsNotifyCodePageChanged[] = 434 440 { 435 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },436 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINTPTR) }441 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 442 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINTPTR), NULL } 437 443 }; 438 444 static const REMPARMDESC g_aArgsNotifyPendingInterrupt[] = 439 445 { 440 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },441 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) }446 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 447 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t), NULL } 442 448 }; 443 449 static const REMPARMDESC g_aArgsDisasEnableStepping[] = 444 450 { 445 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },446 { REMPARMDESC_FLAGS_INT, sizeof(bool) }451 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 452 { REMPARMDESC_FLAGS_INT, sizeof(bool), NULL } 447 453 }; 448 454 static const REMPARMDESC g_aArgsIsPageAccessHandled[] = 449 455 { 450 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },451 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) }456 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 457 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL } 452 458 }; 453 459 … … 456 462 static const REMPARMDESC g_aArgsCPUMGetGuestCpl[] = 457 463 { 458 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },459 { REMPARMDESC_FLAGS_INT, sizeof(PCPUMCTXCORE) },464 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 465 { REMPARMDESC_FLAGS_INT, sizeof(PCPUMCTXCORE), NULL }, 460 466 }; 461 467 462 468 static const REMPARMDESC g_aArgsCPUMGetGuestCpuId[] = 463 469 { 464 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },465 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },466 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },467 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },468 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },469 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) }470 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 471 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 472 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL }, 473 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL }, 474 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL }, 475 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL } 470 476 }; 471 477 static const REMPARMDESC g_aArgsCPUMQueryGuestCtxPtr[] = 472 478 { 473 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },474 { REMPARMDESC_FLAGS_INT, sizeof(PCPUMCTX *) }479 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 480 { REMPARMDESC_FLAGS_INT, sizeof(PCPUMCTX *), NULL } 475 481 }; 476 482 static const REMPARMDESC g_aArgsCSAMR3MonitorPage[] = 477 483 { 478 { REMPARMDESC_FLAGS_INT, sizeof(PVM) }, 479 { REMPARMDESC_FLAGS_INT, sizeof(RTGCPTR) }, 480 { REMPARMDESC_FLAGS_INT, sizeof(CSAMTAG) } 481 }; 484 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 485 { REMPARMDESC_FLAGS_INT, sizeof(RTGCPTR), NULL }, 486 { REMPARMDESC_FLAGS_INT, sizeof(CSAMTAG), NULL } 487 }; 488 #if !(defined(__WIN__) && defined(__AMD64__)) /* the callbacks are problematic */ 482 489 static const REMPARMDESC g_aArgsDBGCRegisterCommands[] = 483 490 { 484 { REMPARMDESC_FLAGS_INT, sizeof(PCDBGCCMD) }, 485 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) } 486 }; 491 { REMPARMDESC_FLAGS_INT, sizeof(PCDBGCCMD), NULL }, 492 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL } 493 }; 494 #endif 487 495 static const REMPARMDESC g_aArgsDBGFR3DisasInstrEx[] = 488 496 { 489 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },490 { REMPARMDESC_FLAGS_INT, sizeof(RTSEL) },491 { REMPARMDESC_FLAGS_INT, sizeof(RTGCPTR) },492 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },493 { REMPARMDESC_FLAGS_INT, sizeof(char *) },494 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },495 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) }497 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 498 { REMPARMDESC_FLAGS_INT, sizeof(RTSEL), NULL }, 499 { REMPARMDESC_FLAGS_INT, sizeof(RTGCPTR), NULL }, 500 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL }, 501 { REMPARMDESC_FLAGS_INT, sizeof(char *), NULL }, 502 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 503 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL } 496 504 }; 497 505 static const REMPARMDESC g_aArgsDBGFR3Info[] = 498 506 { 499 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },500 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },501 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },502 { REMPARMDESC_FLAGS_INT, sizeof(PCDBGFINFOHLP) }507 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 508 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 509 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 510 { REMPARMDESC_FLAGS_INT, sizeof(PCDBGFINFOHLP), NULL } 503 511 }; 504 512 static const REMPARMDESC g_aArgsDBGFR3SymbolByAddr[] = 505 513 { 506 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },507 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINTPTR) },508 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCINTPTR) },509 { REMPARMDESC_FLAGS_INT, sizeof(PDBGFSYMBOL) }514 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 515 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINTPTR), NULL }, 516 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCINTPTR), NULL }, 517 { REMPARMDESC_FLAGS_INT, sizeof(PDBGFSYMBOL), NULL } 510 518 }; 511 519 static const REMPARMDESC g_aArgsDISInstr[] = 512 520 { 513 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },514 { REMPARMDESC_FLAGS_INT, sizeof(RTUINTPTR) },515 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },516 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },517 { REMPARMDESC_FLAGS_INT, sizeof(char *) }521 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 522 { REMPARMDESC_FLAGS_INT, sizeof(RTUINTPTR), NULL }, 523 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 524 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL }, 525 { REMPARMDESC_FLAGS_INT, sizeof(char *), NULL } 518 526 }; 519 527 static const REMPARMDESC g_aArgsEMR3FatalError[] = 520 528 { 521 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },522 { REMPARMDESC_FLAGS_INT, sizeof(int) }529 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 530 { REMPARMDESC_FLAGS_INT, sizeof(int), NULL } 523 531 }; 524 532 static const REMPARMDESC g_aArgsHWACCMR3CanExecuteGuest[] = 525 533 { 526 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },527 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },528 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },529 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }534 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 535 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 536 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 537 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL } 530 538 }; 531 539 static const REMPARMDESC g_aArgsIOMIOPortRead[] = 532 540 { 533 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },534 { REMPARMDESC_FLAGS_INT, sizeof(RTIOPORT) },535 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },536 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }541 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 542 { REMPARMDESC_FLAGS_INT, sizeof(RTIOPORT), NULL }, 543 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL }, 544 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL } 537 545 }; 538 546 static const REMPARMDESC g_aArgsIOMIOPortWrite[] = 539 547 { 540 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },541 { REMPARMDESC_FLAGS_INT, sizeof(RTIOPORT) },542 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },543 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }548 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 549 { REMPARMDESC_FLAGS_INT, sizeof(RTIOPORT), NULL }, 550 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 551 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL } 544 552 }; 545 553 static const REMPARMDESC g_aArgsIOMMMIORead[] = 546 554 { 547 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },548 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },549 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },550 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }555 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 556 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 557 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL }, 558 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL } 551 559 }; 552 560 static const REMPARMDESC g_aArgsIOMMMIOWrite[] = 553 561 { 554 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },555 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },556 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },557 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }562 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 563 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 564 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 565 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL } 558 566 }; 559 567 static const REMPARMDESC g_aArgsMMR3HeapAlloc[] = 560 568 { 561 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },562 { REMPARMDESC_FLAGS_INT, sizeof(MMTAG) },563 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }569 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 570 { REMPARMDESC_FLAGS_INT, sizeof(MMTAG), NULL }, 571 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL } 564 572 }; 565 573 static const REMPARMDESC g_aArgsMMR3HeapAllocZ[] = 566 574 { 567 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },568 { REMPARMDESC_FLAGS_INT, sizeof(MMTAG) },569 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }575 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 576 { REMPARMDESC_FLAGS_INT, sizeof(MMTAG), NULL }, 577 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL } 570 578 }; 571 579 static const REMPARMDESC g_aArgsPATMIsPatchGCAddr[] = 572 580 { 573 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },574 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) }581 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 582 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR), NULL } 575 583 }; 576 584 static const REMPARMDESC g_aArgsPATMR3QueryOpcode[] = 577 585 { 578 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },579 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) },580 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *) }586 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 587 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR), NULL }, 588 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *), NULL } 581 589 }; 582 590 static const REMPARMDESC g_aArgsPATMR3QueryPatchMem[] = 583 591 { 584 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },585 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) }592 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 593 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL } 586 594 }; 587 595 static const REMPARMDESC g_aArgsPDMApicGetBase[] = 588 596 { 589 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },590 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t *) }597 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 598 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t *), NULL } 591 599 }; 592 600 static const REMPARMDESC g_aArgsPDMApicGetTPR[] = 593 601 { 594 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },595 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *) }602 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 603 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *), NULL } 596 604 }; 597 605 static const REMPARMDESC g_aArgsPDMApicSetBase[] = 598 606 { 599 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },600 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t) }607 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 608 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t), NULL } 601 609 }; 602 610 static const REMPARMDESC g_aArgsPDMApicSetTPR[] = 603 611 { 604 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },605 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) }612 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 613 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t), NULL } 606 614 }; 607 615 static const REMPARMDESC g_aArgsPDMGetInterrupt[] = 608 616 { 609 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },610 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *) }617 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 618 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *), NULL } 611 619 }; 612 620 static const REMPARMDESC g_aArgsPDMIsaSetIrq[] = 613 621 { 614 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },615 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) },616 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) }622 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 623 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t), NULL }, 624 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t), NULL } 617 625 }; 618 626 static const REMPARMDESC g_aArgsPGMGstGetPage[] = 619 627 { 620 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },621 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) },622 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t *) },623 { REMPARMDESC_FLAGS_INT, sizeof(PRTGCPHYS) }628 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 629 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR), NULL }, 630 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t *), NULL }, 631 { REMPARMDESC_FLAGS_INT, sizeof(PRTGCPHYS), NULL } 624 632 }; 625 633 static const REMPARMDESC g_aArgsPGMInvalidatePage[] = 626 634 { 627 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },628 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) }635 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 636 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR), NULL } 629 637 }; 630 638 static const REMPARMDESC g_aArgsPGMPhysGCPhys2HCPtr[] = 631 639 { 632 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },633 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },634 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) },635 { REMPARMDESC_FLAGS_INT, sizeof(PRTHCPTR) }640 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 641 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 642 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT), NULL }, 643 { REMPARMDESC_FLAGS_INT, sizeof(PRTHCPTR), NULL } 636 644 }; 637 645 static const REMPARMDESC g_aArgsPGMPhysGCPtr2HCPtrByGstCR3[] = 638 646 { 639 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },640 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },641 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },642 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },643 { REMPARMDESC_FLAGS_INT, sizeof(PRTHCPTR) }647 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 648 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 649 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 650 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL }, 651 { REMPARMDESC_FLAGS_INT, sizeof(PRTHCPTR), NULL } 644 652 }; 645 653 static const REMPARMDESC g_aArgsPGM3PhysGrowRange[] = 646 654 { 647 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },648 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) }655 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 656 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL } 649 657 }; 650 658 static const REMPARMDESC g_aArgsPGMPhysIsGCPhysValid[] = 651 659 { 652 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },653 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) }660 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 661 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL } 654 662 }; 655 663 static const REMPARMDESC g_aArgsPGMPhysRead[] = 656 664 { 657 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },658 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },659 { REMPARMDESC_FLAGS_INT, sizeof(void *) },660 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }665 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 666 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 667 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 668 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 661 669 }; 662 670 static const REMPARMDESC g_aArgsPGMPhysReadGCPtr[] = 663 671 { 664 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },665 { REMPARMDESC_FLAGS_INT, sizeof(void *) },666 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) },667 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }672 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 673 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 674 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR), NULL }, 675 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 668 676 }; 669 677 static const REMPARMDESC g_aArgsPGMPhysWrite[] = 670 678 { 671 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },672 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },673 { REMPARMDESC_FLAGS_INT, sizeof(const void *) },674 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }679 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 680 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 681 { REMPARMDESC_FLAGS_INT, sizeof(const void *), NULL }, 682 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 675 683 }; 676 684 static const REMPARMDESC g_aArgsPGMChangeMode[] = 677 685 { 678 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },679 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },680 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },681 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t) }686 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 687 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 688 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 689 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t), NULL } 682 690 }; 683 691 static const REMPARMDESC g_aArgsPGMFlushTLB[] = 684 692 { 685 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },686 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },687 { REMPARMDESC_FLAGS_INT, sizeof(bool) }693 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 694 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 695 { REMPARMDESC_FLAGS_INT, sizeof(bool), NULL } 688 696 }; 689 697 static const REMPARMDESC g_aArgsPGMR3PhysReadUxx[] = 690 698 { 691 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },692 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) }699 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 700 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL } 693 701 }; 694 702 static const REMPARMDESC g_aArgsPGMR3PhysWriteU8[] = 695 703 { 696 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },697 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },698 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) }704 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 705 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 706 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t), NULL } 699 707 }; 700 708 static const REMPARMDESC g_aArgsPGMR3PhysWriteU16[] = 701 709 { 702 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },703 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },704 { REMPARMDESC_FLAGS_INT, sizeof(uint16_t) }710 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 711 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 712 { REMPARMDESC_FLAGS_INT, sizeof(uint16_t), NULL } 705 713 }; 706 714 static const REMPARMDESC g_aArgsPGMR3PhysWriteU32[] = 707 715 { 708 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },709 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },710 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }716 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 717 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 718 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL } 711 719 }; 712 720 static const REMPARMDESC g_aArgsPGMR3PhysWriteU64[] = 713 721 { 714 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },715 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },716 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t) }722 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 723 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS), NULL }, 724 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t), NULL } 717 725 }; 718 726 static const REMPARMDESC g_aArgsSSMR3GetGCPtr[] = 719 727 { 720 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },721 { REMPARMDESC_FLAGS_INT, sizeof(PRTGCPTR) }728 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 729 { REMPARMDESC_FLAGS_INT, sizeof(PRTGCPTR), NULL } 722 730 }; 723 731 static const REMPARMDESC g_aArgsSSMR3GetMem[] = 724 732 { 725 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },726 { REMPARMDESC_FLAGS_INT, sizeof(void *) },727 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }733 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 734 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 735 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 728 736 }; 729 737 static const REMPARMDESC g_aArgsSSMR3GetU32[] = 730 738 { 731 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },732 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) }739 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 740 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *), NULL } 733 741 }; 734 742 static const REMPARMDESC g_aArgsSSMR3GetUInt[] = 735 743 { 736 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },737 { REMPARMDESC_FLAGS_INT, sizeof(PRTUINT) }744 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 745 { REMPARMDESC_FLAGS_INT, sizeof(PRTUINT), NULL } 738 746 }; 739 747 static const REMPARMDESC g_aArgsSSMR3PutGCPtr[] = 740 748 { 741 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },742 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) }749 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 750 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR), NULL } 743 751 }; 744 752 static const REMPARMDESC g_aArgsSSMR3PutMem[] = 745 753 { 746 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },747 { REMPARMDESC_FLAGS_INT, sizeof(const void *) },748 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }754 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 755 { REMPARMDESC_FLAGS_INT, sizeof(const void *), NULL }, 756 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 749 757 }; 750 758 static const REMPARMDESC g_aArgsSSMR3PutU32[] = 751 759 { 752 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },753 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },760 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 761 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 754 762 }; 755 763 static const REMPARMDESC g_aArgsSSMR3PutUInt[] = 756 764 { 757 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) }, 758 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) }, 765 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 766 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT), NULL }, 767 }; 768 769 static const REMPARMDESC g_aArgsSSMIntCallback[] = 770 { 771 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 772 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 773 }; 774 static REMFNDESC g_SSMIntCallback = 775 { 776 "SSMIntCallback", NULL, &g_aArgsSSMIntCallback[0], ELEMENTS(g_aArgsSSMIntCallback), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL 777 }; 778 779 static const REMPARMDESC g_aArgsSSMIntLoadExecCallback[] = 780 { 781 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 782 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE), NULL }, 783 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 784 }; 785 static REMFNDESC g_SSMIntLoadExecCallback = 786 { 787 "SSMIntLoadExecCallback", NULL, &g_aArgsSSMIntLoadExecCallback[0], ELEMENTS(g_aArgsSSMIntLoadExecCallback), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL 759 788 }; 760 789 static const REMPARMDESC g_aArgsSSMR3RegisterInternal[] = 761 790 { 762 { REMPARMDESC_FLAGS_INT, sizeof(PVM) }, 763 { REMPARMDESC_FLAGS_INT, sizeof(const char *) }, 764 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }, 765 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }, 766 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }, 767 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTSAVEPREP) }, 768 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTSAVEEXEC) }, 769 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTSAVEDONE) }, 770 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTLOADPREP) }, 771 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTLOADEXEC) }, 772 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTLOADDONE) }, 773 }; 791 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 792 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 793 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 794 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 795 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL }, 796 { REMPARMDESC_FLAGS_PFN, sizeof(PFNSSMINTSAVEPREP), &g_SSMIntCallback }, 797 { REMPARMDESC_FLAGS_PFN, sizeof(PFNSSMINTSAVEEXEC), &g_SSMIntCallback }, 798 { REMPARMDESC_FLAGS_PFN, sizeof(PFNSSMINTSAVEDONE), &g_SSMIntCallback }, 799 { REMPARMDESC_FLAGS_PFN, sizeof(PFNSSMINTLOADPREP), &g_SSMIntCallback }, 800 { REMPARMDESC_FLAGS_PFN, sizeof(PFNSSMINTLOADEXEC), &g_SSMIntLoadExecCallback }, 801 { REMPARMDESC_FLAGS_PFN, sizeof(PFNSSMINTLOADDONE), &g_SSMIntCallback }, 802 }; 803 774 804 static const REMPARMDESC g_aArgsSTAMR3Register[] = 775 805 { 776 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },777 { REMPARMDESC_FLAGS_INT, sizeof(void *) },778 { REMPARMDESC_FLAGS_INT, sizeof(STAMTYPE) },779 { REMPARMDESC_FLAGS_INT, sizeof(STAMVISIBILITY) },780 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },781 { REMPARMDESC_FLAGS_INT, sizeof(STAMUNIT) },782 { REMPARMDESC_FLAGS_INT, sizeof(const char *) }806 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 807 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 808 { REMPARMDESC_FLAGS_INT, sizeof(STAMTYPE), NULL }, 809 { REMPARMDESC_FLAGS_INT, sizeof(STAMVISIBILITY), NULL }, 810 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 811 { REMPARMDESC_FLAGS_INT, sizeof(STAMUNIT), NULL }, 812 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL } 783 813 }; 784 814 static const REMPARMDESC g_aArgsTRPMAssertTrap[] = 785 815 { 786 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },787 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) },788 { REMPARMDESC_FLAGS_INT, sizeof(TRPMEVENT) }816 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 817 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t), NULL }, 818 { REMPARMDESC_FLAGS_INT, sizeof(TRPMEVENT), NULL } 789 819 }; 790 820 static const REMPARMDESC g_aArgsTRPMQueryTrap[] = 791 821 { 792 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },793 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *) },794 { REMPARMDESC_FLAGS_INT, sizeof(TRPMEVENT *) }822 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 823 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *), NULL }, 824 { REMPARMDESC_FLAGS_INT, sizeof(TRPMEVENT *), NULL } 795 825 }; 796 826 static const REMPARMDESC g_aArgsTRPMSetErrorCode[] = 797 827 { 798 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },799 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINT) }828 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 829 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINT), NULL } 800 830 }; 801 831 static const REMPARMDESC g_aArgsTRPMSetFaultAddress[] = 802 832 { 803 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },804 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINT) }833 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 834 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINT), NULL } 805 835 }; 806 836 static const REMPARMDESC g_aArgsVMR3ReqCall[] = 807 837 { 808 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },809 { REMPARMDESC_FLAGS_INT, sizeof(PVMREQ *) },810 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },811 { REMPARMDESC_FLAGS_INT, sizeof(void *) },812 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },838 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 839 { REMPARMDESC_FLAGS_INT, sizeof(PVMREQ *), NULL }, 840 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL }, 841 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 842 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL }, 813 843 { REMPARMDESC_FLAGS_ELLIPSIS, 0 } 814 844 }; 815 845 static const REMPARMDESC g_aArgsVMR3ReqFree[] = 816 846 { 817 { REMPARMDESC_FLAGS_INT, sizeof(PVMREQ) }847 { REMPARMDESC_FLAGS_INT, sizeof(PVMREQ), NULL } 818 848 }; 819 849 … … 822 852 static const REMPARMDESC g_aArgsAssertMsg1[] = 823 853 { 824 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },825 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },826 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },827 { REMPARMDESC_FLAGS_INT, sizeof(const char *) }854 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 855 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL }, 856 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 857 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL } 828 858 }; 829 859 static const REMPARMDESC g_aArgsAssertMsg2[] = 830 860 { 831 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },861 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 832 862 { REMPARMDESC_FLAGS_ELLIPSIS, 0 } 833 863 }; 834 864 static const REMPARMDESC g_aArgsRTLogFlags[] = 835 865 { 836 { REMPARMDESC_FLAGS_INT, sizeof(PRTLOGGER) },837 { REMPARMDESC_FLAGS_INT, sizeof(const char *) }866 { REMPARMDESC_FLAGS_INT, sizeof(PRTLOGGER), NULL }, 867 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL } 838 868 }; 839 869 static const REMPARMDESC g_aArgsRTLogLoggerEx[] = 840 870 { 841 { REMPARMDESC_FLAGS_INT, sizeof(PRTLOGGER) },842 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },843 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },844 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },871 { REMPARMDESC_FLAGS_INT, sizeof(PRTLOGGER), NULL }, 872 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL }, 873 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL }, 874 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 845 875 { REMPARMDESC_FLAGS_ELLIPSIS, 0 } 846 876 }; 847 877 static const REMPARMDESC g_aArgsRTLogLoggerExV[] = 848 878 { 849 { REMPARMDESC_FLAGS_INT, sizeof(PRTLOGGER) },850 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },851 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },852 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },879 { REMPARMDESC_FLAGS_INT, sizeof(PRTLOGGER), NULL }, 880 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL }, 881 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL }, 882 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 853 883 { REMPARMDESC_FLAGS_VALIST, 0 } 854 884 }; 855 885 static const REMPARMDESC g_aArgsRTLogPrintf[] = 856 886 { 857 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },887 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 858 888 { REMPARMDESC_FLAGS_ELLIPSIS, 0 } 859 889 }; 860 890 static const REMPARMDESC g_aArgsRTMemProtect[] = 861 891 { 862 { REMPARMDESC_FLAGS_INT, sizeof(void *) },863 { REMPARMDESC_FLAGS_INT, sizeof(size_t) },864 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) }892 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 893 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL }, 894 { REMPARMDESC_FLAGS_INT, sizeof(unsigned), NULL } 865 895 }; 866 896 static const REMPARMDESC g_aArgsRTStrPrintf[] = 867 897 { 868 { REMPARMDESC_FLAGS_INT, sizeof(char *) },869 { REMPARMDESC_FLAGS_INT, sizeof(size_t) },870 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },898 { REMPARMDESC_FLAGS_INT, sizeof(char *), NULL }, 899 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL }, 900 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 871 901 { REMPARMDESC_FLAGS_ELLIPSIS, 0 } 872 902 }; 873 903 static const REMPARMDESC g_aArgsRTStrPrintfV[] = 874 904 { 875 { REMPARMDESC_FLAGS_INT, sizeof(char *) },876 { REMPARMDESC_FLAGS_INT, sizeof(size_t) },877 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },905 { REMPARMDESC_FLAGS_INT, sizeof(char *), NULL }, 906 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL }, 907 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 878 908 { REMPARMDESC_FLAGS_VALIST, 0 } 879 909 }; … … 883 913 static const REMPARMDESC g_aArgsmemcpy[] = 884 914 { 885 { REMPARMDESC_FLAGS_INT, sizeof(void *) },886 { REMPARMDESC_FLAGS_INT, sizeof(const void *) },887 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }915 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 916 { REMPARMDESC_FLAGS_INT, sizeof(const void *), NULL }, 917 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 888 918 }; 889 919 static const REMPARMDESC g_aArgsmemset[] = 890 920 { 891 { REMPARMDESC_FLAGS_INT, sizeof(void *) },892 { REMPARMDESC_FLAGS_INT, sizeof(int) },893 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }921 { REMPARMDESC_FLAGS_INT, sizeof(void *), NULL }, 922 { REMPARMDESC_FLAGS_INT, sizeof(int), NULL }, 923 { REMPARMDESC_FLAGS_INT, sizeof(size_t), NULL } 894 924 }; 895 925 … … 957 987 { "CPUMQueryGuestCtxPtr", (void *)(uintptr_t)&CPUMQueryGuestCtxPtr, &g_aArgsCPUMQueryGuestCtxPtr[0], ELEMENTS(g_aArgsCPUMQueryGuestCtxPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 958 988 { "CSAMR3MonitorPage", (void *)(uintptr_t)&CSAMR3MonitorPage, &g_aArgsCSAMR3MonitorPage[0], ELEMENTS(g_aArgsCSAMR3MonitorPage), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 989 #if !(defined(__WIN__) && defined(__AMD64__)) /* the callbacks are problematic */ 959 990 { "DBGCRegisterCommands", (void *)(uintptr_t)&DBGCRegisterCommands, &g_aArgsDBGCRegisterCommands[0], ELEMENTS(g_aArgsDBGCRegisterCommands), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 991 #endif 960 992 { "DBGFR3DisasInstrEx", (void *)(uintptr_t)&DBGFR3DisasInstrEx, &g_aArgsDBGFR3DisasInstrEx[0], ELEMENTS(g_aArgsDBGFR3DisasInstrEx), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 961 993 { "DBGFR3Info", (void *)(uintptr_t)&DBGFR3Info, &g_aArgsDBGFR3Info[0], ELEMENTS(g_aArgsDBGFR3Info), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, … … 1086 1118 * Internal Functions * 1087 1119 *******************************************************************************/ 1120 static int remGenerateExportGlue(PRTUINTPTR pValue, PCREMFNDESC pDesc); 1121 1088 1122 # ifdef USE_REM_CALLING_CONVENTION_GLUE 1089 1123 DECLASM(int) WrapGCC2MSC0Int(void); DECLASM(int) WrapGCC2MSC0Int_EndProc(void); … … 1101 1135 DECLASM(int) WrapGCC2MSC12Int(void); DECLASM(int) WrapGCC2MSC12Int_EndProc(void); 1102 1136 DECLASM(int) WrapGCC2MSCVariadictInt(void); DECLASM(int) WrapGCC2MSCVariadictInt_EndProc(void); 1137 DECLASM(int) WrapGCC2MSC_SSMR3RegisterInternal(void); DECLASM(int) WrapGCC2MSC_SSMR3RegisterInternal_EndProc(void); 1103 1138 1104 1139 DECLASM(int) WrapMSC2GCC0Int(void); DECLASM(int) WrapMSC2GCC0Int_EndProc(void); … … 1181 1216 case REMPARMDESC_FLAGS_FLOAT: 1182 1217 case REMPARMDESC_FLAGS_STRUCT: 1218 case REMPARMDESC_FLAGS_PFN: 1183 1219 return false; 1184 1220 } … … 1221 1257 1222 1258 1259 /** @name The export and import fixups. 1260 * @{ */ 1261 #define REM_FIXUP_32_REAL_STUFF UINT32_C(0xdeadbeef) 1262 #define REM_FIXUP_64_REAL_STUFF UINT64_C(0xdeadf00df00ddead) 1263 #define REM_FIXUP_64_DESC UINT64_C(0xdead00010001dead) 1264 #define REM_FIXUP_64_LOG_ENTRY UINT64_C(0xdead00020002dead) 1265 #define REM_FIXUP_64_LOG_EXIT UINT64_C(0xdead00030003dead) 1266 #define REM_FIXUP_64_WRAP_GCC_CB UINT64_C(0xdead00040004dead) 1267 /** @} */ 1268 1223 1269 1224 1270 /** … … 1242 1288 { 1243 1289 RTPrintf("returning %p from %s\n", pvRet, pDesc->pszName); 1290 } 1291 1292 1293 /** 1294 * Creates a wrapper for the specified callback function at run time. 1295 * 1296 * @param pDesc The function descriptor. 1297 * @param pValue Upon entry *pValue contains the address of the function to be wrapped. 1298 * Upon return *pValue contains the address of the wrapper glue function. 1299 * @param iParam The parameter index in the function descriptor (0 based). 1300 * If UINT32_MAX pDesc is the descriptor for *pValue. 1301 */ 1302 DECLASM(void) remWrapGCCCallback(PCREMFNDESC pDesc, PRTUINTPTR pValue, uint32_t iParam) 1303 { 1304 AssertPtr(pDesc); 1305 AssertPtr(pValue); 1306 1307 /* 1308 * Simple? 1309 */ 1310 if (!*pValue) 1311 return; 1312 1313 /* 1314 * Locate the right function descriptor. 1315 */ 1316 if (iParam != UINT32_MAX) 1317 { 1318 AssertRelease(iParam < pDesc->cParams); 1319 pDesc = (PCREMFNDESC)pDesc->paParams[iParam].pvExtra; 1320 AssertPtr(pDesc); 1321 } 1322 1323 /* 1324 * When we get serious, here is where to insert the hash table lookup. 1325 */ 1326 1327 /* 1328 * Create a new glue patch. 1329 */ 1330 #ifdef __WIN__ 1331 int rc = remGenerateExportGlue(pValue, pDesc); 1332 #else 1333 #error "port me" 1334 #endif 1335 AssertReleaseRC(rc); 1336 1337 /* 1338 * Add it to the hash (later) 1339 */ 1244 1340 } 1245 1341 … … 1267 1363 while (cb >= 4) 1268 1364 { 1269 if (*u.pu32 == 0xdeadbeef) 1365 /** @todo add defines for the fixup constants... */ 1366 if (*u.pu32 == REM_FIXUP_32_REAL_STUFF) 1270 1367 { 1271 1368 /* 32-bit rel jmp/call to real export. */ … … 1276 1373 continue; 1277 1374 } 1278 if (cb >= 8 && *u.pu64 == UINT64_C(0xdeadf00df00ddead))1375 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_REAL_STUFF) 1279 1376 { 1280 1377 /* 64-bit address to the real export. */ … … 1283 1380 continue; 1284 1381 } 1285 if (cb >= 8 && *u.pu64 == UINT64_C(0xdead00010001dead))1382 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_DESC) 1286 1383 { 1287 1384 /* 64-bit address to the descriptor. */ … … 1290 1387 continue; 1291 1388 } 1292 if (cb >= 8 && *u.pu64 == UINT64_C(0xdead00020002dead)) 1389 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_WRAP_GCC_CB) 1390 { 1391 /* 64-bit address to the entry logger function. */ 1392 *u.pu64++ = (uintptr_t)remWrapGCCCallback; 1393 cb -= 8; 1394 continue; 1395 } 1396 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_LOG_ENTRY) 1293 1397 { 1294 1398 /* 64-bit address to the entry logger function. */ … … 1297 1401 continue; 1298 1402 } 1299 if (cb >= 8 && *u.pu64 == UINT64_C(0xdead00030003dead))1403 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_LOG_EXIT) 1300 1404 { 1301 1405 /* 64-bit address to the entry logger function. */ … … 1333 1437 while (cb >= 4) 1334 1438 { 1335 if (*u.pu32 == 0xdeadbeef)1439 if (*u.pu32 == REM_FIXUP_32_REAL_STUFF) 1336 1440 { 1337 1441 /* 32-bit rel jmp/call to real function. */ … … 1342 1446 continue; 1343 1447 } 1344 if (cb >= 8 && *u.pu64 == UINT64_C(0xdeadf00df00ddead))1448 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_REAL_STUFF) 1345 1449 { 1346 1450 /* 64-bit address to the real function. */ … … 1349 1453 continue; 1350 1454 } 1351 if (cb >= 8 && *u.pu64 == UINT64_C(0xdead00010001dead))1455 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_DESC) 1352 1456 { 1353 1457 /* 64-bit address to the descriptor. */ … … 1356 1460 continue; 1357 1461 } 1358 if (cb >= 8 && *u.pu64 == UINT64_C(0xdead00020002dead)) 1462 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_WRAP_GCC_CB) 1463 { 1464 /* 64-bit address to the entry logger function. */ 1465 *u.pu64++ = (uintptr_t)remWrapGCCCallback; 1466 cb -= 8; 1467 continue; 1468 } 1469 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_LOG_ENTRY) 1359 1470 { 1360 1471 /* 64-bit address to the entry logger function. */ … … 1363 1474 continue; 1364 1475 } 1365 if (cb >= 8 && *u.pu64 == UINT64_C(0xdead00030003dead))1476 if (cb >= 8 && *u.pu64 == REM_FIXUP_64_LOG_EXIT) 1366 1477 { 1367 1478 /* 64-bit address to the entry logger function. */ … … 1395 1506 # ifdef USE_REM_CALLING_CONVENTION_GLUE 1396 1507 uintptr_t *ppfn = (uintptr_t *)pDesc->pv; 1508 1509 uintptr_t pfn = 0; /* a little hack for the callback glue */ 1510 if (!ppfn) 1511 ppfn = &pfn; 1512 1397 1513 if (!*ppfn) 1398 1514 { … … 1427 1543 else 1428 1544 { 1429 /* annoying stuff, later. */ 1430 #if 1 1431 AssertReleaseMsgFailed(("Not implemented! %s\n", pDesc->pszName)); 1432 return VERR_NOT_IMPLEMENTED; 1433 #else 1434 AssertMsg2("annoying: %s\n", pDesc->pszName); 1435 uint8_t *pb; 1436 pb = (uint8_t *)remAllocGlue(3); 1545 /* custom hacks - it's simpler to make assembly templates than writing a more generic code generator... */ 1546 static const struct { const char *pszName; PFNRT pvStart, pvEnd; } s_aTemplates[] = 1547 { 1548 { "somefunction", (PFNRT)&WrapMSC2GCC9Int, (PFNRT)&WrapMSC2GCC9Int_EndProc }, 1549 }; 1550 unsigned i; 1551 for (i = 0; i < RT_ELEMENTS(s_aTemplates); i++) 1552 if (!strcmp(pDesc->pszName, s_aTemplates[i].pszName)) 1553 break; 1554 AssertReleaseMsgReturn(i < RT_ELEMENTS(s_aTemplates), ("Not implemented! %s\n", pDesc->pszName), VERR_NOT_IMPLEMENTED); 1555 1556 /* duplicate the patch. */ 1557 const size_t cb = (uintptr_t)s_aTemplates[i].pvEnd - (uintptr_t)s_aTemplates[i].pvStart; 1558 uint8_t *pb = (uint8_t *)remAllocGlue(cb); 1437 1559 AssertReturn(pb, VERR_NO_MEMORY); 1438 *pb++ = 0xcc; 1439 *pb++ = 0x90; 1440 *pb++ = 0xc3; 1560 memcpy(pb, s_aTemplates[i].pvStart, cb); 1561 1562 /* fix it up. */ 1563 remGenerateExportGlueFixup(pb, cb, *pValue, pDesc); 1441 1564 *ppfn = (uintptr_t)pb; 1442 #endif1443 1565 } 1444 1566 } … … 1511 1633 } 1512 1634 else 1513 { 1514 /* annoying stuff, later. */ 1515 #if 0 1516 AssertReleaseMsgFailed(("Not implemented! %s\n", pDesc->pszName)); 1517 return VERR_NOT_IMPLEMENTED; 1518 #else 1519 AssertMsg2("annoying: %s\n", pDesc->pszName); 1520 uint8_t *pb; 1521 pDesc->pvWrapper = pb = (uint8_t *)remAllocGlue(3); 1635 { 1636 /* custom hacks - it's simpler to make assembly templates than writing a more generic code generator... */ 1637 static const struct { const char *pszName; PFNRT pvStart, pvEnd; } s_aTemplates[] = 1638 { 1639 { "SSMR3RegisterInternal", (PFNRT)&WrapGCC2MSC_SSMR3RegisterInternal, (PFNRT)&WrapGCC2MSC_SSMR3RegisterInternal_EndProc }, 1640 }; 1641 unsigned i; 1642 for (i = 0; i < RT_ELEMENTS(s_aTemplates); i++) 1643 if (!strcmp(pDesc->pszName, s_aTemplates[i].pszName)) 1644 break; 1645 AssertReleaseMsgReturn(i < RT_ELEMENTS(s_aTemplates), ("Not implemented! %s\n", pDesc->pszName), VERR_NOT_IMPLEMENTED); 1646 1647 /* duplicate the patch. */ 1648 const size_t cb = (uintptr_t)s_aTemplates[i].pvEnd - (uintptr_t)s_aTemplates[i].pvStart; 1649 pDesc->pvWrapper = remAllocGlue(cb); 1522 1650 AssertReturn(pDesc->pvWrapper, VERR_NO_MEMORY); 1523 *pb++ = 0xcc;1524 *pb++ = 0x90; 1525 *pb++ = 0xc3;1526 #endif 1651 memcpy(pDesc->pvWrapper, s_aTemplates[i].pvStart, cb); 1652 1653 /* fix it up. */ 1654 remGenerateImportGlueFixup((uint8_t *)pDesc->pvWrapper, cb, pDesc); 1527 1655 } 1528 1656 # else /* !USE_REM_CALLING_CONVENTION_GLUE */ -
trunk/src/recompiler/VBoxREMWrapperA.asm
r3581 r3615 21 21 ;******************************************************************************* 22 22 %include "iprt/asmdefs.mac" 23 24 %define REM_FIXUP_32_REAL_STUFF 0deadbeefh 25 %define REM_FIXUP_64_REAL_STUFF 0deadf00df00ddeadh 26 %define REM_FIXUP_64_DESC 0dead00010001deadh 27 %define REM_FIXUP_64_LOG_ENTRY 0dead00020002deadh 28 %define REM_FIXUP_64_LOG_EXIT 0dead00030003deadh 29 %define REM_FIXUP_64_WRAP_GCC_CB 0dead00040004deadh 23 30 24 31 ;%define ENTRY_LOGGING 1 … … 78 85 79 86 %ifdef __WIN__ 80 mov rcx, 0xdead00010001dead87 mov rcx, REM_FIXUP_64_DESC 81 88 %else 82 mov rdi, 0xdead00010001dead89 mov rdi, REM_FIXUP_64_DESC 83 90 %endif 84 mov rax, 0xdead00020002dead91 mov rax, REM_FIXUP_64_LOG_ENTRY 85 92 call rax 86 93 … … 104 111 %ifdef __WIN__ 105 112 mov rdx, rax 106 mov rcx, 0xdead00010001dead113 mov rcx, REM_FIXUP_64_DESC 107 114 %else 108 115 mov rsi, eax 109 mov rdi, 0xdead00010001dead116 mov rdi, REM_FIXUP_64_DESC 110 117 %endif 111 mov rax, 0xdead00030003dead118 mov rax, REM_FIXUP_64_LOG_EXIT 112 119 call rax 113 120 … … 138 145 139 146 %ifdef USE_DIRECT_CALLS 140 call $+5+ 0deadbeefh141 %else 142 mov rax, 0xdeadf00df00ddead147 call $+5+REM_FIXUP_32_REAL_STUFF 148 %else 149 mov rax, REM_FIXUP_64_REAL_STUFF 143 150 call rax 144 151 %endif … … 158 165 mov rcx, rdi 159 166 %ifdef USE_DIRECT_CALLS 160 call $+5+ 0deadbeefh161 %else 162 mov rax, 0xdeadf00df00ddead167 call $+5+REM_FIXUP_32_REAL_STUFF 168 %else 169 mov rax, REM_FIXUP_64_REAL_STUFF 163 170 call rax 164 171 %endif … … 179 186 mov rcx, rdi 180 187 %ifdef USE_DIRECT_CALLS 181 call $+5+ 0deadbeefh182 %else 183 mov rax, 0xdeadf00df00ddead188 call $+5+REM_FIXUP_32_REAL_STUFF 189 %else 190 mov rax, REM_FIXUP_64_REAL_STUFF 184 191 call rax 185 192 %endif … … 201 208 mov rcx, rdi 202 209 %ifdef USE_DIRECT_CALLS 203 call $+5+ 0deadbeefh204 %else 205 mov rax, 0xdeadf00df00ddead210 call $+5+REM_FIXUP_32_REAL_STUFF 211 %else 212 mov rax, REM_FIXUP_64_REAL_STUFF 206 213 call rax 207 214 %endif … … 224 231 mov rcx, rdi 225 232 %ifdef USE_DIRECT_CALLS 226 call $+5+ 0deadbeefh227 %else 228 mov rax, 0xdeadf00df00ddead233 call $+5+REM_FIXUP_32_REAL_STUFF 234 %else 235 mov rax, REM_FIXUP_64_REAL_STUFF 229 236 call rax 230 237 %endif … … 248 255 mov rcx, rdi 249 256 %ifdef USE_DIRECT_CALLS 250 call $+5+ 0deadbeefh251 %else 252 mov rax, 0xdeadf00df00ddead257 call $+5+REM_FIXUP_32_REAL_STUFF 258 %else 259 mov rax, REM_FIXUP_64_REAL_STUFF 253 260 call rax 254 261 %endif … … 273 280 mov rcx, rdi 274 281 %ifdef USE_DIRECT_CALLS 275 call $+5+ 0deadbeefh276 %else 277 mov rax, 0xdeadf00df00ddead282 call $+5+REM_FIXUP_32_REAL_STUFF 283 %else 284 mov rax, REM_FIXUP_64_REAL_STUFF 278 285 call rax 279 286 %endif … … 300 307 mov rcx, rdi 301 308 %ifdef USE_DIRECT_CALLS 302 call $+5+ 0deadbeefh303 %else 304 mov rax, 0xdeadf00df00ddead309 call $+5+REM_FIXUP_32_REAL_STUFF 310 %else 311 mov rax, REM_FIXUP_64_REAL_STUFF 305 312 call rax 306 313 %endif … … 329 336 mov rcx, rdi 330 337 %ifdef USE_DIRECT_CALLS 331 call $+5+ 0deadbeefh332 %else 333 mov rax, 0xdeadf00df00ddead338 call $+5+REM_FIXUP_32_REAL_STUFF 339 %else 340 mov rax, REM_FIXUP_64_REAL_STUFF 334 341 call rax 335 342 %endif … … 360 367 mov rcx, rdi 361 368 %ifdef USE_DIRECT_CALLS 362 call $+5+ 0deadbeefh363 %else 364 mov rax, 0xdeadf00df00ddead369 call $+5+REM_FIXUP_32_REAL_STUFF 370 %else 371 mov rax, REM_FIXUP_64_REAL_STUFF 365 372 call rax 366 373 %endif … … 393 400 mov rcx, rdi 394 401 %ifdef USE_DIRECT_CALLS 395 call $+5+ 0deadbeefh396 %else 397 mov rax, 0xdeadf00df00ddead402 call $+5+REM_FIXUP_32_REAL_STUFF 403 %else 404 mov rax, REM_FIXUP_64_REAL_STUFF 398 405 call rax 399 406 %endif … … 428 435 mov rcx, rdi 429 436 %ifdef USE_DIRECT_CALLS 430 call $+5+ 0deadbeefh431 %else 432 mov rax, 0xdeadf00df00ddead437 call $+5+REM_FIXUP_32_REAL_STUFF 438 %else 439 mov rax, REM_FIXUP_64_REAL_STUFF 433 440 call rax 434 441 %endif … … 465 472 mov rcx, rdi 466 473 %ifdef USE_DIRECT_CALLS 467 call $+5+ 0deadbeefh468 %else 469 mov rax, 0xdeadf00df00ddead474 call $+5+REM_FIXUP_32_REAL_STUFF 475 %else 476 mov rax, REM_FIXUP_64_REAL_STUFF 470 477 call rax 471 478 %endif … … 501 508 mov rsi, r11 ; rsi is preserved by the callee. 502 509 %ifdef USE_DIRECT_CALLS 503 call $+5+ 0deadbeefh504 %else 505 mov rax, 0xdeadf00df00ddead510 call $+5+REM_FIXUP_32_REAL_STUFF 511 %else 512 mov rax, REM_FIXUP_64_REAL_STUFF 506 513 call rax 507 514 %endif … … 514 521 515 522 523 ;; 524 ; Custom template for SSMR3RegisterInternal. 525 ; 526 ; (This is based on the WrapGCC2MSC11Int template.) 527 ; 528 ; @cproto 529 ; 530 ; SSMR3DECL(int) SSMR3RegisterInternal(PVM pVM, const char *pszName, uint32_t u32Instance, uint32_t u32Version, size_t cbGuess, 531 ; PFNSSMINTSAVEPREP pfnSavePrep, PFNSSMINTSAVEEXEC pfnSaveExec, PFNSSMINTSAVEDONE pfnSaveDone, 532 ; PFNSSMINTLOADPREP pfnLoadPrep, PFNSSMINTLOADEXEC pfnLoadExec, PFNSSMINTLOADDONE pfnLoadDone); 533 ; 534 ; @param pVM rdi 0 535 ; @param pszName rsi 1 536 ; @param u32Instance rdx 2 537 ; @param u32Version rcx 3 538 ; @param cbGuess r8 4 539 ; @param pfnSavePrep r9 5 540 ; @param pfnSaveExec rbp + 10h 6 541 ; @param pfnSaveDone rbp + 18h 7 542 ; @param pfnLoadPrep rbp + 20h 8 543 ; @param pfnLoadExec rbp + 28h 9 544 ; @param pfnLoadDone rbp + 30h 10 545 ; 546 BEGINPROC WrapGCC2MSC_SSMR3RegisterInternal 547 LOG_ENTRY 548 push rbp 549 mov rbp, rsp 550 551 sub rsp, 60h 552 553 mov r10, [ebp + 30h] 554 mov [rsp + 50h], r10 ; pfnLoadDone 555 mov r11, [ebp + 28h] 556 mov [rsp + 48h], r11 ; pfnLoadExec 557 mov rax, [ebp + 20h] 558 mov [rsp + 40h], rax ; pfnLoadPrep 559 mov r10, [ebp + 18h] 560 mov [rsp + 38h], r10 ; pfnSaveDone 561 mov r11, [ebp + 10h] 562 mov [rsp + 30h], r11 ; pfnSaveExec 563 mov [rsp + 28h], r9 ; pfnSavePrep 564 mov [rsp + 20h], r8 565 mov [rsp + 18h], rcx ; -> r9 566 mov [rsp + 10h], rdx ; -> r8 567 mov [rsp + 08h], rsi ; -> rdx 568 mov [rsp], rdi ; -> rcx 569 570 ; Now convert the function pointers. Have to setup a new shadow 571 ; space here since the SSMR3RegisterInternal one is already in use. 572 sub rsp, 20h 573 574 mov rcx, REM_FIXUP_64_DESC ; pDesc 575 lea rdx, [rsp + 28h + 20h] ; pValue 576 mov r8d, 5 ; iParam 577 mov rax, REM_FIXUP_64_WRAP_GCC_CB 578 call rax 579 580 mov rcx, REM_FIXUP_64_DESC ; pDesc 581 lea rdx, [rsp + 30h + 20h] ; pValue 582 mov r8d, 6 ; iParam 583 mov rax, REM_FIXUP_64_WRAP_GCC_CB 584 call rax 585 586 mov rcx, REM_FIXUP_64_DESC ; pDesc 587 lea rdx, [rsp + 38h + 20h] ; pValue 588 mov r8d, 7 ; iParam 589 mov rax, REM_FIXUP_64_WRAP_GCC_CB 590 call rax 591 592 mov rcx, REM_FIXUP_64_DESC ; pDesc 593 lea rdx, [rsp + 40h + 20h] ; pValue 594 mov r8d, 8 ; iParam 595 mov rax, REM_FIXUP_64_WRAP_GCC_CB 596 call rax 597 598 mov rcx, REM_FIXUP_64_DESC ; pDesc 599 lea rdx, [rsp + 48h + 20h] ; pValue 600 mov r8d, 9 ; iParam 601 mov rax, REM_FIXUP_64_WRAP_GCC_CB 602 call rax 603 604 mov rcx, REM_FIXUP_64_DESC ; pDesc 605 lea rdx, [rsp + 50h + 20h] ; pValue 606 mov r8d, 10 ; iParam 607 mov rax, REM_FIXUP_64_WRAP_GCC_CB 608 call rax 609 610 add rsp, 20h 611 612 ; finally do the call. 613 mov r9, [rsp + 18h] 614 mov r8, [rsp + 10h] 615 mov rdx, [rsp + 08h] 616 mov rcx, [rsp] 617 %ifdef USE_DIRECT_CALLS 618 call $+5+REM_FIXUP_32_REAL_STUFF 619 %else 620 mov rax, REM_FIXUP_64_REAL_STUFF 621 call rax 622 %endif 623 624 leave 625 LOG_EXIT 626 ret 627 ENDPROC WrapGCC2MSC_SSMR3RegisterInternal 628 516 629 517 630 ; … … 529 642 530 643 %ifdef USE_DIRECT_CALLS 531 call $+5+ 0deadbeefh532 %else 533 mov rax, 0xdeadf00df00ddead644 call $+5+REM_FIXUP_32_REAL_STUFF 645 %else 646 mov rax, REM_FIXUP_64_REAL_STUFF 534 647 call rax 535 648 %endif … … 553 666 mov rdi, rcx 554 667 %ifdef USE_DIRECT_CALLS 555 call $+5+ 0deadbeefh556 %else 557 mov rax, 0xdeadf00df00ddead668 call $+5+REM_FIXUP_32_REAL_STUFF 669 %else 670 mov rax, REM_FIXUP_64_REAL_STUFF 558 671 call rax 559 672 %endif … … 578 691 mov rsi, rdx 579 692 %ifdef USE_DIRECT_CALLS 580 call $+5+ 0deadbeefh581 %else 582 mov rax, 0xdeadf00df00ddead693 call $+5+REM_FIXUP_32_REAL_STUFF 694 %else 695 mov rax, REM_FIXUP_64_REAL_STUFF 583 696 call rax 584 697 %endif … … 603 716 mov rsi, rdx 604 717 mov rdx, r8 605 call $+5+ 0deadbeefh718 call $+5+REM_FIXUP_32_REAL_STUFF 606 719 607 720 mov rdi, [ebp - 18h] … … 625 738 mov rdx, r8 626 739 mov rcx, r9 627 call $+5+ 0deadbeefh740 call $+5+REM_FIXUP_32_REAL_STUFF 628 741 629 742 mov rdi, [ebp - 18h] … … 648 761 mov rcx, r9 649 762 mov r8, [ebp + 30h] 650 call $+5+ 0deadbeefh763 call $+5+REM_FIXUP_32_REAL_STUFF 651 764 652 765 mov rdi, [ebp - 18h] … … 672 785 mov r8, [ebp + 30h] 673 786 mov r9, [ebp + 38h] 674 call $+5+ 0deadbeefh787 call $+5+REM_FIXUP_32_REAL_STUFF 675 788 676 789 mov rdi, [ebp - 18h] … … 698 811 mov r10, [ebp + 40h] 699 812 mov [esp], r10 700 call $+5+ 0deadbeefh813 call $+5+REM_FIXUP_32_REAL_STUFF 701 814 702 815 mov rdi, [ebp - 18h] … … 726 839 mov r11, [ebp + 48h] 727 840 mov [esp + 8], r11 728 call $+5+ 0deadbeefh841 call $+5+REM_FIXUP_32_REAL_STUFF 729 842 730 843 mov rdi, [ebp - 18h] … … 756 869 mov rax, [ebp + 50h] 757 870 mov [esp + 10h], rax 758 call $+5+ 0deadbeefh871 call $+5+REM_FIXUP_32_REAL_STUFF 759 872 760 873 mov rdi, [ebp - 18h] -
trunk/src/recompiler/VBoxRecompiler.c
r3508 r3615 188 188 189 189 190 #if def VBOX_WITH_DEBUGGER190 #if defined(VBOX_WITH_DEBUGGER) && !(defined(__WIN__) && defined(__AMD64__)) 191 191 /* 192 192 * Debugger commands. … … 337 337 return rc; 338 338 339 #if def VBOX_WITH_DEBUGGER339 #if defined(VBOX_WITH_DEBUGGER) && !(defined(__WIN__) && defined(__AMD64__)) 340 340 /* 341 341 * Debugger commands. … … 3857 3857 3858 3858 3859 #if def VBOX_WITH_DEBUGGER3859 #if defined(VBOX_WITH_DEBUGGER) && !(defined(__WIN__) && defined(__AMD64__)) 3860 3860 /** 3861 3861 * External Debugger Command: .remstep [on|off|1|0]
Note:
See TracChangeset
for help on using the changeset viewer.