/*******************************************************************************1* Copyright (c) 1991, 2017 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/21#ifndef _IBM_UTE_H22#define _IBM_UTE_H2324/* @ddr_namespace: default */2526#include <limits.h>2728#include "jni.h"29#include "j9.h"30#include "ute_module.h"31#include "ute_core.h"32#include "j9trace.h"3334#ifdef __cplusplus35extern "C" {36#endif3738#define J9_RAS_IS_METHOD_TRACED(flags) (( flags & (J9_RAS_METHOD_TRACING|J9_RAS_METHOD_TRIGGERING) ))39#define UTSINTERFACEFROMVM(vm) ((J9UtServerInterface *)((UtInterface *)((RasGlobalStorage *)vm->j9rasGlobalStorage)->utIntf)->server)4041#define UTSI_TRACEMETHODENTER_FROMVM(vm, thr, method, receiverAddress, methodType) \42do { \43RasGlobalStorage *tempRasGbl; \44tempRasGbl = (RasGlobalStorage *)vm->j9rasGlobalStorage; \45if (tempRasGbl != NULL) { \46((J9UtServerInterface *)((UtInterface *)tempRasGbl->utIntf)->server)->TraceMethodEnter(thr, method, receiverAddress, methodType); \47} \48} while(0)49#define UTSI_TRACEMETHODEXIT_FROMVM(vm, thr, method, exceptionPtr, returnValuePtr, methodType) \50do { \51RasGlobalStorage *tempRasGbl; \52tempRasGbl = (RasGlobalStorage *)vm->j9rasGlobalStorage; \53if (tempRasGbl != NULL) { \54((J9UtServerInterface *)((UtInterface *)tempRasGbl->utIntf)->server)->TraceMethodExit(thr, method, exceptionPtr, returnValuePtr, methodType); \55} \56} while(0)5758/*59* =============================================================================60* The server interface for calls into UT61* =============================================================================62*/63typedef struct J9UtServerInterface {64/* OMR layer API */65UtServerInterface omrf;6667/* Java layer API */68void (*TraceMethodEnter)(J9VMThread* thr, J9Method* method, void *receiverAddress, UDATA methodType);69void (*TraceMethodExit)(J9VMThread* thr, J9Method* method, void* exceptionPtr, void *returnValuePtr, UDATA methodType);70void (*StartupComplete)(J9VMThread* thr);71} J9UtServerInterface;7273#ifdef __cplusplus74}75#endif76#endif /* !_IBM_UTE_H */777879