lib/praesidioenclave.c
//Sets read access to a page to an enclave
Sets read access to a page to an enclave
Sets read access to a page to an enclave
int give_read_permission(void *virt_page_base, enclave_id_t receiver_id) {
  unsigned long page_number;
  char *byte_base;
  struct Message_t message;
  if ((((unsigned long) virt_page_base >> PAGE_BIT_SHIFT) << PAGE_BIT_SHIFT) != (unsigned long) virt_page_base) { 
    return -2;
  }
  page_number = __management_syscall(MANAGE_SETREADER, virt_page_base, receiver_id);
  byte_base = (char *) virt_page_base;
  byte_base[0] = BUSY_BYTE;
  message.type = MSG_SHARE_PAGE;
  message.source = getCurrentEnclaveID();
  message.destination = receiver_id;
  message.arguments[0] = page_number;
  virtSendMessage(&message);
  return 0;
}
int give_read_permission ( void * virt_page_base , enclave_id_t receiver_id ) { unsigned long page_number ; char * byte_base ; struct Message_t message ; if ( ( ( ( unsigned long ) virt_page_base >> PAGE_BIT_SHIFT ) << PAGE_BIT_SHIFT ) != ( unsigned long ) virt_page_base ) { return -2 ; } page_number = __management_syscall ( MANAGE_SETREADER , virt_page_base , receiver_id ) ; byte_base = ( char * ) virt_page_base ; byte_base [ 0 ] = BUSY_BYTE ; message . type = MSG_SHARE_PAGE ; message . source = getCurrentEnclaveID ( ) ; message . destination = receiver_id ; message . arguments [ 0 ] = page_number ; virtSendMessage ( & message ) ; return 0 ; }
Sets read access to a page to an enclave
Sets read access to a page to an enclave
//Check if lower bits are zero