VirtualBox

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

Last change on this file since 6412 was 5999, checked in by vboxsync, 17 years ago

The Giant CDDL Dual-License Header Change.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 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-2007 innotek 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 (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * The contents of this file may alternatively be used under the terms
19 * of the Common Development and Distribution License Version 1.0
20 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21 * VirtualBox OSE distribution, in which case the provisions of the
22 * CDDL are applicable instead of those of the GPL.
23 *
24 * You may elect to license modified versions of this file under the
25 * terms and conditions of either the GPL or the CDDL or both.
26 */
27
28
29/*******************************************************************************
30* Header Files *
31*******************************************************************************/
32#include <VBox/sup.h>
33#include <VBox/err.h>
34#include <iprt/runtime.h>
35#include <iprt/stream.h>
36
37
38int main(int argc, char **argv)
39{
40 int rc;
41 RTR3Init(false);
42 rc = SUPInit();
43 if (VBOX_SUCCESS(rc))
44 {
45 SUPPAGINGMODE enmMode = SUPGetPagingMode();
46 switch (enmMode)
47 {
48 case SUPPAGINGMODE_INVALID:
49 RTPrintf("SUPPAGINGMODE_INVALID\n");
50 break;
51 case SUPPAGINGMODE_32_BIT:
52 RTPrintf("SUPPAGINGMODE_32_BIT\n");
53 break;
54 case SUPPAGINGMODE_32_BIT_GLOBAL:
55 RTPrintf("SUPPAGINGMODE_32_BIT_GLOBAL\n");
56 break;
57 case SUPPAGINGMODE_PAE:
58 RTPrintf("SUPPAGINGMODE_PAE\n");
59 break;
60 case SUPPAGINGMODE_PAE_GLOBAL:
61 RTPrintf("SUPPAGINGMODE_PAE_GLOBAL\n");
62 break;
63 case SUPPAGINGMODE_PAE_NX:
64 RTPrintf("SUPPAGINGMODE_PAE_NX\n");
65 break;
66 case SUPPAGINGMODE_PAE_GLOBAL_NX:
67 RTPrintf("SUPPAGINGMODE_PAE_GLOBAL_NX\n");
68 break;
69 case SUPPAGINGMODE_AMD64:
70 RTPrintf("SUPPAGINGMODE_AMD64\n");
71 break;
72 case SUPPAGINGMODE_AMD64_GLOBAL:
73 RTPrintf("SUPPAGINGMODE_AMD64_GLOBAL\n");
74 break;
75 case SUPPAGINGMODE_AMD64_NX:
76 RTPrintf("SUPPAGINGMODE_AMD64_NX\n");
77 break;
78 case SUPPAGINGMODE_AMD64_GLOBAL_NX:
79 RTPrintf("SUPPAGINGMODE_AMD64_GLOBAL_NX\n");
80 break;
81 default:
82 RTPrintf("Unknown mode %d\n", enmMode);
83 rc = VERR_INTERNAL_ERROR;
84 break;
85 }
86
87 int rc2 = SUPTerm();
88 RTPrintf("SUPTerm -> rc=%Vrc\n", rc2);
89 }
90 else
91 RTPrintf("SUPInit -> rc=%Vrc\n", rc);
92
93 return !VBOX_SUCCESS(rc);
94}
95
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