From: Tomas Hruby Date: Sat, 10 Apr 2010 15:22:41 +0000 (+0000) Subject: This tiny cleanup makes the naming a variables in createpde() more clear. X-Git-Tag: v3.1.7~159 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.html?a=commitdiff_plain;h=512058ca9877b191bd231bdf4294e30b4a912ebf;p=minix.git This tiny cleanup makes the naming a variables in createpde() more clear. --- diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 8f6c4be7d..600bab945 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -34,7 +34,7 @@ PRIVATE int psok = 0; PUBLIC u8_t *vm_pagedirs = NULL; -#define MAX_FREEPDES 3 +#define MAX_FREEPDES (3 * CONFIG_MAX_CPUS) PRIVATE int nfreepdes = 0, freepdes[MAX_FREEPDES]; #define HASPT(procptr) ((procptr)->p_seg.p_cr3 != 0) @@ -80,15 +80,16 @@ PRIVATE phys_bytes createpde( const struct proc *pr, /* Requested process, NULL for physical. */ const phys_bytes linaddr,/* Address after segment translation. */ phys_bytes *bytes, /* Size of chunk, function may truncate it. */ - int pde, /* freepde number to use for the mapping. */ + int free_pde_idx, /* index of the free slot to use */ int *changed /* If mapping is made, this is set to 1. */ ) { u32_t pdeval; phys_bytes offset; + int pde; - assert(pde >= 0 && pde < nfreepdes); - pde = freepdes[pde]; + assert(free_pde_idx >= 0 && free_pde_idx < nfreepdes); + pde = freepdes[free_pde_idx]; if(pr && ((pr == ptproc) || !HASPT(pr))) { /* Process memory is requested, and