the-solaris-kernel.h revision 83e2ff6e49a1ce2f6c3e905bc9a2ff860ae2068a
/* $Id$ */
/** @file
* IPRT - Include all necessary headers for the Solaris kernel.
*/
/*
* Copyright (C) 2006-2007 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___the_solaris_kernel_h
#define ___the_solaris_kernel_h
#include <sys/schedctl.h>
#include <sys/sysmacros.h>
#include <sys/archsystm.h>
#include <sys/x86_archext.h>
#include <vm/seg_kmem.h>
#include <sys/archsystm.h>
#undef u /* /usr/include/sys/user.h:249:1 is where this is defined to (curproc->p_user). very cool. */
#ifndef PG_KFLT /* introduced in snv_153, previous builds don't define this. */
# define PG_KFLT (0x0200)
#endif
/* IPRT functions. */
DECLHIDDEN(void *) rtR0SolMemAlloc(uint64_t cbPhysHi, uint64_t *puPhys, size_t cb, uint64_t cbAlign, bool fContig);
/* Solaris functions. */
/* IPRT globals. */
extern bool g_frtSolSplSetsEIF;
extern RTCPUSET g_rtMpSolCpuSet;
extern bool g_frtSolUseKflt;
extern size_t g_offrtSolThreadPreempt;
extern size_t g_offrtSolCpuPreempt;
extern bool g_frtSolInitDone;
extern RTDBGKRNLINFO g_hKrnlDbgInfo;
/*
* Workarounds for running on old versions of solaris with different cross call
* interfaces. If we find xc_init_cpu() in the kernel, then just use the
* defined interfaces for xc_call() from the include file where the xc_call()
* interfaces just takes a pointer to a ulong_t array. The array must be long
* enough to hold "ncpus" bits at runtime.
* The reason for the hacks is that using the type "cpuset_t" is pretty much
* impossible from code built outside the Solaris source repository that wants
* to run on multiple releases of Solaris.
*
* For old style xc_call()s, 32 bit solaris and older 64 bit versions use
* "ulong_t" as cpuset_t.
*
* Later versions of 64 bit Solaris used: struct {ulong_t words[x];}
* where "x" depends on NCPU.
*
* We detect the difference in 64 bit support by checking the kernel value of
* max_cpuid, which always holds the compiled value of NCPU - 1.
*
* If Solaris increases NCPU to more than 256, VBox will continue to work on
* all versions of Solaris as long as the number of installed CPUs in the
* machine is <= IPRT_SOLARIS_NCPUS. If IPRT_SOLARIS_NCPUS is increased, this
* code has to be re-written some to provide compatibility with older Solaris
* which expects cpuset_t to be based on NCPU==256 -- or we discontinue
*/
#define IPRT_SOL_NCPUS 256
typedef struct RTSOLCPUSET
{
} RTSOLCPUSET;
typedef RTSOLCPUSET *PRTSOLCPUSET;
/* Avoid warnings even if it means more typing... */
typedef struct RTR0FNSOLXCCALL
{
union
{
} u;
typedef RTR0FNSOLXCCALL *PRTR0FNSOLXCCALL;
extern RTR0FNSOLXCCALL g_rtSolXcCall;
extern bool g_frtSolOldIPI;
extern bool g_frtSolOldIPIUlong;
/* Solaris globals. */
extern uintptr_t kernelbase;
/* Misc stuff from newer kernels. */
#ifndef CALLOUT_FLAG_ABSOLUTE
# define CALLOUT_FLAG_ABSOLUTE 2
#endif
#endif /* ___the_solaris_kernel_h */