fsp_types.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (C) 2013, Intel Corporation
  3. * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
  4. *
  5. * SPDX-License-Identifier: Intel
  6. */
  7. #ifndef __FSP_TYPES_H__
  8. #define __FSP_TYPES_H__
  9. /* 128 bit buffer containing a unique identifier value */
  10. struct efi_guid {
  11. u32 data1;
  12. u16 data2;
  13. u16 data3;
  14. u8 data4[8];
  15. };
  16. /**
  17. * Returns a 16-bit signature built from 2 ASCII characters.
  18. *
  19. * This macro returns a 16-bit value built from the two ASCII characters
  20. * specified by A and B.
  21. *
  22. * @A: The first ASCII character.
  23. * @B: The second ASCII character.
  24. *
  25. * @return: A 16-bit value built from the two ASCII characters specified by
  26. * A and B.
  27. */
  28. #define SIGNATURE_16(A, B) ((A) | (B << 8))
  29. /**
  30. * Returns a 32-bit signature built from 4 ASCII characters.
  31. *
  32. * This macro returns a 32-bit value built from the four ASCII characters
  33. * specified by A, B, C, and D.
  34. *
  35. * @A: The first ASCII character.
  36. * @B: The second ASCII character.
  37. * @C: The third ASCII character.
  38. * @D: The fourth ASCII character.
  39. *
  40. * @return: A 32-bit value built from the two ASCII characters specified by
  41. * A, B, C and D.
  42. */
  43. #define SIGNATURE_32(A, B, C, D) \
  44. (SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16))
  45. /**
  46. * Returns a 64-bit signature built from 8 ASCII characters.
  47. *
  48. * This macro returns a 64-bit value built from the eight ASCII characters
  49. * specified by A, B, C, D, E, F, G,and H.
  50. *
  51. * @A: The first ASCII character.
  52. * @B: The second ASCII character.
  53. * @C: The third ASCII character.
  54. * @D: The fourth ASCII character.
  55. * @E: The fifth ASCII character.
  56. * @F: The sixth ASCII character.
  57. * @G: The seventh ASCII character.
  58. * @H: The eighth ASCII character.
  59. *
  60. * @return: A 64-bit value built from the two ASCII characters specified by
  61. * A, B, C, D, E, F, G and H.
  62. */
  63. #define SIGNATURE_64(A, B, C, D, E, F, G, H) \
  64. (SIGNATURE_32(A, B, C, D) | ((u64)(SIGNATURE_32(E, F, G, H)) << 32))
  65. /*
  66. * Define FSP API return status code.
  67. * Compatiable with EFI_STATUS defined in PI Spec.
  68. */
  69. #define FSP_SUCCESS 0
  70. #define FSP_INVALID_PARAM 0x80000002
  71. #define FSP_UNSUPPORTED 0x80000003
  72. #define FSP_DEVICE_ERROR 0x80000007
  73. #define FSP_NOT_FOUND 0x8000000E
  74. #define FSP_ALREADY_STARTED 0x80000014
  75. #endif