01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync/* $Id$ */
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync/** @file
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * IPRT R0 Testcase - Kernel thread, driver program.
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync */
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync/*
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * Copyright (C) 2015 Oracle Corporation
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync *
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * available from http://www.virtualbox.org. This file is free software;
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * you can redistribute it and/or modify it under the terms of the GNU
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * General Public License (GPL) as published by the Free Software
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync *
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * The contents of this file may alternatively be used under the terms
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * of the Common Development and Distribution License Version 1.0
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * VirtualBox OSE distribution, in which case the provisions of the
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * CDDL are applicable instead of those of the GPL.
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync *
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * You may elect to license modified versions of this file under the
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * terms and conditions of either the GPL or the CDDL or both.
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync */
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync/*******************************************************************************
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync* Header Files *
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync*******************************************************************************/
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#include <iprt/initterm.h>
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#include <iprt/err.h>
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#include <iprt/path.h>
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#include <iprt/param.h>
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#include <iprt/stream.h>
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#include <iprt/string.h>
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#include <iprt/test.h>
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#ifdef VBOX
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync# include <VBox/sup.h>
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync# include "tstRTR0Thread.h"
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#endif
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#include "tstRTR0CommonDriver.h"
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync/**
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * Entry point.
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync */
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsyncextern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp)
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync{
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#ifndef VBOX
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync RTPrintf("tstRTR0Thread: SKIPPED\n");
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync return RTEXITCODE_SKIPPED;
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#else
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync /*
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * Init.
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync */
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync RTEXITCODE rcExit = RTR3TestR0CommonDriverInit("tstRTR0Thread");
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync if (rcExit != RTEXITCODE_SUCCESS)
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync return rcExit;
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync RTR3TestR0SimpleTest(TSTRTR0THREAD_BASIC, "Basic");
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync /*
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * Done.
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync */
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync return RTTestSummaryAndDestroy(g_hTest);
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#endif
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync}
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#if !defined(VBOX_WITH_HARDENING) || !defined(RT_OS_WINDOWS)
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync/**
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync * Main entry point.
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync */
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsyncint main(int argc, char **argv, char **envp)
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync{
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync return TrustedMain(argc, argv, envp);
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync}
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync#endif
01bfc3834fc0d724e808adf928b2bfe541f9f211vboxsync