assert-r0drv-linux.c revision 6fffd38c4ef918b4aaa702d0768422e0be119ba7
1N/A/* $Id$ */
1N/A/** @file
1N/A * IPRT - Assertion Workers, Ring-0 Drivers, Linux.
1N/A */
1N/A
1N/A/*
1N/A * Copyright (C) 2007 Sun Microsystems, Inc.
1N/A *
1N/A * This file is part of VirtualBox Open Source Edition (OSE), as
1N/A * available from http://www.virtualbox.org. This file is free software;
1N/A * you can redistribute it and/or modify it under the terms of the GNU
1N/A * General Public License (GPL) as published by the Free Software
1N/A * Foundation, in version 2 as it comes in the "COPYING" file of the
1N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1N/A *
1N/A * The contents of this file may alternatively be used under the terms
1N/A * of the Common Development and Distribution License Version 1.0
1N/A * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
1N/A * VirtualBox OSE distribution, in which case the provisions of the
1N/A * CDDL are applicable instead of those of the GPL.
1N/A *
1N/A * You may elect to license modified versions of this file under the
1N/A * terms and conditions of either the GPL or the CDDL or both.
1N/A *
1N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
1N/A * Clara, CA 95054 USA or visit http://www.sun.com if you need
1N/A * additional information or have any questions.
1N/A */
1N/A
1N/A
1N/A/*******************************************************************************
1N/A* Header Files *
1N/A*******************************************************************************/
1N/A#include "the-linux-kernel.h"
1N/A#include "internal/iprt.h"
1N/A
1N/A#include <iprt/assert.h>
1N/A#include <iprt/log.h>
1N/A#include <iprt/string.h>
1N/A#include <iprt/stdarg.h>
1N/A#include <iprt/asm.h>
1N/A
1N/A#include "internal/assert.h"
1N/A
1N/A
1N/Avoid rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
1N/A{
1N/A printk(KERN_EMERG
1N/A "\r\n!!Assertion Failed!!\r\n"
1N/A "Expression: %s\r\n"
1N/A "Location : %s(%d) %s\r\n",
1N/A pszExpr, pszFile, uLine, pszFunction);
1N/A}
1N/A
1N/A
1N/Avoid rtR0AssertNativeMsg2V(bool fInitial, const char *pszFormat, va_list va)
1N/A{
1N/A char szMsg[256];
1N/A
1N/A RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
1N/A szMsg[sizeof(szMsg) - 1] = '\0';
1N/A printk(KERN_EMERG "%s", szMsg);
1N/A
1N/A NOREF(fInitial);
1N/A}
1N/A
1N/A
1N/ARTR0DECL(void) RTR0AssertPanicSystem(void)
1N/A{
1N/A panic("%s%s", g_szRTAssertMsg1, g_szRTAssertMsg2);
1N/A}
1N/ART_EXPORT_SYMBOL(RTR0AssertPanicSystem);
1N/A
1N/A