VirtualBox

Ignore:
Timestamp:
Aug 3, 2023 1:15:55 AM (22 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158666
Message:

bs3kit,bs3-timers-1: Extended the bs3-timers-1 testcase to check for interrupt delivery and inhibiting. bugref:10369

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PitIrqHandler.c

    r98103 r100782  
    4747*********************************************************************************************************************************/
    4848#if ARCH_BITS == 16
     49/** The RIP/EIP value of where the PIT IRQ handle will return to. */
     50BS3REG volatile     g_Bs3PitIrqRip;
    4951/** Nano seconds (approx) since last the PIT timer was started. */
    5052uint64_t volatile   g_cBs3PitNs    = 0;
     
    7072        g_cBs3PitNs += g_cBs3PitIntervalNs;
    7173        g_cBs3PitTicks++;
     74        g_Bs3PitIrqRip.u = pTrapFrame->Ctx.rip.u;
    7275    }
    7376    NOREF(pTrapFrame);
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-pit.c

    r98103 r100782  
    7575
    7676    /*
    77      * Reset the counters.
     77     * Reset the counters and IRQ PC.
    7878     */
    7979    g_cBs3PitNs         = 0;
    8080    g_cBs3PitMs         = 0;
    8181    g_cBs3PitTicks      = 0;
     82    g_Bs3PitIrqRip.u    = 0;
    8283
    8384    /*
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r98103 r100782  
    25162516BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3PagingSetupCanonicalTraps,(void));
    25172517
    2518 /**
    2519  * Waits for the keyboard controller to become ready.
    2520  */
    2521 BS3_CMN_PROTO_NOSB(void, Bs3KbdWait,(void));
    2522 
    2523 /**
    2524  * Sends a read command to the keyboard controller and gets the result.
    2525  *
    2526  * The caller is responsible for making sure the keyboard controller is ready
    2527  * for a command (call #Bs3KbdWait if unsure).
    2528  *
    2529  * @returns The value read is returned (in al).
    2530  * @param   bCmd            The read command.
    2531  */
    2532 BS3_CMN_PROTO_NOSB(uint8_t, Bs3KbdRead,(uint8_t bCmd));
    2533 
    2534 /**
    2535  * Sends a write command to the keyboard controller and then sends the data.
    2536  *
    2537  * The caller is responsible for making sure the keyboard controller is ready
    2538  * for a command (call #Bs3KbdWait if unsure).
    2539  *
    2540  * @param   bCmd           The write command.
    2541  * @param   bData          The data to write.
    2542  */
    2543 BS3_CMN_PROTO_NOSB(void, Bs3KbdWrite,(uint8_t bCmd, uint8_t bData));
    2544 
    2545 
    2546 /**
    2547  * Configures the PIC, once only.
    2548  *
    2549  * Subsequent calls to this function will not do anything.
    2550  *
    2551  * The PIC will be programmed to use IDT/IVT vectors 0x70 thru 0x7f, auto
    2552  * end-of-interrupt, and all IRQs masked.  The individual PIC users will have to
    2553  * use #Bs3PicUpdateMask unmask their IRQ once they've got all the handlers
    2554  * installed.
    2555  *
    2556  * @param   fForcedReInit   Force a reinitialization.
    2557  */
    2558 BS3_CMN_PROTO_STUB(void, Bs3PicSetup,(bool fForcedReInit));
    2559 
    2560 /**
    2561  * Updates the PIC masks.
    2562  *
    2563  * @returns The new mask - master in low, slave in high byte.
    2564  * @param   fAndMask    Things to keep as-is. Master in low, slave in high byte.
    2565  * @param   fOrMask     Things to start masking. Ditto wrt bytes.
    2566  */
    2567 BS3_CMN_PROTO_STUB(uint16_t, Bs3PicUpdateMask,(uint16_t fAndMask, uint16_t fOrMask));
    2568 
    2569 /**
    2570  * Disables all IRQs on the PIC.
    2571  */
    2572 BS3_CMN_PROTO_STUB(void, Bs3PicMaskAll,(void));
    2573 
    2574 
    2575 /**
    2576  * Sets up the PIT for periodic callback.
    2577  *
    2578  * @param   cHzDesired      The desired Hz.  Zero means max interval length
    2579  *                          (18.2Hz).  Plase check the various PIT globals for
    2580  *                          the actual interval length.
    2581  */
    2582 BS3_CMN_PROTO_STUB(void, Bs3PitSetupAndEnablePeriodTimer,(uint16_t cHzDesired));
    2583 
    2584 /**
    2585  * Disables the PIT if active.
    2586  */
    2587 BS3_CMN_PROTO_STUB(void, Bs3PitDisable,(void));
    2588 
    2589 /** Nanoseconds (approx) since last the PIT timer was started. */
    2590 extern uint64_t volatile    g_cBs3PitNs;
    2591 /** Milliseconds seconds (very approx) since last the PIT timer was started. */
    2592 extern uint64_t volatile    g_cBs3PitMs;
    2593 /** Number of ticks since last the PIT timer was started.  */
    2594 extern uint32_t volatile    g_cBs3PitTicks;
    2595 /** The current interval in nanoseconds.
    2596  * This is 0 if not yet started (cleared by Bs3PitDisable). */
    2597 extern uint32_t             g_cBs3PitIntervalNs;
    2598 /** The current interval in milliseconds (approximately).
    2599  * This is 0 if not yet started (cleared by Bs3PitDisable). */
    2600 extern uint16_t             g_cBs3PitIntervalMs;
    2601 /** The current PIT frequency (approximately).
    2602  * 0 if not yet started (cleared by Bs3PitDisable; used for checking the
    2603  * state internally). */
    2604 extern uint16_t volatile    g_cBs3PitIntervalHz;
    2605 
    26062518
    26072519/**
     
    45044416
    45054417
     4418/** @defgroup grp_bs3kit_kbd    Keyboard
     4419 * @{
     4420 */
     4421
     4422/**
     4423 * Waits for the keyboard controller to become ready.
     4424 */
     4425BS3_CMN_PROTO_NOSB(void, Bs3KbdWait,(void));
     4426
     4427/**
     4428 * Sends a read command to the keyboard controller and gets the result.
     4429 *
     4430 * The caller is responsible for making sure the keyboard controller is ready
     4431 * for a command (call #Bs3KbdWait if unsure).
     4432 *
     4433 * @returns The value read is returned (in al).
     4434 * @param   bCmd            The read command.
     4435 */
     4436BS3_CMN_PROTO_NOSB(uint8_t, Bs3KbdRead,(uint8_t bCmd));
     4437
     4438/**
     4439 * Sends a write command to the keyboard controller and then sends the data.
     4440 *
     4441 * The caller is responsible for making sure the keyboard controller is ready
     4442 * for a command (call #Bs3KbdWait if unsure).
     4443 *
     4444 * @param   bCmd           The write command.
     4445 * @param   bData          The data to write.
     4446 */
     4447BS3_CMN_PROTO_NOSB(void, Bs3KbdWrite,(uint8_t bCmd, uint8_t bData));
     4448
     4449/** @} */
     4450
     4451
     4452/** @defgroup grp_bs3kit_pic    PIC
     4453 * @{
     4454 */
     4455
     4456/**
     4457 * Configures the PIC, once only.
     4458 *
     4459 * Subsequent calls to this function will not do anything.
     4460 *
     4461 * The PIC will be programmed to use IDT/IVT vectors 0x70 thru 0x7f, auto
     4462 * end-of-interrupt, and all IRQs masked.  The individual PIC users will have to
     4463 * use #Bs3PicUpdateMask unmask their IRQ once they've got all the handlers
     4464 * installed.
     4465 *
     4466 * @param   fForcedReInit   Force a reinitialization.
     4467 */
     4468BS3_CMN_PROTO_STUB(void, Bs3PicSetup,(bool fForcedReInit));
     4469
     4470/**
     4471 * Updates the PIC masks.
     4472 *
     4473 * @returns The new mask - master in low, slave in high byte.
     4474 * @param   fAndMask    Things to keep as-is. Master in low, slave in high byte.
     4475 * @param   fOrMask     Things to start masking. Ditto wrt bytes.
     4476 */
     4477BS3_CMN_PROTO_STUB(uint16_t, Bs3PicUpdateMask,(uint16_t fAndMask, uint16_t fOrMask));
     4478
     4479/**
     4480 * Disables all IRQs on the PIC.
     4481 */
     4482BS3_CMN_PROTO_STUB(void, Bs3PicMaskAll,(void));
     4483
     4484/** @} */
     4485
     4486
     4487/** @defgroup grp_bs3kit_pit    PIT
     4488 * @{
     4489 */
     4490
     4491/**
     4492 * Sets up the PIT for periodic callback.
     4493 *
     4494 * @param   cHzDesired      The desired Hz.  Zero means max interval length
     4495 *                          (18.2Hz).  Plase check the various PIT globals for
     4496 *                          the actual interval length.
     4497 */
     4498BS3_CMN_PROTO_STUB(void, Bs3PitSetupAndEnablePeriodTimer,(uint16_t cHzDesired));
     4499
     4500/**
     4501 * Disables the PIT if active.
     4502 */
     4503BS3_CMN_PROTO_STUB(void, Bs3PitDisable,(void));
     4504
     4505/** The RIP/EIP value of where the PIT IRQ handle will return to. */
     4506extern BS3REG volatile      g_Bs3PitIrqRip;
     4507/** Nanoseconds (approx) since last the PIT timer was started. */
     4508extern uint64_t volatile    g_cBs3PitNs;
     4509/** Milliseconds seconds (very approx) since last the PIT timer was started. */
     4510extern uint64_t volatile    g_cBs3PitMs;
     4511/** Number of ticks since last the PIT timer was started.  */
     4512extern uint32_t volatile    g_cBs3PitTicks;
     4513/** The current interval in nanoseconds.
     4514 * This is 0 if not yet started (cleared by Bs3PitDisable). */
     4515extern uint32_t             g_cBs3PitIntervalNs;
     4516/** The current interval in milliseconds (approximately).
     4517 * This is 0 if not yet started (cleared by Bs3PitDisable). */
     4518extern uint16_t             g_cBs3PitIntervalMs;
     4519/** The current PIT frequency (approximately).
     4520 * 0 if not yet started (cleared by Bs3PitDisable; used for checking the
     4521 * state internally). */
     4522extern uint16_t volatile    g_cBs3PitIntervalHz;
     4523
     4524/** @} */
     4525
     4526
    45064527/** @} */
    45074528
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