remove unused function add_process_large_range from source file
This commit is contained in:
@@ -171,72 +171,6 @@ err:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int add_process_large_range(struct process *process,
|
||||
unsigned long start, unsigned long end,
|
||||
unsigned long flag, unsigned long *phys)
|
||||
{
|
||||
struct vm_range *range;
|
||||
int npages = (end - start) >> PAGE_SHIFT;
|
||||
int npages_allocated = 0;
|
||||
void *virt;
|
||||
|
||||
if ((start < process->vm->region.user_start)
|
||||
|| (process->vm->region.user_end < end)) {
|
||||
kprintf("large range(%#lx - %#lx) is not in user avail(%#lx - %#lx)\n",
|
||||
start, end, process->vm->region.user_start,
|
||||
process->vm->region.user_end);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
range = kmalloc(sizeof(struct vm_range), ap_flag);
|
||||
if (!range) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&range->list);
|
||||
range->start = start;
|
||||
range->end = end;
|
||||
range->flag = flag;
|
||||
range->phys = 0;
|
||||
|
||||
/* Loop through the range, allocate and map blocks of 64 pages */
|
||||
for (npages_allocated = 0; npages_allocated < npages;
|
||||
npages_allocated += 64) {
|
||||
struct vm_range sub_range;
|
||||
|
||||
virt = ihk_mc_alloc_pages(64, IHK_MC_AP_NOWAIT);
|
||||
if (!virt) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Save the first sub region's physical address */
|
||||
if (!(*phys)) {
|
||||
*phys = virt_to_phys(virt);
|
||||
}
|
||||
|
||||
sub_range.phys = virt_to_phys(virt);
|
||||
sub_range.start = start + npages_allocated * PAGE_SIZE;
|
||||
sub_range.end = sub_range.start + 64 * PAGE_SIZE;
|
||||
|
||||
|
||||
update_process_page_table(process, &sub_range, flag);
|
||||
|
||||
dkprintf("subrange 0x%lX - 0x%lX -> 0x%lx - 0x%lX mapped\n",
|
||||
sub_range.start, sub_range.end,
|
||||
sub_range.phys, sub_range.phys + 64 * PAGE_SIZE);
|
||||
|
||||
memset(virt, 0, 64 * PAGE_SIZE);
|
||||
}
|
||||
|
||||
dkprintf("range: 0x%lX - 0x%lX (%ld)\n",
|
||||
range->start, range->end, range->end - range->start);
|
||||
|
||||
list_add_tail(&range->list, &process->vm->vm_range_list);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int add_process_memory_range(struct process *process,
|
||||
unsigned long start, unsigned long end,
|
||||
unsigned long phys, unsigned long flag)
|
||||
|
||||
Reference in New Issue
Block a user