add arm64 support
- add arm64 dependent codes with GICv3 and SVE support - fix bugs based on architecture separation requests
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
/* devobj.c COPYRIGHT FUJITSU LIMITED 2015-2017 */
|
||||
/**
|
||||
* \file devobj.c
|
||||
* License details are found in the file LICENSE.
|
||||
@ -87,7 +88,12 @@ int devobj_create(int fd, size_t len, off_t off, struct memobj **objp, int *maxp
|
||||
int error;
|
||||
struct devobj *obj = NULL;
|
||||
const size_t npages = (len + PAGE_SIZE - 1) / PAGE_SIZE;
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_36
|
||||
const size_t uintptr_per_page = (PAGE_SIZE / sizeof(uintptr_t));
|
||||
const size_t pfn_npages = (npages + uintptr_per_page - 1) / uintptr_per_page;
|
||||
#else
|
||||
const size_t pfn_npages = (npages / (PAGE_SIZE / sizeof(uintptr_t))) + 1;
|
||||
#endif /*POSTK_DEBUG_TEMP_FIX_36*/
|
||||
|
||||
dkprintf("%s: fd: %d, len: %lu, off: %lu \n", __FUNCTION__, fd, len, off);
|
||||
|
||||
@ -168,8 +174,10 @@ static void devobj_release(struct memobj *memobj)
|
||||
struct devobj *obj = to_devobj(memobj);
|
||||
struct devobj *free_obj = NULL;
|
||||
uintptr_t handle;
|
||||
#ifndef POSTK_DEBUG_TEMP_FIX_36
|
||||
const size_t pfn_npages =
|
||||
(obj->npages / (PAGE_SIZE / sizeof(uintptr_t))) + 1;
|
||||
#endif /*!POSTK_DEBUG_TEMP_FIX_36*/
|
||||
|
||||
dkprintf("devobj_release(%p %lx)\n", obj, obj->handle);
|
||||
|
||||
@ -201,7 +209,13 @@ static void devobj_release(struct memobj *memobj)
|
||||
|
||||
if (obj->pfn_table) {
|
||||
// Don't call memory_stat_rss_sub() because devobj related pages don't reside in main memory
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_36
|
||||
const size_t uintptr_per_page = (PAGE_SIZE / sizeof(uintptr_t));
|
||||
const size_t pfn_npages = (obj->npages + uintptr_per_page - 1) / uintptr_per_page;
|
||||
ihk_mc_free_pages(obj->pfn_table, pfn_npages);
|
||||
#else
|
||||
ihk_mc_free_pages(obj->pfn_table, pfn_npages);
|
||||
#endif /*POSTK_DEBUG_TEMP_FIX_36*/
|
||||
}
|
||||
kfree(free_obj);
|
||||
}
|
||||
@ -258,7 +272,11 @@ static int devobj_get_page(struct memobj *memobj, off_t off, int p2align, uintpt
|
||||
/* TODO: do an arch dependent PTE to mapping flag conversion
|
||||
* instead of this inline check, also, we rely on having the
|
||||
* same PAT config as Linux here.. */
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_12
|
||||
if (pfn_is_write_combined(pfn)) {
|
||||
#else /* POSTK_DEBUG_ARCH_DEP_12 */
|
||||
if ((pfn & PFL1_PWT) && !(pfn & PFL1_PCD)) {
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_12 */
|
||||
*flag |= VR_WRITE_COMBINED;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user