Path: blob/master/src/hotspot/os_cpu/windows_aarch64/unwind_windows_aarch64.hpp
40930 views
/*1* Copyright (c) 2020, Microsoft Corporation. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef OS_CPU_WINDOWS_AARCH64_UNWIND_WINDOWS_AARCH64_HPP25#define OS_CPU_WINDOWS_AARCH64_UNWIND_WINDOWS_AARCH64_HPP262728typedef unsigned char UBYTE;2930#if _MSC_VER < 17003132/* Not needed for VS2012 compiler, comes from winnt.h. */33#define UNW_FLAG_EHANDLER 0x0134#define UNW_FLAG_UHANDLER 0x0235#define UNW_FLAG_CHAININFO 0x043637#endif3839// See https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling#xdata-records40typedef struct _UNWIND_INFO_EH_ONLY {41DWORD FunctionLength : 18;42DWORD Version : 2;43DWORD X : 1; // = 144DWORD E : 1; // = 145DWORD EpilogCount : 5; // = 046DWORD CodeWords : 5; // = 147DWORD UnwindCode0 : 8;48DWORD UnwindCode1 : 8;49DWORD UnwindCode2 : 8;50DWORD UnwindCode3 : 8;51DWORD ExceptionHandler;52} UNWIND_INFO_EH_ONLY, *PUNWIND_INFO_EH_ONLY;5354/*55typedef struct _RUNTIME_FUNCTION {56DWORD BeginAddress;57union {58DWORD UnwindData;59struct {60DWORD Flag : 2;61DWORD FunctionLength : 11;62DWORD RegF : 3;63DWORD RegI : 4;64DWORD H : 1;65DWORD CR : 2;66DWORD FrameSize : 9;67} DUMMYSTRUCTNAME;68} DUMMYUNIONNAME;69} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;70*/7172#if _MSC_VER < 17007374/* Not needed for VS2012 compiler, comes from winnt.h. */75typedef struct _DISPATCHER_CONTEXT {76ULONG64 ControlPc;77ULONG64 ImageBase;78PRUNTIME_FUNCTION FunctionEntry;79ULONG64 EstablisherFrame;80ULONG64 TargetIp;81PCONTEXT ContextRecord;82// PEXCEPTION_ROUTINE LanguageHandler;83char * LanguageHandler; // double dependency problem84PVOID HandlerData;85} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;8687#endif8889#if _MSC_VER < 15009091/* Not needed for VS2008 compiler, comes from winnt.h. */92typedef EXCEPTION_DISPOSITION (*PEXCEPTION_ROUTINE) (93IN PEXCEPTION_RECORD ExceptionRecord,94IN ULONG64 EstablisherFrame,95IN OUT PCONTEXT ContextRecord,96IN OUT PDISPATCHER_CONTEXT DispatcherContext97);9899#endif100101#endif // OS_CPU_WINDOWS_AARCH64_UNWIND_WINDOWS_AARCH64_HPP102103104