sgx_api.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* -*- mode:c; c-file-style:"k&r"; c-basic-offset: 4; tab-width:4; indent-tabs-mode:nil; mode:auto-fill; fill-column:78; -*- */
  2. /* vim: set ts=4 sw=4 et tw=78 fo=cqt wm=0: */
  3. /* Copyright (C) 2014 Stony Brook University
  4. This file is part of Graphene Library OS.
  5. Graphene Library OS is free software: you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License
  7. as published by the Free Software Foundation, either version 3 of the
  8. License, or (at your option) any later version.
  9. Graphene Library OS is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #ifndef SGX_API_H
  16. #define SGX_API_H
  17. #include "pal_error.h"
  18. int sgx_ocall (unsigned long code, void * ms);
  19. void * sgx_ocalloc (uint64_t size);
  20. void sgx_ocfree (void);
  21. bool sgx_is_within_enclave (const void * addr, uint64_t size);
  22. int sgx_report (sgx_arch_targetinfo_t * targetinfo,
  23. void * reportdata, sgx_arch_report_t * report);
  24. int sgx_getkey (sgx_arch_keyrequest_t * keyrequest, sgx_arch_key128_t * key);
  25. int sgx_get_report (sgx_arch_hash_t * mrenclave,
  26. sgx_arch_attributes_t * attributes,
  27. void * enclave_data,
  28. sgx_arch_report_t * report);
  29. int sgx_verify_report (sgx_arch_report_t * report);
  30. uint32_t rdrand (void);
  31. uint64_t rdfsbase (void);
  32. void wrfsbase (uint64_t addr);
  33. #endif /* SGX_API_H */