Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

DECLASM ( int   ) 

Executes VMPTRST

Returns:
VBox status code
Parameters:
pVMCS Address that will receive the current pointer
Executes VMWRITE

Returns:
VBox status code
Parameters:
idxField VMCS index
u64Val 16, 32 or 64 bits value
Prepares for and executes VMRUN (32 bits guests).

Returns:
VBox status code.
Parameters:
pVMCBHostPhys Physical address of host VMCB.
pVMCBPhys Physical address of the VMCB.
pCtx Guest context.
Prepares for and executes VMRUN (64 bits guests).

Returns:
VBox status code.
Parameters:
pVMCBHostPhys Physical address of host VMCB.
pVMCBPhys Physical address of the VMCB.
pCtx Guest context.
Executes VMWRITE

Returns:
VBox status code
Parameters:
idxField VMCS index
u64Val 16, 32 or 64 bits value
32-bit Ring-0 initialization.

This is called from VBoxGuestA-os2.asm upon the first open call to the vboxgst$ device.

Returns:
0 on success, non-zero on failure.
Parameters:
pszArgs Pointer to the device arguments.
#DB (Debug event) handler.

Returns:
VBox status code. VINF_SUCCESS means we completely handled this trap, other codes are passed execution to host context.
Parameters:
pTrpm Pointer to TRPM data (within VM).
pRegFrame Pointer to the register frame for the trap.

For internal use only.

Definition at line 132 of file VBoxGuest-os2.cpp.

{
    Log(("VBoxGuestOS2Init: pszArgs='%s' MMIO=0x%RX32 IOPort=0x%RX16 Int=%#x Bus=%#x Dev=%#x Fun=%d\n",
         pszArgs, g_PhysMMIOBase, g_IOPortBase, g_bInterruptLine, g_bPciBusNo, g_bPciDevFunNo >> 3, g_bPciDevFunNo & 7));

    /*
     * Initialize the runtime.
     */
    int rc = RTR0Init(0);
    if (RT_SUCCESS(rc))
    {
        /*
         * Process the commandline. Later.
         */
        bool fVerbose = true;

        /*
         * Map the MMIO memory if found.
         */
        rc = vboxGuestOS2MapMemory();
        if (RT_SUCCESS(rc))
        {
            /*
             * Initialize the device extension.
             */
            if (g_MemMapMMIO != NIL_RTR0MEMOBJ)
                rc = VBoxGuestInitDevExt(&g_DevExt, g_IOPortBase,
                                         RTR0MemObjAddress(g_MemMapMMIO),
                                         RTR0MemObjSize(g_MemMapMMIO),
                                         vboxGuestOS2DetectVersion());
            else
                rc = VBoxGuestInitDevExt(&g_DevExt, g_IOPortBase, NULL, 0,
                                         vboxGuestOS2DetectVersion());
            if (RT_SUCCESS(rc))
            {
                /*
                 * Initialize the session hash table.
                 */
                rc = RTSpinlockCreate(&g_Spinlock);
                if (RT_SUCCESS(rc))
                {
                    /*
                     * Configure the interrupt handler.
                     */
                    if (g_bInterruptLine)
                    {
                        rc = VBoxGuestOS2SetIRQ(g_bInterruptLine);
                        if (rc)
                        {
                            Log(("VBoxGuestOS2SetIRQ(%d) -> %d\n", g_bInterruptLine, rc));
                            rc = RTErrConvertFromOS2(rc);
                        }
                    }
                    if (RT_SUCCESS(rc))
                    {
                        /*
                         * Success
                         */
                        if (fVerbose)
                        {
                            strcpy(&g_szInitText[0],
                                   "\r\n"
                                   "VirtualBox Guest Additions Driver for OS/2 version " VBOX_VERSION_STRING "\r\n"
                                   "Copyright (C) 2008 Sun Microsystems, Inc.\r\n");
                            g_cchInitText = strlen(&g_szInitText[0]);
                        }
                        Log(("VBoxGuestOS2Init: Successfully loaded\n%s", g_szInitText));
                        return VINF_SUCCESS;
                    }

                    g_cchInitText = RTStrPrintf(&g_szInitText[0], g_cchInitTextMax, "VBoxGuest.sys: SetIrq failed for IRQ %#d, rc=%Vrc\n",
                                                g_bInterruptLine, rc);
                }
                else
                    g_cchInitText = RTStrPrintf(&g_szInitText[0], g_cchInitTextMax, "VBoxGuest.sys: RTSpinlockCreate failed, rc=%Vrc\n", rc);
                VBoxGuestDeleteDevExt(&g_DevExt);
            }
            else
                g_cchInitText = RTStrPrintf(&g_szInitText[0], g_cchInitTextMax, "VBoxGuest.sys: VBoxGuestOS2InitDevExt failed, rc=%Vrc\n", rc);

            int rc2 = RTR0MemObjFree(g_MemObjMMIO, true /* fFreeMappings */); AssertRC(rc2);
            g_MemObjMMIO = g_MemMapMMIO = NIL_RTR0MEMOBJ;
        }
        else
            g_cchInitText = RTStrPrintf(&g_szInitText[0], g_cchInitTextMax, "VBoxGuest.sys: VBoxGuestOS2MapMMIO failed, rc=%Vrc\n", rc);
        RTR0Term();
    }
    else
        g_cchInitText = RTStrPrintf(&g_szInitText[0], g_cchInitTextMax, "VBoxGuest.sys: RTR0Init failed, rc=%Vrc\n", rc);

    RTLogBackdoorPrintf("VBoxGuestOS2Init: failed rc=%Vrc - %s", rc, &g_szInitText[0]);
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index