ia64/xen-unstable

changeset 628:6d07235a19e8

bitkeeper revision 1.339.1.12 (3f132a3btAOPZiDtrKz16GwA9Wr_ow)

memory.c, fault.c, i386_ksyms.c:
Simplified Xenolinux mm code by removing some 386-only functionality.
author kaf24@scramble.cl.cam.ac.uk
date Mon Jul 14 22:10:03 2003 +0000 (2003-07-14)
parents 384fbe1ed716
children 035d887bdfc7
files xenolinux-2.4.21-sparse/arch/xeno/kernel/i386_ksyms.c xenolinux-2.4.21-sparse/arch/xeno/mm/fault.c xenolinux-2.4.21-sparse/mm/memory.c
line diff
     1.1 --- a/xenolinux-2.4.21-sparse/arch/xeno/kernel/i386_ksyms.c	Mon Jul 14 21:27:17 2003 +0000
     1.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/kernel/i386_ksyms.c	Mon Jul 14 22:10:03 2003 +0000
     1.3 @@ -53,7 +53,6 @@ EXPORT_SYMBOL(drive_info);
     1.4  
     1.5  /* platform dependent support */
     1.6  EXPORT_SYMBOL(boot_cpu_data);
     1.7 -EXPORT_SYMBOL(__verify_write);
     1.8  EXPORT_SYMBOL(dump_thread);
     1.9  EXPORT_SYMBOL(dump_fpu);
    1.10  EXPORT_SYMBOL(dump_extended_fpu);
     2.1 --- a/xenolinux-2.4.21-sparse/arch/xeno/mm/fault.c	Mon Jul 14 21:27:17 2003 +0000
     2.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/mm/fault.c	Mon Jul 14 22:10:03 2003 +0000
     2.3 @@ -29,71 +29,6 @@ extern void die(const char *,struct pt_r
     2.4  
     2.5  pgd_t *cur_pgd;
     2.6  
     2.7 -/*
     2.8 - * Ugly, ugly, but the goto's result in better assembly..
     2.9 - */
    2.10 -int __verify_write(const void * addr, unsigned long size)
    2.11 -{
    2.12 -	struct vm_area_struct * vma;
    2.13 -	unsigned long start = (unsigned long) addr;
    2.14 -
    2.15 -	if (!size)
    2.16 -		return 1;
    2.17 -
    2.18 -	vma = find_vma(current->mm, start);
    2.19 -	if (!vma)
    2.20 -		goto bad_area;
    2.21 -	if (vma->vm_start > start)
    2.22 -		goto check_stack;
    2.23 -
    2.24 -good_area:
    2.25 -	if (!(vma->vm_flags & VM_WRITE))
    2.26 -		goto bad_area;
    2.27 -	size--;
    2.28 -	size += start & ~PAGE_MASK;
    2.29 -	size >>= PAGE_SHIFT;
    2.30 -	start &= PAGE_MASK;
    2.31 -
    2.32 -	for (;;) {
    2.33 -	survive:
    2.34 -		{
    2.35 -			int fault = handle_mm_fault(current->mm, vma, start, 1);
    2.36 -			if (!fault)
    2.37 -				goto bad_area;
    2.38 -			if (fault < 0)
    2.39 -				goto out_of_memory;
    2.40 -		}
    2.41 -		if (!size)
    2.42 -			break;
    2.43 -		size--;
    2.44 -		start += PAGE_SIZE;
    2.45 -		if (start < vma->vm_end)
    2.46 -			continue;
    2.47 -		vma = vma->vm_next;
    2.48 -		if (!vma || vma->vm_start != start)
    2.49 -			goto bad_area;
    2.50 -		if (!(vma->vm_flags & VM_WRITE))
    2.51 -			goto bad_area;;
    2.52 -	}
    2.53 -	return 1;
    2.54 -
    2.55 -check_stack:
    2.56 -	if (!(vma->vm_flags & VM_GROWSDOWN))
    2.57 -		goto bad_area;
    2.58 -	if (expand_stack(vma, start) == 0)
    2.59 -		goto good_area;
    2.60 -
    2.61 -bad_area:
    2.62 -	return 0;
    2.63 -
    2.64 -out_of_memory:
    2.65 -	if (current->pid == 1) {
    2.66 -		yield();
    2.67 -		goto survive;
    2.68 -	}
    2.69 -	goto bad_area;
    2.70 -}
    2.71 -
    2.72  extern spinlock_t timerlist_lock;
    2.73  
    2.74  /*
     3.1 --- a/xenolinux-2.4.21-sparse/mm/memory.c	Mon Jul 14 21:27:17 2003 +0000
     3.2 +++ b/xenolinux-2.4.21-sparse/mm/memory.c	Mon Jul 14 22:10:03 2003 +0000
     3.3 @@ -1381,15 +1381,6 @@ int handle_mm_fault(struct mm_struct *mm
     3.4  	pgd_t *pgd;
     3.5  	pmd_t *pmd;
     3.6  
     3.7 -#if defined(CONFIG_XENO_PRIV)
     3.8 -	/* Take care of I/O mappings right here. */
     3.9 -	if (vma->vm_flags & VM_IO) {
    3.10 -		if (write_access && !(vma->vm_flags & VM_WRITE))
    3.11 -			return -1;
    3.12 -		return 1;
    3.13 -	}
    3.14 -#endif
    3.15 -
    3.16  	current->state = TASK_RUNNING;
    3.17  	pgd = pgd_offset(mm, address);
    3.18