os/kernelhwsrv/kernel/eka/compsupp/aehabi/unwinder.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/* unwinder.h
sl@0
     2
 *
sl@0
     3
 * Copyright 2002-2003 ARM Limited.
sl@0
     4
 */
sl@0
     5
/*
sl@0
     6
  Licence
sl@0
     7
  
sl@0
     8
  1. Subject to the provisions of clause 2, ARM hereby grants to LICENSEE a 
sl@0
     9
  perpetual, non-exclusive, nontransferable, royalty free, worldwide licence 
sl@0
    10
  to use this Example Implementation of Exception Handling solely for the 
sl@0
    11
  purpose of developing, having developed, manufacturing, having 
sl@0
    12
  manufactured, offering to sell, selling, supplying or otherwise 
sl@0
    13
  distributing products which comply with the Exception Handling ABI for the 
sl@0
    14
  ARM Architecture specification. All other rights are reserved to ARM or its 
sl@0
    15
  licensors.
sl@0
    16
  
sl@0
    17
  2. THIS EXAMPLE IMPLEMENTATION OF EXCEPTION HANDLING  IS PROVIDED "AS IS" 
sl@0
    18
  WITH NO WARRANTIES EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED 
sl@0
    19
  TO ANY WARRANTY OF SATISFACTORY QUALITY, MERCHANTABILITY, NONINFRINGEMENT 
sl@0
    20
  OR FITNESS FOR A PARTICULAR PURPOSE.
sl@0
    21
*/
sl@0
    22
/*
sl@0
    23
 * RCS $Revision: 1.7 $
sl@0
    24
 * Checkin $Date: 2003/09/01 12:45:25 $
sl@0
    25
 * Revising $Author: achapman $
sl@0
    26
 */
sl@0
    27
sl@0
    28
/* Language-independent unwinder header public defines */
sl@0
    29
sl@0
    30
#ifndef UNWINDER_H
sl@0
    31
#define UNWINDER_H
sl@0
    32
sl@0
    33
#ifdef __cplusplus
sl@0
    34
extern "C" {
sl@0
    35
#endif
sl@0
    36
sl@0
    37
  typedef enum {
sl@0
    38
    _URC_OK = 0,       /* operation completed successfully */
sl@0
    39
    _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
sl@0
    40
    _URC_HANDLER_FOUND = 6,
sl@0
    41
    _URC_INSTALL_CONTEXT = 7,
sl@0
    42
    _URC_CONTINUE_UNWIND = 8,
sl@0
    43
    _URC_FAILURE = 9   /* unspecified failure of some kind */
sl@0
    44
  } _Unwind_Reason_Code;
sl@0
    45
  
sl@0
    46
  typedef enum {
sl@0
    47
    _US_VIRTUAL_UNWIND_FRAME = 0,
sl@0
    48
    _US_UNWIND_FRAME_STARTING = 1,
sl@0
    49
    _US_UNWIND_FRAME_RESUME = 2
sl@0
    50
  } _Unwind_State;
sl@0
    51
  
sl@0
    52
  typedef struct _Unwind_Control_Block _Unwind_Control_Block;
sl@0
    53
  typedef struct _Unwind_Context _Unwind_Context;
sl@0
    54
  typedef uint32_t _Unwind_EHT_Header;
sl@0
    55
  
sl@0
    56
  
sl@0
    57
  /* UCB: */
sl@0
    58
  
sl@0
    59
  struct _Unwind_Control_Block {
sl@0
    60
    char exception_class[8];
sl@0
    61
    void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
sl@0
    62
    /* Unwinder cache, private fields for the unwinder's use */
sl@0
    63
    struct {
sl@0
    64
      uint32_t reserved1;     /* init reserved1 to 0, then don't touch */
sl@0
    65
      uint32_t reserved2;
sl@0
    66
      uint32_t reserved3;
sl@0
    67
      uint32_t reserved4;
sl@0
    68
      uint32_t reserved5;
sl@0
    69
    } unwinder_cache;
sl@0
    70
    /* Propagation barrier cache (valid after phase 1): */
sl@0
    71
    struct {
sl@0
    72
      uint32_t sp;
sl@0
    73
      uint32_t bitpattern[5];
sl@0
    74
    } barrier_cache;
sl@0
    75
    /* Cleanup cache (preserved over cleanup): */
sl@0
    76
    struct {
sl@0
    77
      uint32_t bitpattern[4];
sl@0
    78
    } cleanup_cache;
sl@0
    79
    /* Pr cache (for pr's benefit): */
sl@0
    80
    struct {
sl@0
    81
      uint32_t fnstart;             /* function start address */
sl@0
    82
      _Unwind_EHT_Header *ehtp;     /* pointer to EHT entry header word */
sl@0
    83
      uint32_t additional;          /* additional data */
sl@0
    84
      uint32_t reserved1;
sl@0
    85
    } pr_cache;
sl@0
    86
    long long int :0;               /* Force alignment of next item to 8-byte boundary */
sl@0
    87
  };
sl@0
    88
  
sl@0
    89
  /* Interface functions: */
sl@0
    90
  
sl@0
    91
  _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp);
sl@0
    92
  NORETURNDECL void _Unwind_Resume(_Unwind_Control_Block *ucbp);
sl@0
    93
  void _Unwind_Complete(_Unwind_Control_Block *ucbp);
sl@0
    94
sl@0
    95
  /* Virtual Register Set*/
sl@0
    96
        
sl@0
    97
  typedef enum {
sl@0
    98
    _UVRSC_CORE = 0,      /* integer register */
sl@0
    99
    _UVRSC_VFP = 1,       /* vfp */
sl@0
   100
    _UVRSC_FPA = 2,       /* fpa */
sl@0
   101
    _UVRSC_WMMXD = 3,     /* Intel WMMX data register */
sl@0
   102
    _UVRSC_WMMXC = 4      /* Intel WMMX control register */
sl@0
   103
  } _Unwind_VRS_RegClass;
sl@0
   104
  
sl@0
   105
  typedef enum {
sl@0
   106
    _UVRSD_UINT32 = 0,
sl@0
   107
    _UVRSD_VFPX = 1,
sl@0
   108
    _UVRSD_FPAX = 2,
sl@0
   109
    _UVRSD_UINT64 = 3,
sl@0
   110
    _UVRSD_FLOAT = 4,
sl@0
   111
    _UVRSD_DOUBLE = 5
sl@0
   112
  } _Unwind_VRS_DataRepresentation;
sl@0
   113
  
sl@0
   114
  typedef enum {
sl@0
   115
    _UVRSR_OK = 0,
sl@0
   116
    _UVRSR_NOT_IMPLEMENTED = 1,
sl@0
   117
    _UVRSR_FAILED = 2
sl@0
   118
  } _Unwind_VRS_Result;
sl@0
   119
sl@0
   120
  _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *context,
sl@0
   121
                                     _Unwind_VRS_RegClass regclass,
sl@0
   122
                                     uint32_t regno,
sl@0
   123
                                     _Unwind_VRS_DataRepresentation representation,
sl@0
   124
                                     void *valuep);
sl@0
   125
  
sl@0
   126
  _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *context,
sl@0
   127
                                     _Unwind_VRS_RegClass regclass,
sl@0
   128
                                     uint32_t regno,
sl@0
   129
                                     _Unwind_VRS_DataRepresentation representation,
sl@0
   130
                                     void *valuep);
sl@0
   131
  
sl@0
   132
  _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *context,
sl@0
   133
                                     _Unwind_VRS_RegClass regclass,
sl@0
   134
                                     uint32_t descriminator,
sl@0
   135
                                     _Unwind_VRS_DataRepresentation representation);
sl@0
   136
sl@0
   137
#ifdef __cplusplus
sl@0
   138
}   /* extern "C" */
sl@0
   139
#endif
sl@0
   140
sl@0
   141
#endif /* defined UNWINDER_H */