VirtualBox

Ignore:
Timestamp:
Apr 12, 2024 3:18:43 PM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162799
Message:

VMM/IEM: Have a single TB prologue which serves as an entry point to the TB, bugref:10653

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veHlpA-arm64.S

    r104230 r104322  
    3232#include <iprt/asmdefs-arm.h>
    3333
     34#ifdef AssertCompile
     35# undef AssertCompile
     36#endif
     37#define AssertCompile(a_Expr)
     38#define INCLUDED_FROM_ARM64_ASSEMBLY
     39#include "IEMN8veRecompiler.h"
     40
     41#define IEM_HLP_FUNCTION_ALIGNMENT 0x20
    3442
    3543BEGINCODE
    3644
    3745.extern NAME(iemThreadedFunc_BltIn_LogCpuStateWorker)
     46
     47#ifdef IEMNATIVE_WITH_RECOMPILER_PROLOGUE_SINGLETON
     48/**
     49 * This is the common prologue of a TB, saving all volatile registers
     50 * and creating the stack frame for saving temporary values.
     51 *
     52 * @param    pVCpu    (x0)      The cross-context vCPU structure pointer.
     53 * @param    pCpumCtx (x1)      The cross-context CPUM context structure pointer.
     54 * @param    pTbStart (x2)      The TB instruction start pointer.
     55 */
     56ALIGNCODE(IEM_HLP_FUNCTION_ALIGNMENT)
     57BEGINPROC_HIDDEN iemNativeTbEntry
     58# ifdef RT_OS_DARWIN
     59        pacibsp
     60# endif
     61        stp     x19, x20, [sp, #-IEMNATIVE_FRAME_SAVE_REG_SIZE]! /* Allocate space for saving registers and place x19+x20 at the bottom. */
     62        stp     x21, x22, [sp, #0x10]                            /* Save x21 thru x28 (SP remains unchanged). */
     63        stp     x23, x24, [sp, #0x20]
     64        stp     x25, x26, [sp, #0x30]
     65        stp     x27, x28, [sp, #0x40]
     66        stp     x29, x30, [sp, #0x50]                            /* Save the BP and LR (ret address) registers at the top of the frame. */
     67        add     x29, sp, #(IEMNATIVE_FRAME_SAVE_REG_SIZE - 16)   /* Set BP to point to the old BP stack address */
     68        sub     sp, sp, #IEMNATIVE_FRAME_VAR_SIZE                /* Allocate the variable area from SP. */
     69        mov     IEMNATIVE_REG_FIXED_PVMCPU_ASM,   x0
     70        mov     IEMNATIVE_REG_FIXED_PCPUMCTX_ASM, x1
     71# ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER_LONGJMP
     72        str     x29, [IEMNATIVE_REG_FIXED_PVMCPU_ASM, #0x7c8]    /* Save the frame pointer to pvTbFramePointerR3 */ /** @todo Get rid of this hardcoded assumption */
     73# endif
     74        /*
     75         * Everything is done, jump to the start of the TB.
     76         */
     77        br      x2
     78#endif
     79
    3880
    3981/**
     
    5395 *       it ourselves, I think.
    5496 */
     97ALIGNCODE(IEM_HLP_FUNCTION_ALIGNMENT)
    5598BEGINPROC_HIDDEN iemNativeTbLongJmp
    5699        /*
     
    81124 * so the impact of inserting LogCpuState is minimal to the other TB code.
    82125 */
     126ALIGNCODE(IEM_HLP_FUNCTION_ALIGNMENT)
    83127BEGINPROC_HIDDEN iemNativeHlpAsmSafeWrapLogCpuState
    84128#ifdef RT_OS_DARWIN
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