1
/* $Id: machkernel.h $ */
3
* IPRT - mach_kernel symbol resolving hack, R0 Driver, Darwin.
7
* Copyright (C) 2011 Oracle Corporation
9
* This file is part of VirtualBox Open Source Edition (OSE), as
10
* available from http://www.virtualbox.org. This file is free software;
11
* you can redistribute it and/or modify it under the terms of the GNU
12
* General Public License (GPL) as published by the Free Software
13
* Foundation, in version 2 as it comes in the "COPYING" file of the
14
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17
* The contents of this file may alternatively be used under the terms
18
* of the Common Development and Distribution License Version 1.0
19
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20
* VirtualBox OSE distribution, in which case the provisions of the
21
* CDDL are applicable instead of those of the GPL.
23
* You may elect to license modified versions of this file under the
24
* terms and conditions of either the GPL or the CDDL or both.
27
#ifndef ___iprt_darwin_machkernel_h
28
#define ___iprt_darwin_machkernel_h
30
#include <iprt/types.h>
34
/** @defgroup grp_rt_darwin_machkernel Mach Kernel Symbols (Ring-0 only)
39
/** Handle to the mach kernel symbol database (darwin/r0 only). */
40
typedef R3R0PTRTYPE(struct RTR0MACHKERNELINT *) RTR0MACHKERNEL;
41
/** Pointer to a mach kernel symbol database handle. */
42
typedef RTR0MACHKERNEL *PRTR0MACHKERNEL;
43
/** Nil mach kernel symbol database handle. */
44
#define NIL_RTR0MACHKERNEL ((RTR0MACHKERNEL)0)
48
* Opens symbol table of the mach_kernel.
50
* @returns IPRT status code.
51
* @param pszMachKernel The path to the mach_kernel image.
52
* @param phKernel Where to return a mach kernel symbol database
53
* handle on success. Call RTR0MachKernelClose on it
56
RTDECL(int) RTR0MachKernelOpen(const char *pszMachKernel, PRTR0MACHKERNEL phKernel);
59
* Frees up the internal scratch data when done looking up symbols.
61
* @param pThis The internal scratch data.
63
RTDECL(int) RTR0MachKernelClose(RTR0MACHKERNEL hKernel);
66
* Looks up a kernel symbol.
68
* @returns VINF_SUCCESS if found, *ppvValue set.
69
* @retval VERR_SYMBOL_NOT_FOUND if not found.
70
* @retval VERR_INVALID_HANDLE
71
* @retval VERR_INVALID_POINTER
73
* @param hKernel The mach kernel handle.
74
* @param pszSymbol The name of the symbol to look up, omitting the
76
* @param ppvValue Where to store the symbol address (optional).
78
RTDECL(int) RTR0MachKernelGetSymbol(RTR0MACHKERNEL hKernel, const char *pszSymbol, void **ppvValue);