remove unused function add_process_large_range from source file

This commit is contained in:
Tomoki Shirasawa
2013-06-02 19:38:29 +09:00
parent ec908bd2cb
commit 40ad744947
3 changed files with 0 additions and 106 deletions

View File

@ -89,9 +89,6 @@ static int process_msg_prepare_process(unsigned long rphys)
+ PAGE_SIZE - 1) & PAGE_MASK;
range_npages = (e - s) >> PAGE_SHIFT;
#if 0
if (range_npages <= 256) {
#endif
if((up_v = ihk_mc_alloc_pages(range_npages, IHK_MC_AP_NOWAIT)) == NULL){
goto err;
}
@ -125,37 +122,6 @@ static int process_msg_prepare_process(unsigned long rphys)
}
dkprintf("0x%lX -> 0x%lX is physically contigous\n", s, e);
}
#if 0
}
else {
up = 0;
if (add_process_large_range(proc, s, e, VR_NONE, &up)) {
kprintf("ERROR: not enough memory\n");
while (1) cpu_halt();
}
{
void *_virt = (void *)s;
unsigned long _phys;
ihk_mc_pt_virt_to_phys(cpu_local_var(current)->vm->page_table,
_virt, &_phys);
for (_virt = (void *)s + PAGE_SIZE;
(unsigned long)_virt < e; _virt += PAGE_SIZE) {
unsigned long __phys;
ihk_mc_pt_virt_to_phys(cpu_local_var(current)->vm->page_table,
_virt, &__phys);
if (__phys != _phys + PAGE_SIZE) {
kprintf("0x%lX + PAGE_SIZE is not physically contigous, from 0x%lX to 0x%lX\n", _virt - PAGE_SIZE, _phys, __phys);
panic("mondai");
}
_phys = __phys;
}
dkprintf("0x%lX -> 0x%lX is physically contigous\n", s, e);
}
}
#endif
p->sections[i].remote_pa = up;

View File

@ -98,12 +98,6 @@ void free_process_memory(struct process *proc);
int add_process_memory_range(struct process *process,
unsigned long start, unsigned long end,
unsigned long phys, unsigned long flag);
#if 0
int add_process_large_range(struct process *process,
unsigned long start, unsigned long end,
unsigned long flag, unsigned long *phys,
enum ihk_mc_ap_flag ap_flag);
#endif
int remove_process_region(struct process *proc,
unsigned long start, unsigned long end);
struct program_load_desc;

View File

@ -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)