assert-r0drv-haiku.c revision 62b8247e4970b835e263b4c18a2748bf651fabd0
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync/* $Id$ */
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync/** @file
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * IPRT - Assertion Workers, Ring-0 Drivers, Haiku.
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync */
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync/*
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * Copyright (C) 2012 Oracle Corporation
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync *
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * available from http://www.virtualbox.org. This file is free software;
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * you can redistribute it and/or modify it under the terms of the GNU
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * General Public License (GPL) as published by the Free Software
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync *
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * The contents of this file may alternatively be used under the terms
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * of the Common Development and Distribution License Version 1.0
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * VirtualBox OSE distribution, in which case the provisions of the
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * CDDL are applicable instead of those of the GPL.
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync *
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * You may elect to license modified versions of this file under the
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync * terms and conditions of either the GPL or the CDDL or both.
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync */
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync/*******************************************************************************
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync* Header Files *
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync*******************************************************************************/
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync#include "the-haiku-kernel.h"
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync#include "internal/iprt.h"
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync#include <iprt/assert.h>
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync#include <iprt/asm.h>
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync#include <iprt/log.h>
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync#include <iprt/stdarg.h>
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync#include <iprt/string.h>
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync#include "internal/assert.h"
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsyncvoid rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync{
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync dprintf("\r\n!!Assertion Failed!!\r\n"
d85b0881fbf23d90ba93e32becf11d87dbc3f9dbvboxsync "Expression: %s\r\n"
d85b0881fbf23d90ba93e32becf11d87dbc3f9dbvboxsync "Location : %s(%d) %s\r\n",
d85b0881fbf23d90ba93e32becf11d87dbc3f9dbvboxsync pszExpr, pszFile, uLine, pszFunction);
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync}
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsyncvoid rtR0AssertNativeMsg2V(bool fInitial, const char *pszFormat, va_list va)
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync{
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync char szMsg[256];
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync szMsg[sizeof(szMsg) - 1] = '\0';
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync dprintf("%s", szMsg);
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync NOREF(fInitial);
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync}
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsyncRTR0DECL(void) RTR0AssertPanicSystem(void)
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync{
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync panic("%s%s", g_szRTAssertMsg1, g_szRTAssertMsg2);
9fc464631dc4a68fbb5eb6419d61fbe91b6b16bdvboxsync}
62b8247e4970b835e263b4c18a2748bf651fabd0vboxsync