VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3-timers-1-asm.asm@ 105845

Last change on this file since 105845 was 100782, checked in by vboxsync, 16 months ago

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

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1; $Id: bs3-timers-1-asm.asm 100782 2023-08-03 01:15:55Z vboxsync $
2;; @file
3; BS3Kit - bs3-timers-1
4;
5
6;
7; Copyright (C) 2007-2023 Oracle and/or its affiliates.
8;
9; This file is part of VirtualBox base platform packages, as
10; available from https://www.virtualbox.org.
11;
12; This program is free software; you can redistribute it and/or
13; modify it under the terms of the GNU General Public License
14; as published by the Free Software Foundation, in version 3 of the
15; License.
16;
17; This program is distributed in the hope that it will be useful, but
18; WITHOUT ANY WARRANTY; without even the implied warranty of
19; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20; General Public License for more details.
21;
22; You should have received a copy of the GNU General Public License
23; along with this program; if not, see <https://www.gnu.org/licenses>.
24;
25; The contents of this file may alternatively be used under the terms
26; of the Common Development and Distribution License Version 1.0
27; (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
28; in the VirtualBox distribution, in which case the provisions of the
29; CDDL are applicable instead of those of the GPL.
30;
31; You may elect to license modified versions of this file under the
32; terms and conditions of either the GPL or the CDDL or both.
33;
34; SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
35;
36
37
38;*********************************************************************************************************************************
39;* Header Files *
40;*********************************************************************************************************************************
41%include "bs3kit.mac"
42
43
44BS3_BEGIN_X0TEXT16
45
46BS3_PROC_BEGIN NAME(bs3Timers1StiHltCli)
47 ;
48 ; Assuming interrupts are disabled on entry, the STI instruction should
49 ; inhibit interrupts till after HLT, but they should be delivered before
50 ; CLI is executed and takes effect.
51 ;
52 sti
53 hlt
54 ; Interrupts should be delivered here.
55BS3_GLOBAL_NAME_EX NAME(bs3Timers1StiHltCli_IrqPc), function, 1
56 cli
57
58 ret
59BS3_PROC_END NAME(bs3Timers1StiHltCli)
60
61
62BS3_PROC_BEGIN NAME(bs3Timers1StiStiCli)
63 ;
64 ; Assuming interrupts are disabled on entry, the first STI instruction
65 ; should inhibit interrupts, whereas the next should not since interrupts
66 ; are enabled now, so interrupts should be delivered after the 2nd STI and
67 ; before the CLI is executed and takes effect.
68 ;
69 sti
70 sti
71 ; Interrupts should be delivered here.
72BS3_GLOBAL_NAME_EX NAME(bs3Timers1StiStiCli_IrqPc), function, 1
73 cli
74
75 ret
76BS3_PROC_END NAME(bs3Timers1StiStiCli)
77
78
79BS3_PROC_BEGIN NAME(bs3Timers1PopfCli)
80 ;
81 ; Assuming interrupts are disabled on entry, the POPF instruction should
82 ; enable interrupts with immediate effect, so they should be delivered
83 ; before the CLI is executed and takes effect.
84 ;
85 push xAX
86
87 xPUSHF
88 pop xAX
89 or xAX, X86_EFL_IF
90 push xAX
91 xPOPF
92 ; Interrupts should be delivered here.
93BS3_GLOBAL_NAME_EX NAME(bs3Timers1PopfCli_IrqPc), function, 1
94 cli
95
96 pop xAX
97 ret
98BS3_PROC_END NAME(bs3Timers1PopfCli)
99
100
101BS3_PROC_BEGIN NAME(bs3Timers1StiCli)
102 ;
103 ; Assuming interrupts are disabled on entry, the STI instruction should
104 ; inhibit interrupts for one instruction, when that instruction is CLI
105 ; no interrupt can be delivered.
106 ;
107 ; This is a negative test.
108 ;
109 sti
110 cli
111
112 ret
113BS3_PROC_END NAME(bs3Timers1StiCli)
114
115
116BS3_PROC_BEGIN NAME(bs3Timers1StiPopf)
117 ;
118 ; Assuming interrupts are disabled on entry, the STI instruction should
119 ; inhibit interrupts for one instruction, when that instruction is a
120 ; POPF loading EFLAGS with IF=0 no interrupt can be delivered.
121 ;
122 ; This is a negative test.
123 ;
124 push xAX
125
126 pushf ; save eflags with IF=0
127 sti ; set IF=1
128 popf ; load eflags setting IF=0
129
130 pop xAX
131 ret
132BS3_PROC_END NAME(bs3Timers1StiPopf)
133
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette