Changeset 13778
- Timestamp:
- 11/04/08 10:45:27 (2 months ago)
- Files:
-
- trunk/include/VBox/cpum.h (modified) (1 diff)
- trunk/include/VBox/em.h (modified) (1 diff)
- trunk/include/VBox/hwaccm.h (modified) (1 diff)
- trunk/include/VBox/pgm.h (modified) (2 diffs)
- trunk/include/VBox/tm.h (modified) (1 diff)
- trunk/include/VBox/vmm.h (modified) (1 diff)
- trunk/src/VBox/VMM/CPUM.cpp (modified) (2 diffs)
- trunk/src/VBox/VMM/EM.cpp (modified) (2 diffs)
- trunk/src/VBox/VMM/HWACCM.cpp (modified) (2 diffs)
- trunk/src/VBox/VMM/PGM.cpp (modified) (2 diffs)
- trunk/src/VBox/VMM/TM.cpp (modified) (2 diffs)
- trunk/src/VBox/VMM/VM.cpp (modified) (3 diffs)
- trunk/src/VBox/VMM/VMM.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/VBox/cpum.h
r13532 r13778 961 961 962 962 VMMR3DECL(int) CPUMR3Init(PVM pVM); 963 VMMR3DECL(int) CPUMR3InitCPU(PVM pVM); 963 964 VMMR3DECL(void) CPUMR3Relocate(PVM pVM); 964 965 VMMR3DECL(int) CPUMR3Term(PVM pVM); 966 VMMR3DECL(int) CPUMR3TermCPU(PVM pVM); 965 967 VMMR3DECL(void) CPUMR3Reset(PVM pVM); 966 968 VMMR3DECL(int) CPUMR3QueryGuestCtxGCPtr(PVM pVM, RCPTRTYPE(PCPUMCTX) *ppCtx); trunk/include/VBox/em.h
r13565 r13778 166 166 */ 167 167 VMMR3DECL(int) EMR3Init(PVM pVM); 168 VMMR3DECL(int) EMR3InitCPU(PVM pVM); 168 169 VMMR3DECL(void) EMR3Relocate(PVM pVM); 169 170 VMMR3DECL(void) EMR3Reset(PVM pVM); 170 171 VMMR3DECL(int) EMR3Term(PVM pVM); 172 VMMR3DECL(int) EMR3TermCPU(PVM pVM); 171 173 VMMR3DECL(DECLNORETURN(void)) EMR3FatalError(PVM pVM, int rc); 172 174 VMMR3DECL(int) EMR3ExecuteVM(PVM pVM); trunk/include/VBox/hwaccm.h
r13517 r13778 101 101 VMMR3DECL(bool) HWACCMR3IsEventPending(PVM pVM); 102 102 VMMR3DECL(int) HWACCMR3Init(PVM pVM); 103 VMMR3DECL(int) HWACCMR3InitCPU(PVM pVM); 103 104 VMMR3DECL(int) HWACCMR3InitFinalizeR0(PVM pVM); 104 105 VMMR3DECL(void) HWACCMR3Relocate(PVM pVM); 105 106 VMMR3DECL(int) HWACCMR3Term(PVM pVM); 107 VMMR3DECL(int) HWACCMR3TermCPU(PVM pVM); 106 108 VMMR3DECL(void) HWACCMR3Reset(PVM pVM); 107 109 VMMR3DECL(void) HWACCMR3CheckError(PVM pVM, int iStatusCode); trunk/include/VBox/pgm.h
r13387 r13778 477 477 */ 478 478 VMMR3DECL(int) PGMR3Init(PVM pVM); 479 VMMR3DECL(int) PGMR3InitCPU(PVM pVM); 479 480 VMMR3DECL(int) PGMR3InitDynMap(PVM pVM); 480 481 VMMR3DECL(int) PGMR3InitFinalize(PVM pVM); … … 482 483 VMMR3DECL(void) PGMR3Reset(PVM pVM); 483 484 VMMR3DECL(int) PGMR3Term(PVM pVM); 485 VMMR3DECL(int) PGMR3TermCPU(PVM pVM); 484 486 VMMR3DECL(int) PGMR3LockCall(PVM pVM); 485 487 VMMR3DECL(int) PGMR3ChangeShwPDMappings(PVM pVM, bool fEnable); trunk/include/VBox/tm.h
r13633 r13778 209 209 */ 210 210 VMMR3DECL(int) TMR3Init(PVM pVM); 211 VMMR3DECL(int) TMR3InitCPU(PVM pVM); 211 212 VMMR3DECL(int) TMR3InitFinalize(PVM pVM); 212 213 VMMR3DECL(void) TMR3Relocate(PVM pVM, RTGCINTPTR offDelta); 213 214 VMMR3DECL(int) TMR3Term(PVM pVM); 215 VMMR3DECL(int) TMR3TermCPU(PVM pVM); 214 216 VMMR3DECL(void) TMR3Reset(PVM pVM); 215 217 VMMR3DECL(int) TMR3GetImportRC(PVM pVM, const char *pszSymbol, PRTRCPTR pRCPtrValue); trunk/include/VBox/vmm.h
r13714 r13778 121 121 */ 122 122 VMMR3DECL(int) VMMR3Init(PVM pVM); 123 VMMR3DECL(int) VMMR3InitCPU(PVM pVM); 123 124 VMMR3DECL(int) VMMR3InitFinalize(PVM pVM); 124 125 VMMR3DECL(int) VMMR3InitR0(PVM pVM); 125 126 VMMR3DECL(int) VMMR3InitRC(PVM pVM); 126 127 VMMR3DECL(int) VMMR3Term(PVM pVM); 128 VMMR3DECL(int) VMMR3TermCPU(PVM pVM); 127 129 VMMR3DECL(void) VMMR3Relocate(PVM pVM, RTGCINTPTR offDelta); 128 130 VMMR3DECL(int) VMMR3UpdateLoggers(PVM pVM); trunk/src/VBox/VMM/CPUM.cpp
r13005 r13778 218 218 } 219 219 220 /** 221 * Initializes the per-VCPU CPUM. 222 * 223 * @returns VBox status code. 224 * @param pVM The VM to operate on. 225 */ 226 VMMR3DECL(int) CPUMR3InitCPU(PVM pVM) 227 { 228 LogFlow(("CPUMR3InitCPU\n")); 229 return VINF_SUCCESS; 230 } 220 231 221 232 /** … … 646 657 } 647 658 659 /** 660 * Terminates the per-VCPU CPUM. 661 * 662 * Termination means cleaning up and freeing all resources, 663 * the VM it self is at this point powered off or suspended. 664 * 665 * @returns VBox status code. 666 * @param pVM The VM to operate on. 667 */ 668 VMMR3DECL(int) CPUMR3TermCPU(PVM pVM) 669 { 670 return 0; 671 } 648 672 649 673 /** trunk/src/VBox/VMM/EM.cpp
r13765 r13778 374 374 } 375 375 376 /** 377 * Initializes the per-VCPU EM. 378 * 379 * @returns VBox status code. 380 * @param pVM The VM to operate on. 381 */ 382 VMMR3DECL(int) EMR3InitCPU(PVM pVM) 383 { 384 LogFlow(("EMR3InitCPU\n")); 385 return VINF_SUCCESS; 386 } 376 387 377 388 /** … … 418 429 } 419 430 431 /** 432 * Terminates the per-VCPU EM. 433 * 434 * Termination means cleaning up and freeing all resources, 435 * the VM it self is at this point powered off or suspended. 436 * 437 * @returns VBox status code. 438 * @param pVM The VM to operate on. 439 */ 440 VMMR3DECL(int) EMR3TermCPU(PVM pVM) 441 { 442 return 0; 443 } 420 444 421 445 /** trunk/src/VBox/VMM/HWACCM.cpp
r13646 r13778 207 207 AssertRC(rc); 208 208 209 return VINF_SUCCESS; 210 } 211 212 /** 213 * Initializes the per-VCPU HWACCM. 214 * 215 * @returns VBox status code. 216 * @param pVM The VM to operate on. 217 */ 218 VMMR3DECL(int) HWACCMR3InitCPU(PVM pVM) 219 { 220 LogFlow(("HWACCMR3InitCPU\n")); 209 221 return VINF_SUCCESS; 210 222 } … … 835 847 836 848 /** 849 * Terminates the per-VCPU HWACCM. 850 * 851 * Termination means cleaning up and freeing all resources, 852 * the VM it self is at this point powered off or suspended. 853 * 854 * @returns VBox status code. 855 * @param pVM The VM to operate on. 856 */ 857 VMMR3DECL(int) HWACCMR3TermCPU(PVM pVM) 858 { 859 return 0; 860 } 861 862 /** 837 863 * The VM is being reset. 838 864 * trunk/src/VBox/VMM/PGM.cpp
r13343 r13778 1279 1279 } 1280 1280 1281 /** 1282 * Initializes the per-VCPU PGM. 1283 * 1284 * @returns VBox status code. 1285 * @param pVM The VM to operate on. 1286 */ 1287 VMMR3DECL(int) PGMR3InitCPU(PVM pVM) 1288 { 1289 LogFlow(("PGMR3InitCPU\n")); 1290 return VINF_SUCCESS; 1291 } 1281 1292 1282 1293 /** … … 2107 2118 } 2108 2119 2120 /** 2121 * Terminates the per-VCPU PGM. 2122 * 2123 * Termination means cleaning up and freeing all resources, 2124 * the VM it self is at this point powered off or suspended. 2125 * 2126 * @returns VBox status code. 2127 * @param pVM The VM to operate on. 2128 */ 2129 VMMR3DECL(int) PGMR3TermCPU(PVM pVM) 2130 { 2131 return 0; 2132 } 2109 2133 2110 2134 /** trunk/src/VBox/VMM/TM.cpp
r13633 r13778 601 601 } 602 602 603 /** 604 * Initializes the per-VCPU TM. 605 * 606 * @returns VBox status code. 607 * @param pVM The VM to operate on. 608 */ 609 VMMR3DECL(int) TMR3InitCPU(PVM pVM) 610 { 611 LogFlow(("TMR3InitCPU\n")); 612 return VINF_SUCCESS; 613 } 603 614 604 615 /** … … 873 884 } 874 885 886 /** 887 * Terminates the per-VCPU TM. 888 * 889 * Termination means cleaning up and freeing all resources, 890 * the VM it self is at this point powered off or suspended. 891 * 892 * @returns VBox status code. 893 * @param pVM The VM to operate on. 894 */ 895 VMMR3DECL(int) TMR3TermCPU(PVM pVM) 896 { 897 return 0; 898 } 875 899 876 900 /** trunk/src/VBox/VMM/VM.cpp
r13755 r13778 127 127 static int vmR3CreateU(PUVM pUVM, uint32_t cCPUs, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM); 128 128 static int vmR3InitRing3(PVM pVM, PUVM pUVM); 129 static int vmR3InitVMCpu(PVM pVM); 129 130 static int vmR3InitRing0(PVM pVM); 130 131 static int vmR3InitGC(PVM pVM); … … 521 522 LogFlow(("Ring-3 init succeeded\n")); 522 523 523 /* 524 * Init the Ring-0 components. 525 */ 526 rc = vmR3InitRing0(pVM); 524 /* Initialize the VM CPU components. */ 525 rc = vmR3InitVMCpu(pVM); 527 526 if (VBOX_SUCCESS(rc)) 528 527 { 529 /* Relocate again, because some switcher fixups depends on R0 init results. */ 530 VMR3Relocate(pVM, 0); 528 /* 529 * Init the Ring-0 components. 530 */ 531 rc = vmR3InitRing0(pVM); 532 if (VBOX_SUCCESS(rc)) 533 { 534 /* Relocate again, because some switcher fixups depends on R0 init results. */ 535 VMR3Relocate(pVM, 0); 531 536 532 537 #ifdef VBOX_WITH_DEBUGGER 533 /*534 * Init the tcp debugger console if we're building535 * with debugger support.536 */537 void *pvUser = NULL;538 rc = DBGCTcpCreate(pVM, &pvUser);539 if ( VBOX_SUCCESS(rc)540 || rc == VERR_NET_ADDRESS_IN_USE)541 {542 pUVM->vm.s.pvDBGC = pvUser;538 /* 539 * Init the tcp debugger console if we're building 540 * with debugger support. 541 */ 542 void *pvUser = NULL; 543 rc = DBGCTcpCreate(pVM, &pvUser); 544 if ( VBOX_SUCCESS(rc) 545 || rc == VERR_NET_ADDRESS_IN_USE) 546 { 547 pUVM->vm.s.pvDBGC = pvUser; 543 548 #endif 544 /*545 * Init the Guest Context components.546 */547 rc = vmR3InitGC(pVM);548 if (VBOX_SUCCESS(rc))549 {550 549 /* 551 * Now we can safely set the VM halt method to default.550 * Init the Guest Context components. 552 551 */ 553 rc = vmR3 SetHaltMethodU(pUVM, VMHALTMETHOD_DEFAULT);554 if ( RT_SUCCESS(rc))552 rc = vmR3InitGC(pVM); 553 if (VBOX_SUCCESS(rc)) 555 554 { 556 555 /* 557 * Set the state and link into the global list.556 * Now we can safely set the VM halt method to default. 558 557 */ 559 vmR3SetState(pVM, VMSTATE_CREATED); 560 pUVM->pNext = g_pUVMsHead; 561 g_pUVMsHead = pUVM; 562 return VINF_SUCCESS; 558 rc = vmR3SetHaltMethodU(pUVM, VMHALTMETHOD_DEFAULT); 559 if (RT_SUCCESS(rc)) 560 { 561 /* 562 * Set the state and link into the global list. 563 */ 564 vmR3SetState(pVM, VMSTATE_CREATED); 565 pUVM->pNext = g_pUVMsHead; 566 g_pUVMsHead = pUVM; 567 return VINF_SUCCESS; 568 } 563 569 } 570 #ifdef VBOX_WITH_DEBUGGER 571 DBGCTcpTerminate(pVM, pUVM->vm.s.pvDBGC); 572 pUVM->vm.s.pvDBGC = NULL; 564 573 } 565 #ifdef VBOX_WITH_DEBUGGER 566 DBGCTcpTerminate(pVM, pUVM->vm.s.pvDBGC); 567 pUVM->vm.s.pvDBGC = NULL; 574 #endif 575 //.. 568 576 } 569 #endif570 //..571 577 } 572 578 vmR3Destroy(pVM); … … 755 761 } 756 762 763 /** 764 * Initializes all VM CPU components of the VM 765 */ 766 static int vmR3InitVMCpu(PVM pVM) 767 { 768 int rc = VINF_SUCCESS; 769 int rc2; 770 771 rc = CPUMR3InitCPU(pVM); 772 if (VBOX_SUCCESS(rc)) 773 { 774 rc = HWACCMR3InitCPU(pVM); 775 if (VBOX_SUCCESS(rc)) 776 { 777 rc = PGMR3InitCPU(pVM); 778 if (VBOX_SUCCESS(rc)) 779 { 780 rc = TMR3InitCPU(pVM); 781 if (VBOX_SUCCESS(rc)) 782 { 783 rc = VMMR3InitCPU(pVM); 784 if (VBOX_SUCCESS(rc)) 785 { 786 rc = EMR3InitCPU(pVM); 787 if (VBOX_SUCCESS(rc)) 788 return VINF_SUCCESS; 789 790 rc2 = VMMR3TermCPU(pVM); 791 AssertRC(rc2); 792 } 793 rc2 = TMR3TermCPU(pVM); 794 AssertRC(rc2); 795 } 796 rc2 = PGMR3TermCPU(pVM); 797 AssertRC(rc2); 798 } 799 rc2 = HWACCMR3TermCPU(pVM); 800 AssertRC(rc2); 801 } 802 rc2 = CPUMR3TermCPU(pVM); 803 AssertRC(rc2); 804 } 805 LogFlow(("vmR3InitVMCpu: returns %Vrc\n", rc)); 806 return rc; 807 } 808 757 809 758 810 /** trunk/src/VBox/VMM/VMM.cpp
r13742 r13778 244 244 } 245 245 246 247 /** 248 * Initializes the per-VCPU VMM. 249 * 250 * @returns VBox status code. 251 * @param pVM The VM to operate on. 252 */ 253 VMMR3DECL(int) VMMR3InitCPU(PVM pVM) 254 { 255 LogFlow(("VMMR3InitCPU\n")); 256 return VINF_SUCCESS; 257 } 246 258 247 259 /** … … 751 763 #endif 752 764 return rc; 765 } 766 767 /** 768 * Terminates the per-VCPU VMM. 769 * 770 * Termination means cleaning up and freeing all resources, 771 * the VM it self is at this point powered off or suspended. 772 * 773 * @returns VBox status code. 774 * @param pVM The VM to operate on. 775 */ 776 VMMR3DECL(int) VMMR3TermCPU(PVM pVM) 777 { 778 return 0; 753 779 } 754 780

