Fix user page mmu mapping and naming scheme

This commit is contained in:
TuxSH
2018-02-25 15:05:52 +01:00
parent ab38217720
commit 4c7aa566f0
2 changed files with 31 additions and 30 deletions

View File

@@ -1,14 +1,14 @@
#ifndef EXOSPHERE_USERPAGE_H
#define EXOSPHERE_USERPAGE_H
#include <stdbool.h>
#include <stdint.h>
#include "utils.h"
#include "memory_map.h"
#define SECURE_USER_PAGE_ADDR (0x1F01F4000ULL)
#define USER_PAGE_SECURE_MONITOR_ADDR (tzram_get_segment_address(TZRAM_SEGMENT_ID_USERPAGE))
typedef struct {
uint64_t user_page;
uint64_t secure_page;
uintptr_t user_address;
uintptr_t secure_monitor_address;
} upage_ref_t;
bool upage_init(upage_ref_t *user_page, void *user_address);
@@ -16,8 +16,4 @@ bool upage_init(upage_ref_t *user_page, void *user_address);
bool user_copy_to_secure(upage_ref_t *user_page, void *secure_dst, void *user_src, size_t size);
bool secure_copy_to_user(upage_ref_t *user_page, void *user_dst, void *secure_src, size_t size);
static inline uint64_t get_page_for_address(void *address) {
return ((uint64_t)(address)) & 0xFFFFFFFFFFFFF000ULL;
}
#endif
#endif