From: Tomas Hruby Date: Wed, 25 Jan 2012 18:59:18 +0000 (+0000) Subject: Revert 93b9873a562b11dfedf5f4e53ef87bf256d80207 X-Git-Tag: v3.2.0~107 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/style.css?a=commitdiff_plain;h=9e1d244cbe1268ace88c6fbe8455fcc897067651;p=minix.git Revert 93b9873a562b11dfedf5f4e53ef87bf256d80207 - non need to have free PDEs per CPU since we only run one instance of the kernel at any time --- diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index f70d2c0f6..6ec2f20ff 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -31,8 +31,7 @@ PUBLIC int i386_paging_enabled = 0; PRIVATE int psok = 0; -#define FREE_PDES_PER_CPU 2 -#define MAX_FREEPDES (FREE_PDES_PER_CPU * CONFIG_MAX_CPUS) +#define MAX_FREEPDES 2 PRIVATE int nfreepdes = 0, freepdes[MAX_FREEPDES]; #define HASPT(procptr) ((procptr)->p_seg.p_cr3 != 0) @@ -80,12 +79,7 @@ PRIVATE phys_bytes createpde( phys_bytes offset; int pde; - assert(free_pde_idx >= 0 && free_pde_idx < FREE_PDES_PER_CPU); - - /* make the index CPU local */ - free_pde_idx += cpuid * FREE_PDES_PER_CPU; - assert(free_pde_idx < nfreepdes); - + assert(free_pde_idx >= 0 && free_pde_idx < nfreepdes); pde = freepdes[free_pde_idx]; assert(pde >= 0 && pde < 1024); @@ -145,7 +139,7 @@ PRIVATE int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr, proc_nr_t procslot; assert(vm_running); - assert(nfreepdes >= 2); + assert(nfreepdes >= MAX_FREEPDES); assert(get_cpulocal_var(ptproc)); assert(get_cpulocal_var(proc_ptr)); @@ -658,7 +652,7 @@ int vm_phys_memset(phys_bytes ph, const u8_t c, phys_bytes bytes) return OK; } - assert(nfreepdes >= 2); + assert(nfreepdes >= MAX_FREEPDES); assert(get_cpulocal_var(ptproc)->p_seg.p_cr3_v);