VirtualBox

Changeset 3123 in vbox


Ignore:
Timestamp:
Jun 15, 2007 2:46:16 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22015
Message:

Made VBOX_LOG_FLAGS=msprog work in GC.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm.h

    r2981 r3123  
    424424 * @param   uOperation  Which operation to execute (VMMGCOPERATION).
    425425 * @param   uArg        Argument to that operation.
    426  */
    427 VMMGCDECL(int) VMMGCEntry(PVM pVM, unsigned uOperation, unsigned uArg);
     426 * @param   ...         Additional arguments.
     427 */
     428VMMGCDECL(int) VMMGCEntry(PVM pVM, unsigned uOperation, unsigned uArg, ...);
    428429
    429430/**
  • trunk/include/iprt/initterm.h

    r2981 r3123  
    8383#endif
    8484
     85#ifdef IN_GC
     86/**
     87 * Initalizes the guest context runtime library.
     88 *
     89 * @returns iprt status code.
     90 *
     91 * @param   u64ProgramStartNanoTS  The startup timestamp.
     92 */
     93RTGCDECL(int) RTGCInit(uint64_t u64ProgramStartNanoTS);
     94
     95/**
     96 * Terminates the guest context runtime library.
     97 */
     98RTGCDECL(void) RTGCTerm(void);
     99#endif
     100
     101
    85102/** @} */
    86103
  • trunk/include/iprt/time.h

    r2981 r3123  
    689689 * @returns Timestamp relative to program startup.
    690690 */
    691 RTR3DECL(uint64_t)  RTTimeProgramNanoTS(void);
     691RTDECL(uint64_t)  RTTimeProgramNanoTS(void);
     692
     693/**
     694 * Get the microsecond timestamp relative to program startup.
     695 *
     696 * @returns Timestamp relative to program startup.
     697 */
     698RTDECL(uint64_t)  RTTimeProgramMicroTS(void);
    692699
    693700/**
     
    696703 * @returns Timestamp relative to program startup.
    697704 */
    698 RTR3DECL(uint64_t)  RTTimeProgramMilliTS(void);
     705RTDECL(uint64_t)  RTTimeProgramMilliTS(void);
    699706
    700707/**
     
    703710 * @returns Timestamp relative to program startup.
    704711 */
    705 RTR3DECL(uint32_t)  RTTimeProgramSecTS(void);
    706 
     712RTDECL(uint32_t)  RTTimeProgramSecTS(void);
     713
     714/**
     715 * Get the RTTimeNanoTS() of when the program started.
     716 *
     717 * @returns Program startup timestamp.
     718 */
     719RTDECL(uint64_t) RTTimeProgramStartNanoTS(void);
    707720
    708721/** @} */
  • trunk/src/VBox/Runtime/Makefile.kmk

    r3054 r3123  
    834834RuntimeGC_DEFS          = IN_RT_GC RT_WITH_VBOX
    835835RuntimeGC_SOURCES       = \
     836        gc/initterm-gc.cpp \
    836837        misc/sanity-cpp.cpp \
    837838        misc/sanity-c.c \
     
    856857        VBox/strformat-vbox.cpp \
    857858        timesup.cpp \
     859        timeprog.cpp \
    858860        string/memchr.cpp \
    859861        string/memcmp.cpp \
  • trunk/src/VBox/Runtime/include/internal/time.h

    r2981 r3123  
    2727__BEGIN_DECLS
    2828
    29 #ifdef IN_RING3
     29#if defined(IN_RING3) || defined(IN_GC)
    3030
    3131extern uint64_t g_u64ProgramStartNanoTS;
     32extern uint64_t g_u64ProgramStartMicroTS;
    3233extern uint64_t g_u64ProgramStartMilliTS;
    3334
  • trunk/src/VBox/Runtime/log.cpp

    r3086 r3123  
    19281928                if (pLogger->fFlags & RTLOGFLAGS_PREFIX_MS_PROG)
    19291929                {
    1930 #ifdef IN_RING3
     1930#if defined(IN_RING3) || defined(IN_GC)
    19311931                    uint64_t u64 = RTTimeProgramMilliTS();
    19321932#else
  • trunk/src/VBox/Runtime/r3/init.cpp

    r2981 r3123  
    6666 */
    6767uint64_t    g_u64ProgramStartNanoTS;
     68
     69/**
     70 * Program start microsecond TS.
     71 */
     72uint64_t    g_u64ProgramStartMicroTS;
    6873
    6974/**
     
    146151     */
    147152    g_u64ProgramStartNanoTS = RTTimeNanoTS();
    148     g_u64ProgramStartMilliTS = RTTimeMilliTS();
     153    g_u64ProgramStartMicroTS = g_u64ProgramStartNanoTS / 1000;
     154    g_u64ProgramStartMilliTS = g_u64ProgramStartNanoTS / 1000000;
    149155
    150156#ifndef IN_GUEST
  • trunk/src/VBox/Runtime/timeprog.cpp

    r2981 r3123  
    3535 * @returns Timestamp relative to program startup.
    3636 */
    37 RTR3DECL(uint64_t)  RTTimeProgramNanoTS(void)
     37RTDECL(uint64_t)  RTTimeProgramNanoTS(void)
    3838{
    39     AssertMsg(g_u64ProgramStartNanoTS, ("RTR3Init hasn't been called!\n"));
    4039    return RTTimeNanoTS() - g_u64ProgramStartNanoTS;
     40}
     41
     42
     43/**
     44 * Get the microsecond timestamp relative to program startup.
     45 *
     46 * @returns Timestamp relative to program startup.
     47 */
     48RTDECL(uint64_t)  RTTimeProgramMicroTS(void)
     49{
     50    return RTTimeProgramNanoTS() / 1000;
    4151}
    4252
     
    4757 * @returns Timestamp relative to program startup.
    4858 */
    49 RTR3DECL(uint64_t)  RTTimeProgramMilliTS(void)
     59RTDECL(uint64_t)  RTTimeProgramMilliTS(void)
    5060{
    51 /*    AssertMsg(g_u64ProgramStartMilliTS, ("RTR3Init hasn't been called!\n")); */
    5261    return RTTimeMilliTS() - g_u64ProgramStartMilliTS;
    5362}
     
    5968 * @returns Timestamp relative to program startup.
    6069 */
    61 RTR3DECL(uint32_t)  RTTimeProgramSecTS(void)
     70RTDECL(uint32_t)  RTTimeProgramSecTS(void)
    6271{
    6372    AssertMsg(g_u64ProgramStartMilliTS, ("RTR3Init hasn't been called!\n"));
    6473    return (uint32_t)(RTTimeProgramMilliTS() / 1000);
    6574}
     75
     76
     77/**
     78 * Get the RTTimeNanoTS() of when the program started.
     79 *
     80 * @returns Program startup timestamp.
     81 */
     82RTDECL(uint64_t) RTTimeProgramStartNanoTS(void)
     83{
     84    return g_u64ProgramStartNanoTS;
     85}
  • trunk/src/VBox/VMM/VMM.cpp

    r2981 r3123  
    675675        CPUMHyperSetCtxCore(pVM, NULL);
    676676        CPUMSetHyperESP(pVM, pVM->vmm.s.pbGCStackBottom); /* Clear the stack. */
     677        uint64_t u64TS = RTTimeProgramStartNanoTS();
     678#if GC_ARCH_BITS == 32
     679        CPUMPushHyper(pVM, (uint32_t)(u64TS >> 32));    /* Param 3: The program startup TS - Hi. */
     680        CPUMPushHyper(pVM, (uint32_t)u64TS);            /* Param 3: The program startup TS - Lo. */
     681#else /* 64-bit GC */
     682        CPUMPushHyper(pVM, u64TS);                      /* Param 3: The program startup TS. */
     683#endif       
    677684        CPUMPushHyper(pVM, VBOX_VERSION);               /* Param 2: Version argument. */
    678685        CPUMPushHyper(pVM, VMMGC_DO_VMMGC_INIT);        /* Param 1: Operation. */
  • trunk/src/VBox/VMM/VMMGC/VMMGC.cpp

    r2981 r3123  
    3434#include <iprt/asm.h>
    3535#include <iprt/assert.h>
     36#include <iprt/initterm.h>
    3637
    3738
     
    6162 * @param   uArg        Argument to that operation.
    6263 */
    63 VMMGCDECL(int) VMMGCEntry(PVM pVM, unsigned uOperation, unsigned uArg)
     64VMMGCDECL(int) VMMGCEntry(PVM pVM, unsigned uOperation, unsigned uArg, ...)
    6465{
    6566    /* todo */
     
    7172        case VMMGC_DO_VMMGC_INIT:
    7273        {
    73             Log(("VMMGCEntry: VMMGC_DO_VMMGC_INIT - uArg=%#x\n", uArg));
     74            /* fetch the additional argument(s). */
     75            va_list va;
     76            va_start(va, uArg);
     77            uint64_t u64TS = va_arg(va, uint64_t);
     78            va_end(va);
     79           
     80            Log(("VMMGCEntry: VMMGC_DO_VMMGC_INIT - uArg=%#x (version) u64TS=%RX64\n", uArg, u64TS));
     81           
     82            /*
     83             * Validate the version.
     84             */
    7485            /** @todo validate version. */
     86           
     87            /*
     88             * Initialize the runtime.
     89             */
     90            int rc = RTGCInit(u64TS);
     91            AssertRCReturn(rc, rc);
     92           
    7593            return VINF_SUCCESS;
    7694        }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette