VirtualBox

Changeset 97624 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Nov 21, 2022 11:13:29 AM (2 years ago)
Author:
vboxsync
Message:

ValKit/bs3kit: Added Bs3SelSetupGate and Bs3SelSetupGate64 for setting up call gates and such. bugref:9898

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r97576 r97624  
    197197       bs3-cmn-SelSetup16BitCode.c \
    198198       bs3-cmn-SelSetup32BitCode.c \
     199       bs3-cmn-SelSetupGate.c \
     200       bs3-cmn-SelSetupGate64.c \
    199201       bs3-cmn-SlabInit.c \
    200202       bs3-cmn-SlabAlloc.c \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SelSetupGate.c

    r97598 r97624  
    11/* $Id$ */
    22/** @file
    3  * BS3Kit - Bs3Trap32SetGate
     3 * BS3Kit - Bs3SelSetupGate
    44 */
    55
     
    4242
    4343
    44 #undef Bs3Trap32SetGate
    45 BS3_CMN_DEF(void, Bs3Trap32SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint32_t off, uint8_t cParams))
     44#undef Bs3SelSetupGate
     45BS3_CMN_DEF(void, Bs3SelSetupGate,(X86DESC BS3_FAR *pDesc, uint8_t bType, uint8_t bDpl,
     46                                   uint16_t uSel, uint32_t off, uint8_t cParams))
    4647{
    47     X86DESC BS3_FAR *pIdte = &Bs3Idt32[iIdt];
    48 
    4948    BS3_ASSERT(bDpl <= 3);
    5049    BS3_ASSERT(bType <= 15);
    5150    BS3_ASSERT(cParams <= 15);
    52     pIdte->Gate.u16OffsetLow    = (uint16_t)off;
    53     pIdte->Gate.u16OffsetHigh   = (uint16_t)(off >> 16);
    54     pIdte->Gate.u16Sel          = uSel;
    55     pIdte->Gate.u5ParmCount     = cParams;
    56     pIdte->Gate.u4Type          = bType;
    57     pIdte->Gate.u2Dpl           = bDpl;
    58     pIdte->Gate.u3Reserved      = 0;
    59     pIdte->Gate.u1DescType      = 0; /* system */
    60     pIdte->Gate.u1Present       = 1;
     51    pDesc->Gate.u16OffsetLow    = (uint16_t)off;
     52    pDesc->Gate.u16OffsetHigh   = (uint16_t)(off >> 16);
     53    pDesc->Gate.u16Sel          = uSel;
     54    pDesc->Gate.u5ParmCount     = cParams;
     55    pDesc->Gate.u4Type          = bType;
     56    pDesc->Gate.u2Dpl           = bDpl;
     57    pDesc->Gate.u3Reserved      = 0;
     58    pDesc->Gate.u1DescType      = 0; /* system */
     59    pDesc->Gate.u1Present       = 1;
    6160}
    6261
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SelSetupGate64.c

    r97598 r97624  
    11/* $Id$ */
    22/** @file
    3  * BS3Kit - Bs3Trap32SetGate
     3 * BS3Kit - Bs3SelSetupGate64
    44 */
    55
     
    4242
    4343
    44 #undef Bs3Trap32SetGate
    45 BS3_CMN_DEF(void, Bs3Trap32SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint32_t off, uint8_t cParams))
     44#undef Bs3SelSetupGate64
     45BS3_CMN_DEF(void, Bs3SelSetupGate64,(X86DESC BS3_FAR *pDescPair, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint64_t off))
    4646{
    47     X86DESC BS3_FAR *pIdte = &Bs3Idt32[iIdt];
    48 
    4947    BS3_ASSERT(bDpl <= 3);
    5048    BS3_ASSERT(bType <= 15);
    51     BS3_ASSERT(cParams <= 15);
    52     pIdte->Gate.u16OffsetLow    = (uint16_t)off;
    53     pIdte->Gate.u16OffsetHigh   = (uint16_t)(off >> 16);
    54     pIdte->Gate.u16Sel          = uSel;
    55     pIdte->Gate.u5ParmCount     = cParams;
    56     pIdte->Gate.u4Type          = bType;
    57     pIdte->Gate.u2Dpl           = bDpl;
    58     pIdte->Gate.u3Reserved      = 0;
    59     pIdte->Gate.u1DescType      = 0; /* system */
    60     pIdte->Gate.u1Present       = 1;
     49    pDescPair[0].Gate.u16OffsetLow    = (uint16_t)off;
     50    pDescPair[0].Gate.u16OffsetHigh   = (uint16_t)(off >> 16);
     51    pDescPair[0].Gate.u16Sel          = uSel;
     52    pDescPair[0].Gate.u5ParmCount     = 0;
     53    pDescPair[0].Gate.u4Type          = bType;
     54    pDescPair[0].Gate.u2Dpl           = bDpl;
     55    pDescPair[0].Gate.u3Reserved      = 0;
     56    pDescPair[0].Gate.u1DescType      = 0; /* system */
     57    pDescPair[0].Gate.u1Present       = 1;
     58    pDescPair[1].au32[0]              = (uint32_t)(off >> 32);
     59    pDescPair[1].au32[1]              = 0;
    6160}
    6261
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk

    r97613 r97624  
    144144$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SelSetup16BitData)
    145145$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SelSetup32BitCode)
     146$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SelSetupGate64)
     147$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SelSetupGate)
    146148$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabInit)
    147149$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabListAdd)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r97613 r97624  
    174174#define Bs3SelSetup16BitData BS3_CMN_MANGLER(Bs3SelSetup16BitData)
    175175#define Bs3SelSetup32BitCode BS3_CMN_MANGLER(Bs3SelSetup32BitCode)
     176#define Bs3SelSetupGate64 BS3_CMN_MANGLER(Bs3SelSetupGate64)
     177#define Bs3SelSetupGate BS3_CMN_MANGLER(Bs3SelSetupGate)
    176178#define Bs3Shutdown BS3_CMN_MANGLER(Bs3Shutdown)
    177179#define Bs3SlabAlloc BS3_CMN_MANGLER(Bs3SlabAlloc)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r97613 r97624  
    174174#undef Bs3SelSetup16BitData
    175175#undef Bs3SelSetup32BitCode
     176#undef Bs3SelSetupGate64
     177#undef Bs3SelSetupGate
    176178#undef Bs3Shutdown
    177179#undef Bs3SlabAlloc
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r97613 r97624  
    19951995BS3_CMN_PROTO_STUB(void, Bs3SelSetup32BitCode,(X86DESC BS3_FAR *pDesc, uint32_t uBaseAddr, uint32_t uLimit, uint8_t bDpl));
    19961996
     1997/**
     1998 * Sets up a 16-bit or 32-bit gate descriptor.
     1999 *
     2000 * This can be used both for GDT/LDT and IDT.
     2001 *
     2002 * @param   pDesc       Pointer to the descriptor table entry.
     2003 * @param   bType       The gate type.
     2004 * @param   bDpl        The gate DPL.
     2005 * @param   uSel        The gate selector value.
     2006 * @param   off         The gate IP/EIP value.
     2007 * @param   cParams     Number of parameters to copy if call-gate.
     2008 */
     2009BS3_CMN_PROTO_STUB(void, Bs3SelSetupGate,(X86DESC BS3_FAR *pDesc, uint8_t bType, uint8_t bDpl,
     2010                                          uint16_t uSel, uint32_t off, uint8_t cParams));
     2011
     2012/**
     2013 * Sets up a 64-bit gate descriptor.
     2014 *
     2015 * This can be used both for GDT/LDT and IDT.
     2016 *
     2017 * @param   pDescPair   Pointer to the _two_ descriptor table entries.
     2018 * @param   bType       The gate type.
     2019 * @param   bDpl        The gate DPL.
     2020 * @param   uSel        The gate selector value.
     2021 * @param   off         The gate IP/EIP value.
     2022 */
     2023BS3_CMN_PROTO_STUB(void, Bs3SelSetupGate64,(X86DESC BS3_FAR *pDescPair, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint64_t off));
     2024
    19972025
    19982026/**
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