ReactOS 0.4.15-dev-8102-g108db8f
KeFloatPointState.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Kernel mode tests for Save/Restore FPU state API kernel support
5 * COPYRIGHT: Copyright 2022 George Bișoc <george.bisoc@reactos.org>
6 */
7
8#include <kmt_test.h>
9
10START_TEST(KeFloatPointState)
11{
13 KFLOATING_SAVE FloatSave;
14 KIRQL Irql;
15
16 /* Save the state under normal conditions */
17 Status = KeSaveFloatingPointState(&FloatSave);
18 ok_irql(PASSIVE_LEVEL);
20
21 /* Restore the FPU state back */
23
24 /* Try to raise the IRQL to APC and do some operations again */
26
27 /* Save the state under APC_LEVEL interrupt */
28 Status = KeSaveFloatingPointState(&FloatSave);
29 ok_irql(APC_LEVEL);
31
32 /* Restore the FPU state back */
34
35 /* Try to raise the IRQL to dispatch this time */
38
39 /* Save the state under DISPATCH_LEVEL interrupt */
40 Status = KeSaveFloatingPointState(&FloatSave);
41 ok_irql(DISPATCH_LEVEL);
43
44 /* We're done */
47}
#define ok_eq_hex(value, expected)
Definition: apitest.h:77
#define START_TEST(x)
Definition: atltest.h:75
LONG NTSTATUS
Definition: precomp.h:26
_Out_ PKIRQL Irql
Definition: csq.h:179
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
Status
Definition: gdiplustypes.h:25
#define KeSaveFloatingPointState(x)
Definition: kmixer.h:32
#define KeRestoreFloatingPointState(x)
Definition: kmixer.h:33
#define STATUS_SUCCESS
Definition: shellext.h:65