VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp@ 2471

Last change on this file since 2471 was 1, checked in by vboxsync, 55 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/** @file
2 *
3 * VBox host drivers - Ring-0 support drivers - Testcases:
4 * Test the interface for querying host paging mode
5 */
6
7/*
8 * Copyright (C) 2006 InnoTek Systemberatung GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * If you received this file as part of a commercial VirtualBox
19 * distribution, then only the terms of your commercial VirtualBox
20 * license agreement apply instead of the previous paragraph.
21 */
22
23
24/*******************************************************************************
25* Header Files *
26*******************************************************************************/
27#include <VBox/sup.h>
28#include <VBox/err.h>
29#include <iprt/runtime.h>
30#include <iprt/stream.h>
31
32
33int main(int argc, char **argv)
34{
35 int rc;
36 RTR3Init(false);
37 rc = SUPInit();
38 if (VBOX_SUCCESS(rc))
39 {
40 SUPPAGINGMODE enmMode = SUPGetPagingMode();
41 switch (enmMode)
42 {
43 case SUPPAGINGMODE_INVALID:
44 RTPrintf("SUPPAGINGMODE_INVALID\n");
45 break;
46 case SUPPAGINGMODE_32_BIT:
47 RTPrintf("SUPPAGINGMODE_32_BIT\n");
48 break;
49 case SUPPAGINGMODE_32_BIT_GLOBAL:
50 RTPrintf("SUPPAGINGMODE_32_BIT_GLOBAL\n");
51 break;
52 case SUPPAGINGMODE_PAE:
53 RTPrintf("SUPPAGINGMODE_PAE\n");
54 break;
55 case SUPPAGINGMODE_PAE_GLOBAL:
56 RTPrintf("SUPPAGINGMODE_PAE_GLOBAL\n");
57 break;
58 case SUPPAGINGMODE_PAE_NX:
59 RTPrintf("SUPPAGINGMODE_PAE_NX\n");
60 break;
61 case SUPPAGINGMODE_PAE_GLOBAL_NX:
62 RTPrintf("SUPPAGINGMODE_PAE_GLOBAL_NX\n");
63 break;
64 case SUPPAGINGMODE_AMD64:
65 RTPrintf("SUPPAGINGMODE_AMD64\n");
66 break;
67 case SUPPAGINGMODE_AMD64_GLOBAL:
68 RTPrintf("SUPPAGINGMODE_AMD64_GLOBAL\n");
69 break;
70 case SUPPAGINGMODE_AMD64_NX:
71 RTPrintf("SUPPAGINGMODE_AMD64_NX\n");
72 break;
73 case SUPPAGINGMODE_AMD64_GLOBAL_NX:
74 RTPrintf("SUPPAGINGMODE_AMD64_GLOBAL_NX\n");
75 break;
76 default:
77 RTPrintf("Unknown mode %d\n", enmMode);
78 rc = VERR_INTERNAL_ERROR;
79 break;
80 }
81
82 int rc2 = SUPTerm();
83 RTPrintf("SUPTerm -> rc=%Vrc\n", rc2);
84 }
85 else
86 RTPrintf("SUPInit -> rc=%Vrc\n", rc);
87
88 return !VBOX_SUCCESS(rc);
89}
90
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