6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync/* $Id$ */
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync/** @file
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * IPRT - Log To Debugger, Ring-0 Driver, Solaris.
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync */
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync/*
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2006-2012 Oracle Corporation
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync *
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * available from http://www.virtualbox.org. This file is free software;
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * you can redistribute it and/or modify it under the terms of the GNU
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * General Public License (GPL) as published by the Free Software
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync *
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * The contents of this file may alternatively be used under the terms
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * of the Common Development and Distribution License Version 1.0
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * VirtualBox OSE distribution, in which case the provisions of the
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * CDDL are applicable instead of those of the GPL.
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync *
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * You may elect to license modified versions of this file under the
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync * terms and conditions of either the GPL or the CDDL or both.
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync */
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync
9c11b89c71ca727d975c39f2719063501ddcd03dvboxsync
9c11b89c71ca727d975c39f2719063501ddcd03dvboxsync/*******************************************************************************
9c11b89c71ca727d975c39f2719063501ddcd03dvboxsync* Header Files *
9c11b89c71ca727d975c39f2719063501ddcd03dvboxsync*******************************************************************************/
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync#include "the-solaris-kernel.h"
9c11b89c71ca727d975c39f2719063501ddcd03dvboxsync#include "internal/iprt.h"
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync#include <iprt/log.h>
9c11b89c71ca727d975c39f2719063501ddcd03dvboxsync
938b940adaf22f70c928744152e2d49d8b103f0dvboxsync#include <iprt/asm.h>
3667b9956dd95cfba687d4dc23dabb9a49c1feadvboxsync#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
3667b9956dd95cfba687d4dc23dabb9a49c1feadvboxsync# include <iprt/asm-amd64-x86.h>
3667b9956dd95cfba687d4dc23dabb9a49c1feadvboxsync#endif
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync#include <iprt/assert.h>
f1cdf0f009f4fb05632cc202af1bd5376be6e4f3vboxsync#include <iprt/thread.h>
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync
9c11b89c71ca727d975c39f2719063501ddcd03dvboxsync
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsyncRTDECL(void) RTLogWriteDebugger(const char *pch, size_t cb)
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync{
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync if (pch[cb] != '\0')
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync AssertBreakpoint();
42d4b2816d14db51f1b617562b1d053896ca0b1cvboxsync
42d4b2816d14db51f1b617562b1d053896ca0b1cvboxsync /* cmn_err() acquires adaptive mutexes. Not preemption safe, see @bugref{6657}. */
42d4b2816d14db51f1b617562b1d053896ca0b1cvboxsync if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD))
f1cdf0f009f4fb05632cc202af1bd5376be6e4f3vboxsync return;
42d4b2816d14db51f1b617562b1d053896ca0b1cvboxsync
8750aef1556280f62aac28c3d97598db154b1ba6vboxsync if ( !g_frtSolSplSetsEIF
3667b9956dd95cfba687d4dc23dabb9a49c1feadvboxsync#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
3667b9956dd95cfba687d4dc23dabb9a49c1feadvboxsync || ASMIntAreEnabled()
3667b9956dd95cfba687d4dc23dabb9a49c1feadvboxsync#else
3667b9956dd95cfba687d4dc23dabb9a49c1feadvboxsync/* PORTME: Check if interrupts are enabled, if applicable. */
3667b9956dd95cfba687d4dc23dabb9a49c1feadvboxsync#endif
3667b9956dd95cfba687d4dc23dabb9a49c1feadvboxsync )
42d4b2816d14db51f1b617562b1d053896ca0b1cvboxsync {
938b940adaf22f70c928744152e2d49d8b103f0dvboxsync cmn_err(CE_CONT, pch);
42d4b2816d14db51f1b617562b1d053896ca0b1cvboxsync }
42d4b2816d14db51f1b617562b1d053896ca0b1cvboxsync
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync return;
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync}
6b2e1c703bfafe40110d3769b132c1462b0fc8bbvboxsync