diff options
author | Frans Kaashoek <[email protected]> | 2010-08-26 08:03:18 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2010-08-26 08:03:18 -0400 |
commit | d55b2fac074ac23e30c337014f40ae2156b31b60 (patch) | |
tree | bb9885972bf8929e7957f9ea512a8befaf06b11c /kalloc.c | |
parent | d87f51c5a1c5e7a2a3ba111b1052a297f4f96fb0 (diff) | |
parent | 789b508d538e6faf635e49f268a4f1f9e9b65f05 (diff) | |
download | xv6-labs-d55b2fac074ac23e30c337014f40ae2156b31b60.tar.gz xv6-labs-d55b2fac074ac23e30c337014f40ae2156b31b60.tar.bz2 xv6-labs-d55b2fac074ac23e30c337014f40ae2156b31b60.zip |
Merge commit 'origin/page' into page
Diffstat (limited to 'kalloc.c')
-rw-r--r-- | kalloc.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -1,9 +1,8 @@ // Physical memory allocator, intended to allocate -// memory for user processes. Allocates in 4096-byte "pages". +// memory for user processes. Allocates in 4096-byte pages. // Free list is kept sorted and combines adjacent pages into // long runs, to make it easier to allocate big segments. -// One reason the page size is 4k is that the x86 segment size -// granularity is 4k. +// This combining is not useful now that xv6 uses paging. #include "types.h" #include "defs.h" @@ -24,14 +23,10 @@ struct { int nfreemem; // Initialize free list of physical pages. -// This code cheats by just considering one megabyte of -// pages after end. Real systems would determine the -// amount of memory available in the system and use it all. void kinit(char *p, uint len) { initlock(&kmem.lock, "kmem"); - cprintf("end 0x%x free = %d(0x%x)\n", p, len); nfreemem = 0; kfree(p, len); } |