  
  #ifdef __cplusplus
  extern "C" {
-@@ -44,6 +45,7 @@
+@@ -44,6 +45,10 @@
  void * get_heap_base(void);
  size_t get_heap_size(void);
  size_t get_heap_min_size(void);
 +void get_memory_layout(struct SgxMemoryLayout *memory_layout);
++void increase_ecall_count();
++void decrease_ecall_count();
++int get_ecall_count();
  int * get_errno_addr(void);
  bool is_stack_addr(void *address, size_t size);
  bool is_valid_sp(uintptr_t sp);

 
 extern "C" int enter_enclave(int index, void *ms, void *tcs, int cssa) __attribute__((section(".nipx")));
 
@@ -87,13 +65,25 @@
         return error;
     }
 
-    if(cssa == 0)
+    // Check whether the incoming ecall is a user exception. If index is within
+    // range of the ecall table size, the is_exception field will be true for
+    // user exceptions.

+ *      (data/bss/heap) and for current tcs(thread data/stack).
+ */
+void SGXAPI sgx_memory_layout(struct SgxMemoryLayout *memory_layout);
+
+/* sgx_get_active_enclave_entries()
+ * Return Value - the number of active ecalls inside the enclave.
+ */
+int SGXAPI sgx_get_active_enclave_entries();
+
 #ifdef __cplusplus
 }
