se_error_internal.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright (C) 2011-2018 Intel Corporation. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in
  12. * the documentation and/or other materials provided with the
  13. * distribution.
  14. * * Neither the name of Intel Corporation nor the names of its
  15. * contributors may be used to endorse or promote products derived
  16. * from this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. */
  31. #ifndef _SE_ERROR_INTERNAL_H_
  32. #define _SE_ERROR_INTERNAL_H_
  33. #include "sgx_error.h"
  34. /*
  35. bit[31:30] - main module id
  36. 00 - external error
  37. 11---internal error
  38. bit[29:16] - reserved
  39. bit[15:12] - sub-module id
  40. bit[11:0] - specific error
  41. */
  42. #define MAIN_MOD_SHIFT 30
  43. #define SUB_MOD_SHIFT 12
  44. #define INTERNAL_ERROR 3
  45. #define EXTERNAL_ERROR 0
  46. #define SE_INTERNAL_ERROR(x) (0xC0000000|(x))
  47. typedef enum _se_status_internal_t
  48. {
  49. SE_ERROR_SUCCESS = 0, /*same value as SGX_SUCCESS*/
  50. /*error code for driver return to uRTS*/
  51. SE_ERROR_DRIVER_UNEXPECTED = SE_INTERNAL_ERROR(0X2001),
  52. SE_ERROR_DRIVER_INVALID_ID = SE_INTERNAL_ERROR(0X2002),
  53. SE_ERROR_DRIVER_INVALID_PARAMETER = SE_INTERNAL_ERROR(0X2003),
  54. SE_ERROR_DRIVER_INVALID_REQUEST = SE_INTERNAL_ERROR(0X2004),
  55. SE_ERROR_DRIVER_OUTOF_MEMORY_R0 = SE_INTERNAL_ERROR(0X2005),
  56. SE_ERROR_DRIVER_OUTOF_MEMORY_R3 = SE_INTERNAL_ERROR(0X2006),
  57. SE_ERROR_DRIVER_OUTOF_EPC = SE_INTERNAL_ERROR(0X2007),
  58. SE_ERROR_DRIVER_HW_CAPABILITY = SE_INTERNAL_ERROR(0X2008),
  59. SE_ERROR_DRIVER_MEMORY_MAP_CONFLICT = SE_INTERNAL_ERROR(0X2009),
  60. SE_ERROR_DRIVER_POWER = SE_INTERNAL_ERROR(0X200a),
  61. SE_ERROR_DRIVER_INVALID_PRIVILEGE = SE_INTERNAL_ERROR(0X200b),
  62. SE_ERROR_DRIVER_INVALID_ISVSVNLE = SE_INTERNAL_ERROR(0X200c),
  63. SE_ERROR_DRIVER_INVALID_SIG_STRUCT = SE_INTERNAL_ERROR(0X2100),
  64. SE_ERROR_DRIVER_INVALID_ATTRIBUTE = SE_INTERNAL_ERROR(0X2101),
  65. SE_ERROR_DRIVER_INVALID_MEASUREMENT = SE_INTERNAL_ERROR(0X2102),
  66. SE_ERROR_DRIVER_INVALID_SIGNATURE = SE_INTERNAL_ERROR(0X2103),
  67. SE_ERROR_DRIVER_INVALID_LAUNCH_TOKEN= SE_INTERNAL_ERROR(0X2104),
  68. SE_ERROR_DRIVER_INVALID_CPUSVN = SE_INTERNAL_ERROR(0X2105),
  69. SE_ERROR_DRIVER_UNMASKED_EVENT = SE_INTERNAL_ERROR(0X2106),
  70. SE_ERROR_INVALID_LAUNCH_TOKEN = SE_INTERNAL_ERROR(0x2200), /* the license is invalid*/
  71. SE_ERROR_INVALID_MEASUREMENT = SE_INTERNAL_ERROR(0x2201), /* The measurement of the enclave is invalid. May caused by signature or launch token*/
  72. SE_ERROR_READ_LOCK_FAIL = SE_INTERNAL_ERROR(0x2202),
  73. SE_ERROR_INVALID_ISVSVNLE = SE_INTERNAL_ERROR(0X2203),
  74. /*error code for untrusted event of SE mutex*/
  75. SE_ERROR_MUTEX_GET_EVENT = SE_INTERNAL_ERROR(0x3001),
  76. SE_ERROR_MUTEX_WAIT_EVENT = SE_INTERNAL_ERROR(0x3002),
  77. SE_ERROR_MUTEX_WAKE_EVENT = SE_INTERNAL_ERROR(0x3003),
  78. } se_status_internal_t;
  79. #endif