1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync/* $Id$ */
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync/** @file
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * IPRT - Assertion Workers, Ring-0 Drivers, FreeBSD.
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync */
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync/*
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync *
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * Permission is hereby granted, free of charge, to any person
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * obtaining a copy of this software and associated documentation
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * files (the "Software"), to deal in the Software without
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * restriction, including without limitation the rights to use,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * copy, modify, merge, publish, distribute, sublicense, and/or sell
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * copies of the Software, and to permit persons to whom the
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * Software is furnished to do so, subject to the following
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * conditions:
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync *
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * The above copyright notice and this permission notice shall be
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * included in all copies or substantial portions of the Software.
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync *
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * OTHER DEALINGS IN THE SOFTWARE.
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync */
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync/*******************************************************************************
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync* Header Files *
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync*******************************************************************************/
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#include "the-freebsd-kernel.h"
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#include <iprt/assert.h>
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#include <iprt/log.h>
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#include <iprt/string.h>
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync#include <iprt/stdarg.h>
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync#include "internal/assert.h"
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncDECLHIDDEN(void) rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync{
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync printf("\r\n!!Assertion Failed!!\r\n"
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync "Expression: %s\r\n"
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync "Location : %s(%d) %s\r\n",
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync pszExpr, pszFile, uLine, pszFunction);
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync}
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncDECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, const char *pszFormat, va_list va)
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync{
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync char szMsg[256];
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
fb98ad2c5db683e0704e0cba88f305e95dc1b73avboxsync RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync szMsg[sizeof(szMsg) - 1] = '\0';
fb98ad2c5db683e0704e0cba88f305e95dc1b73avboxsync printf("%s", szMsg);
0e5731ab59b4ecead38375f26eeea698f00b19fdvboxsync
0e5731ab59b4ecead38375f26eeea698f00b19fdvboxsync NOREF(fInitial);
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync}
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync
88774d64402bfd32254fcc5a81bda121c68300e6vboxsync
88774d64402bfd32254fcc5a81bda121c68300e6vboxsyncRTR0DECL(void) RTR0AssertPanicSystem(void)
88774d64402bfd32254fcc5a81bda121c68300e6vboxsync{
88774d64402bfd32254fcc5a81bda121c68300e6vboxsync /** @todo implement RTR0AssertPanicSystem. */
88774d64402bfd32254fcc5a81bda121c68300e6vboxsync}
88774d64402bfd32254fcc5a81bda121c68300e6vboxsync