small changes to do_execve2

master
forever-learner 2 years ago
parent a6cbdfd4d7
commit 4159713ef9

@ -372,7 +372,7 @@ void do_no_page(unsigned long error_code,unsigned long address)
int block,i; int block,i;
/* if (current->pid > 5) /* if (current->pid > 5)
printk(" --do_no_page: address=%x, pid=%d\n", address, current->pid); */ printk(" --do_no_page: address=%x, pid=%d\n", address, current->pid); */
address &= 0xfffff000; address &= 0xfffff000;
tmp = address - current->start_code; tmp = address - current->start_code;
@ -426,14 +426,13 @@ int do_execve2(unsigned long * eip,long tmp,char * filename,
unsigned long page; unsigned long page;
int block,i; int block,i;
unsigned long address=current->start_code; unsigned long address=current->start_code;
//this part comes from do_no_page as achievement of immediate loading of cs and ds
while(address<=current->brk+current->start_code) while(address<=current->brk+current->start_code)
{ {
address &= 0xfffff000; address &= 0xfffff000;
temp = address - current->start_code; temp = address - current->start_code;
if (share_page(temp)) if (share_page(temp))
return; return -1;
if (!(page = get_free_page())) if (!(page = get_free_page()))
oom(); oom();
block = 1 + temp/BLOCK_SIZE; block = 1 + temp/BLOCK_SIZE;
@ -444,8 +443,6 @@ int do_execve2(unsigned long * eip,long tmp,char * filename,
{ {
free_page(page); free_page(page);
oom(); oom();
printk("error");
return -1;
} }
address+=PAGE_SIZE; address+=PAGE_SIZE;
} }

Loading…
Cancel
Save