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