VirtualBox

Changeset 9412 in vbox for trunk/include


Ignore:
Timestamp:
Jun 5, 2008 11:56:28 AM (17 years ago)
Author:
vboxsync
Message:

use macros to access base, limit of a descriptor and offset of an IDT entry

Location:
trunk/include/VBox
Files:
2 edited

Legend:

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

    r9379 r9412  
    386386/** @} */
    387387
     388
     389/** @def VBOXIDTE_OFFSET
     390 * Return the offset of an IDT entry.
     391 */
     392#define VBOXIDTE_OFFSET(desc) \
     393        (  ((uint32_t)((desc).Gen.u16OffsetHigh) << 16) \
     394         | (           (desc).Gen.u16OffsetLow        ) )
    388395
    389396/** @defgroup grp_types_desc    Descriptor Table Entry.
  • trunk/include/VBox/x86.h

    r9069 r9412  
    18931893
    18941894
     1895/** @def X86DESC_BASE
     1896 * Return the base address of a descriptor.
     1897 */
     1898#define X86DESC_BASE(desc) \
     1899        (  ((uint32_t)((desc).Gen.u8BaseHigh2) << 24) \
     1900         | (           (desc).Gen.u8BaseHigh1  << 16) \
     1901         | (           (desc).Gen.u16BaseLow        ) )
     1902
     1903/** @def X86DESC_LIMIT
     1904 * Return the limit of a descriptor.
     1905 */
     1906#define X86DESC_LIMIT(desc) \
     1907        (  ((uint32_t)((desc).Gen.u4LimitHigh) << 16) \
     1908         | (           (desc).Gen.u16LimitLow       ) )
     1909
    18951910/**
    18961911 * 64 bits generic descriptor table entry
     
    20252040typedef X86DESC     *PX86DESCHC;
    20262041#endif
     2042
     2043/** @def X86DESC_LIMIT
     2044 * Return the base of a 64-bit descriptor.
     2045 */
     2046#define X86DESC64_BASE(desc) \
     2047        (  ((uint64_t)((desc).Gen.u32BaseHigh3) << 32) \
     2048         | ((uint32_t)((desc).Gen.u8BaseHigh2)  << 24) \
     2049         | (           (desc).Gen.u8BaseHigh1   << 16) \
     2050         | (           (desc).Gen.u16BaseLow         ) )
     2051
    20272052
    20282053/** @name Selector Descriptor Types.
Note: See TracChangeset for help on using the changeset viewer.

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