VirtualBox

Changeset 54218 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
Feb 16, 2015 3:17:05 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
98283
Message:

DBGF,DBGC: Added dmesg command and implemented it for linux guests.

Location:
trunk/include/VBox/vmm
Files:
2 edited

Legend:

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

    r53615 r54218  
    15511551    /** Thread info. */
    15521552    DBGFOSINTERFACE_THREAD,
     1553    /** Kernel message log - DBGFOSIDMESG. */
     1554    DBGFOSINTERFACE_DMESG,
    15531555    /** The end of the valid entries. */
    15541556    DBGFOSINTERFACE_END,
     
    16581660     * This is called after pfnProbe.
    16591661     *
     1662     * The returned interface must be valid until pfnDestruct is called.  Two calls
     1663     * to this method with the same @a enmIf value must return the same pointer.
     1664     *
    16601665     * @returns Pointer to the interface if available, NULL if not available.
    16611666     * @param   pUVM    The user mode VM handle.
     
    16761681#define DBGFOSREG_MAGIC     0x19830808
    16771682
     1683
     1684/**
     1685 * Interface for querying kernel log messages (DBGFOSINTERFACE_DMESG).
     1686 */
     1687typedef struct DBGFOSIDMESG
     1688{
     1689    /** Trailing magic (DBGFOSIDMESG_MAGIC). */
     1690    uint32_t    u32Magic;
     1691
     1692    /**
     1693     * Query the kernel log.
     1694     *
     1695     * @returns VBox status code.
     1696     * @retval  VERR_NOT_FOUND if the messages could not be located.
     1697     * @retval  VERR_INVALID_STATE if the messages was found to have unknown/invalid
     1698     *          format.
     1699     * @retval  VERR_BUFFER_OVERFLOW if the buffer isn't large enough, pcbActual
     1700     *          will be set to the required buffer size.  The buffer, however, will
     1701     *          be filled with as much data as it can hold (properly zero terminated
     1702     *          of course).
     1703     *
     1704     * @param   pThis       Pointer to the interface structure.
     1705     * @param   pUVM        The user mode VM handle.
     1706     * @param   fFlags      Flags reserved for future use, MBZ.
     1707     * @param   cMessages   The number of messages to retrieve, counting from the
     1708     *                      end of the log (i.e. like tail), use UINT32_MAX for all.
     1709     * @param   pszBuf      The output buffer.
     1710     * @param   cbBuf       The buffer size.
     1711     * @param   pcbActual   Where to store the number of bytes actually returned,
     1712     *                      including zero terminator.  On VERR_BUFFER_OVERFLOW this
     1713     *                      holds the necessary buffer size.  Optional.
     1714     */
     1715    DECLCALLBACKMEMBER(int, pfnQueryKernelLog)(struct DBGFOSIDMESG *pThis, PUVM pUVM, uint32_t fFlags, uint32_t cMessages,
     1716                                               char *pszBuf, size_t cbBuf, size_t *pcbActual);
     1717    /** Trailing magic (DBGFOSIDMESG_MAGIC). */
     1718    uint32_t    u32EndMagic;
     1719} DBGFOSIDMESG;
     1720/** Pointer to the interface for query kernel log messages (DBGFOSINTERFACE_DMESG). */
     1721typedef DBGFOSIDMESG *PDBGFOSIDMESG;
     1722/** Magic value for DBGFOSIDMESG::32Magic and DBGFOSIDMESG::u32EndMagic. (Kenazburo Oe) */
     1723#define DBGFOSIDMESG_MAGIC UINT32_C(0x19350131)
     1724
     1725
    16781726VMMR3DECL(int)      DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg);
    16791727VMMR3DECL(int)      DBGFR3OSDeregister(PUVM pUVM, PCDBGFOSREG pReg);
  • trunk/include/VBox/vmm/uvm.h

    r45189 r54218  
    143143        struct DBGFUSERPERVM    s;
    144144#endif
    145         uint8_t                 padding[256];
     145        uint8_t                 padding[384];
    146146    } dbgf;
    147147
     
    167167                         RT_VALID_ALIGNED_PTR(a_pUVM, PAGE_SIZE) ? (a_pUVM)->u32Magic : 0), \
    168168                        (a_rc))
     169/** @def UVM_ASSERT_VALID_EXT_RETURN
     170 * Asserts a user mode VM handle is valid for external access.
     171 */
     172#define UVM_ASSERT_VALID_EXT_RETURN_VOID(a_pUVM) \
     173        AssertMsgReturnVoid(    RT_VALID_ALIGNED_PTR(a_pUVM, PAGE_SIZE) \
     174                            &&  (a_pUVM)->u32Magic == UVM_MAGIC, \
     175                            ("a_pUVM=%p u32Magic=%#x\n", (a_pUVM), \
     176                             RT_VALID_ALIGNED_PTR(a_pUVM, PAGE_SIZE) ? (a_pUVM)->u32Magic : 0))
    169177
    170178#endif
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