1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/compsupp/aehabi/unwinder.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,141 @@
1.4 +/* unwinder.h
1.5 + *
1.6 + * Copyright 2002-2003 ARM Limited.
1.7 + */
1.8 +/*
1.9 + Licence
1.10 +
1.11 + 1. Subject to the provisions of clause 2, ARM hereby grants to LICENSEE a
1.12 + perpetual, non-exclusive, nontransferable, royalty free, worldwide licence
1.13 + to use this Example Implementation of Exception Handling solely for the
1.14 + purpose of developing, having developed, manufacturing, having
1.15 + manufactured, offering to sell, selling, supplying or otherwise
1.16 + distributing products which comply with the Exception Handling ABI for the
1.17 + ARM Architecture specification. All other rights are reserved to ARM or its
1.18 + licensors.
1.19 +
1.20 + 2. THIS EXAMPLE IMPLEMENTATION OF EXCEPTION HANDLING IS PROVIDED "AS IS"
1.21 + WITH NO WARRANTIES EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED
1.22 + TO ANY WARRANTY OF SATISFACTORY QUALITY, MERCHANTABILITY, NONINFRINGEMENT
1.23 + OR FITNESS FOR A PARTICULAR PURPOSE.
1.24 +*/
1.25 +/*
1.26 + * RCS $Revision: 1.7 $
1.27 + * Checkin $Date: 2003/09/01 12:45:25 $
1.28 + * Revising $Author: achapman $
1.29 + */
1.30 +
1.31 +/* Language-independent unwinder header public defines */
1.32 +
1.33 +#ifndef UNWINDER_H
1.34 +#define UNWINDER_H
1.35 +
1.36 +#ifdef __cplusplus
1.37 +extern "C" {
1.38 +#endif
1.39 +
1.40 + typedef enum {
1.41 + _URC_OK = 0, /* operation completed successfully */
1.42 + _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
1.43 + _URC_HANDLER_FOUND = 6,
1.44 + _URC_INSTALL_CONTEXT = 7,
1.45 + _URC_CONTINUE_UNWIND = 8,
1.46 + _URC_FAILURE = 9 /* unspecified failure of some kind */
1.47 + } _Unwind_Reason_Code;
1.48 +
1.49 + typedef enum {
1.50 + _US_VIRTUAL_UNWIND_FRAME = 0,
1.51 + _US_UNWIND_FRAME_STARTING = 1,
1.52 + _US_UNWIND_FRAME_RESUME = 2
1.53 + } _Unwind_State;
1.54 +
1.55 + typedef struct _Unwind_Control_Block _Unwind_Control_Block;
1.56 + typedef struct _Unwind_Context _Unwind_Context;
1.57 + typedef uint32_t _Unwind_EHT_Header;
1.58 +
1.59 +
1.60 + /* UCB: */
1.61 +
1.62 + struct _Unwind_Control_Block {
1.63 + char exception_class[8];
1.64 + void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
1.65 + /* Unwinder cache, private fields for the unwinder's use */
1.66 + struct {
1.67 + uint32_t reserved1; /* init reserved1 to 0, then don't touch */
1.68 + uint32_t reserved2;
1.69 + uint32_t reserved3;
1.70 + uint32_t reserved4;
1.71 + uint32_t reserved5;
1.72 + } unwinder_cache;
1.73 + /* Propagation barrier cache (valid after phase 1): */
1.74 + struct {
1.75 + uint32_t sp;
1.76 + uint32_t bitpattern[5];
1.77 + } barrier_cache;
1.78 + /* Cleanup cache (preserved over cleanup): */
1.79 + struct {
1.80 + uint32_t bitpattern[4];
1.81 + } cleanup_cache;
1.82 + /* Pr cache (for pr's benefit): */
1.83 + struct {
1.84 + uint32_t fnstart; /* function start address */
1.85 + _Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */
1.86 + uint32_t additional; /* additional data */
1.87 + uint32_t reserved1;
1.88 + } pr_cache;
1.89 + long long int :0; /* Force alignment of next item to 8-byte boundary */
1.90 + };
1.91 +
1.92 + /* Interface functions: */
1.93 +
1.94 + _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp);
1.95 + NORETURNDECL void _Unwind_Resume(_Unwind_Control_Block *ucbp);
1.96 + void _Unwind_Complete(_Unwind_Control_Block *ucbp);
1.97 +
1.98 + /* Virtual Register Set*/
1.99 +
1.100 + typedef enum {
1.101 + _UVRSC_CORE = 0, /* integer register */
1.102 + _UVRSC_VFP = 1, /* vfp */
1.103 + _UVRSC_FPA = 2, /* fpa */
1.104 + _UVRSC_WMMXD = 3, /* Intel WMMX data register */
1.105 + _UVRSC_WMMXC = 4 /* Intel WMMX control register */
1.106 + } _Unwind_VRS_RegClass;
1.107 +
1.108 + typedef enum {
1.109 + _UVRSD_UINT32 = 0,
1.110 + _UVRSD_VFPX = 1,
1.111 + _UVRSD_FPAX = 2,
1.112 + _UVRSD_UINT64 = 3,
1.113 + _UVRSD_FLOAT = 4,
1.114 + _UVRSD_DOUBLE = 5
1.115 + } _Unwind_VRS_DataRepresentation;
1.116 +
1.117 + typedef enum {
1.118 + _UVRSR_OK = 0,
1.119 + _UVRSR_NOT_IMPLEMENTED = 1,
1.120 + _UVRSR_FAILED = 2
1.121 + } _Unwind_VRS_Result;
1.122 +
1.123 + _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *context,
1.124 + _Unwind_VRS_RegClass regclass,
1.125 + uint32_t regno,
1.126 + _Unwind_VRS_DataRepresentation representation,
1.127 + void *valuep);
1.128 +
1.129 + _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *context,
1.130 + _Unwind_VRS_RegClass regclass,
1.131 + uint32_t regno,
1.132 + _Unwind_VRS_DataRepresentation representation,
1.133 + void *valuep);
1.134 +
1.135 + _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *context,
1.136 + _Unwind_VRS_RegClass regclass,
1.137 + uint32_t descriminator,
1.138 + _Unwind_VRS_DataRepresentation representation);
1.139 +
1.140 +#ifdef __cplusplus
1.141 +} /* extern "C" */
1.142 +#endif
1.143 +
1.144 +#endif /* defined UNWINDER_H */