Path: blob/main/contrib/llvm-project/libunwind/include/unwind_itanium.h
35154 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//7// C++ ABI Level 1 ABI documented at:8// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html9//10//===----------------------------------------------------------------------===//1112#ifndef __ITANIUM_UNWIND_H__13#define __ITANIUM_UNWIND_H__1415struct _Unwind_Context; // opaque16struct _Unwind_Exception; // forward declaration17typedef struct _Unwind_Exception _Unwind_Exception;18typedef uint64_t _Unwind_Exception_Class;1920struct _Unwind_Exception {21_Unwind_Exception_Class exception_class;22void (*exception_cleanup)(_Unwind_Reason_Code reason,23_Unwind_Exception *exc);24#if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)25uintptr_t private_[6];26#else27uintptr_t private_1; // non-zero means forced unwind28uintptr_t private_2; // holds sp that phase1 found for phase2 to use29#endif30#if __SIZEOF_POINTER__ == 431// The implementation of _Unwind_Exception uses an attribute mode on the32// above fields which has the side effect of causing this whole struct to33// round up to 32 bytes in size (48 with SEH). To be more explicit, we add34// pad fields added for binary compatibility.35uint32_t reserved[3];36#endif37// The Itanium ABI requires that _Unwind_Exception objects are "double-word38// aligned". GCC has interpreted this to mean "use the maximum useful39// alignment for the target"; so do we.40} __attribute__((__aligned__));4142typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)(43int version, _Unwind_Action actions, uint64_t exceptionClass,44_Unwind_Exception *exceptionObject, struct _Unwind_Context *context);4546#ifdef __cplusplus47extern "C" {48#endif4950//51// The following are the base functions documented by the C++ ABI52//53#ifdef __USING_SJLJ_EXCEPTIONS__54extern _Unwind_Reason_Code55_Unwind_SjLj_RaiseException(_Unwind_Exception *exception_object);56extern void _Unwind_SjLj_Resume(_Unwind_Exception *exception_object);57#else58extern _Unwind_Reason_Code59_Unwind_RaiseException(_Unwind_Exception *exception_object);60extern void _Unwind_Resume(_Unwind_Exception *exception_object);61#endif62extern void _Unwind_DeleteException(_Unwind_Exception *exception_object);636465extern uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index);66extern void _Unwind_SetGR(struct _Unwind_Context *context, int index,67uintptr_t new_value);68extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *context);69extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value);7071#ifdef __cplusplus72}73#endif7475#endif // __ITANIUM_UNWIND_H__767778