VirtualBox

Changeset 105443 in vbox for trunk/include/iprt/armv8.h


Ignore:
Timestamp:
Jul 23, 2024 11:24:56 AM (4 months ago)
Author:
vboxsync
Message:

iprt/armv8.h: DMB, DSB, ISB, SSBB & PSSBB. (Only DMB has been tested.) bugref:10727

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/armv8.h

    r105441 r105443  
    24862486
    24872487
     2488/** Memory barrier: Shareability domain. */
     2489typedef enum
     2490{
     2491    kArm64InstMbReqDomain_OuterShareable = 0,
     2492    kArm64InstMbReqDomain_Nonshareable,
     2493    kArm64InstMbReqDomain_InnerShareable,
     2494    kArm64InstMbReqDomain_FullSystem
     2495} ARM64INSTRMBREQDOMAIN;
     2496
     2497/** Memory barrier: Access type. */
     2498typedef enum
     2499{
     2500    kArm64InstMbReqType_All0 = 0,   /**< Special. Only used with PSSBB and SSBB. */
     2501    kArm64InstMbReqType_Reads,
     2502    kArm64InstMbReqType_Writes,
     2503    kArm64InstMbReqType_All
     2504} ARM64INSTRMBREQTYPE;
     2505
     2506/**
     2507 * A64: DMB option
     2508 */
     2509DECL_FORCE_INLINE(uint32_t) Armv8A64MkInstrDmb(ARM64INSTRMBREQDOMAIN enmDomain = kArm64InstMbReqDomain_FullSystem,
     2510                                               ARM64INSTRMBREQTYPE enmType = kArm64InstMbReqType_All)
     2511{
     2512    return UINT32_C(0xd50330bf)
     2513         | ((uint32_t)enmDomain << 8)
     2514         | ((uint32_t)enmType   << 10);
     2515}
     2516
     2517
     2518/**
     2519 * A64: DSB option
     2520 */
     2521DECL_FORCE_INLINE(uint32_t) Armv8A64MkInstrDsb(ARM64INSTRMBREQDOMAIN enmDomain = kArm64InstMbReqDomain_FullSystem,
     2522                                               ARM64INSTRMBREQTYPE enmType = kArm64InstMbReqType_All)
     2523{
     2524    return UINT32_C(0xd503309f)
     2525         | ((uint32_t)enmDomain << 8)
     2526         | ((uint32_t)enmType   << 10);
     2527}
     2528
     2529
     2530/**
     2531 * A64: SSBB
     2532 */
     2533DECL_FORCE_INLINE(uint32_t) Armv8A64MkInstrSsbb(void)
     2534{
     2535    return Armv8A64MkInstrDsb(kArm64InstMbReqDomain_OuterShareable, kArm64InstMbReqType_All0);
     2536}
     2537
     2538
     2539/**
     2540 * A64: PSSBB
     2541 */
     2542DECL_FORCE_INLINE(uint32_t) Armv8A64MkInstrPSsbb(void)
     2543{
     2544    return Armv8A64MkInstrDsb(kArm64InstMbReqDomain_Nonshareable, kArm64InstMbReqType_All0);
     2545}
     2546
     2547
     2548/**
     2549 * A64: ISB option
     2550 *
     2551 * @note Only the default option selection is supported, all others are
     2552 *       currently reserved.
     2553 */
     2554DECL_FORCE_INLINE(uint32_t) Armv8A64MkInstrIsb(ARM64INSTRMBREQDOMAIN enmDomain = kArm64InstMbReqDomain_FullSystem,
     2555                                               ARM64INSTRMBREQTYPE enmType = kArm64InstMbReqType_All)
     2556{
     2557    return UINT32_C(0xd50330df)
     2558         | ((uint32_t)enmDomain << 8)
     2559         | ((uint32_t)enmType   << 10);
     2560}
     2561
     2562
    24882563typedef enum
    24892564{
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