VirtualBox

Changeset 9411 in vbox for trunk/include/VBox


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

Use a union for esp & rsp, so they are in-sync.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

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

    r9354 r9411  
    117117        uint64_t        rcx;
    118118    };
    119     /* Note: we rely on the exact layout, because we use lss esp, [] in the switcher */
    120     uint32_t        esp;
    121     RTSEL           ss;
    122     RTSEL           ssPadding;
    123     /* Note: no overlap with esp here. */
    124     uint64_t        rsp;
    125 
    126     RTSEL           gs;
    127     RTSEL           gsPadding;
    128     RTSEL           fs;
    129     RTSEL           fsPadding;
    130     RTSEL           es;
    131     RTSEL           esPadding;
    132     RTSEL           ds;
    133     RTSEL           dsPadding;
    134     RTSEL           cs;
    135     RTSEL           csPadding[3];  /* 3 words to force 8 byte alignment for the remainder */
     119    union
     120    {
     121        uint32_t        esp;
     122        uint64_t        rsp;
     123    };
     124    /* Note: lss esp, [] in the switcher needs some space, so we reserve it here instead of relying on the exact esp & ss layout as before. */
     125    uint32_t            lss_esp;
     126    RTSEL               ss;
     127    RTSEL               ssPadding;
     128
     129    RTSEL               gs;
     130    RTSEL               gsPadding;
     131    RTSEL               fs;
     132    RTSEL               fsPadding;
     133    RTSEL               es;
     134    RTSEL               esPadding;
     135    RTSEL               ds;
     136    RTSEL               dsPadding;
     137    RTSEL               cs;
     138    RTSEL               csPadding[3];  /* 3 words to force 8 byte alignment for the remainder */
    136139
    137140    union
     
    217220        uint64_t        rcx;
    218221    };
    219     /* Note: we rely on the exact layout, because we use lss esp, [] in the switcher */
    220     uint32_t        esp;
    221     RTSEL           ss;
    222     RTSEL           ssPadding;
    223     /* Note: no overlap with esp here. */
    224     uint64_t        rsp;
    225 
    226     RTSEL           gs;
    227     RTSEL           gsPadding;
    228     RTSEL           fs;
    229     RTSEL           fsPadding;
    230     RTSEL           es;
    231     RTSEL           esPadding;
    232     RTSEL           ds;
    233     RTSEL           dsPadding;
    234     RTSEL           cs;
    235     RTSEL           csPadding[3];  /* 3 words to force 8 byte alignment for the remainder */
     222    union
     223    {
     224        uint32_t        esp;
     225        uint64_t        rsp;
     226    };
     227    /* Note: lss esp, [] in the switcher needs some space, so we reserve it here instead of relying on the exact esp & ss layout as before (prevented us from using a union with rsp). */
     228    uint32_t            lss_esp;
     229    RTSEL               ss;
     230    RTSEL               ssPadding;
     231
     232    RTSEL               gs;
     233    RTSEL               gsPadding;
     234    RTSEL               fs;
     235    RTSEL               fsPadding;
     236    RTSEL               es;
     237    RTSEL               esPadding;
     238    RTSEL               ds;
     239    RTSEL               dsPadding;
     240    RTSEL               cs;
     241    RTSEL               csPadding[3];  /* 3 words to force 8 byte alignment for the remainder */
    236242
    237243    union
  • trunk/include/VBox/cpum.mac

    r8155 r9411  
    4545    .edx            resq    1
    4646    .ecx            resq    1
    47     .esp            resd    1
     47    .esp            resq    1
     48    .lss_esp        resd    1
    4849    .ss             resw    1
    4950    .ssPadding      resw    1
    50     .rsp            resq    1
    5151    .gs             resw    1
    5252    .gsPadding      resw    1
     
    108108    .edx            resq    1
    109109    .ecx            resq    1
    110     .esp            resd    1
     110    .esp            resq    1
     111    .lss_esp        resd    1
    111112    .ss             resw    1
    112113    .ssPadding      resw    1
    113     .rsp            resq    1
    114114    .gs             resw    1
    115115    .gsPadding      resw    1
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