From a608664c474e100f4d3553c29ee24af3677b09ec Mon Sep 17 00:00:00 2001 From: Michael Phipps Date: Wed, 28 Aug 2002 03:26:23 +0000 Subject: [PATCH] Start of work to move static variables into pages. A little more clean up More items on the TODO list (take one off, add 3 more). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@908 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/vm2/TODO | 13 +++++++------ src/kernel/vm2/cacheManager.C | 5 +++-- src/kernel/vm2/vm.h | 10 ++++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/kernel/vm2/TODO b/src/kernel/vm2/TODO index e7e0ec548b..47e493fd0c 100644 --- a/src/kernel/vm2/TODO +++ b/src/kernel/vm2/TODO @@ -1,6 +1,7 @@ 1) Need to make the paging daemon load the pages in, using semaphores. -2) See how unresolvable page faults and permissions errors are handled - need to properly handle -3) Tests are not done. +2) Make the caching and the VM (mmap) work together so that an mmap'ed file and a cached file will not race. +3) Change the architecture so that instead of multiple static globals, everything is stored in pages. +4) Tests are not done. Test: getNextAreaInfo cloneArea @@ -10,7 +11,7 @@ paging disk caching -4) Improve locking (remains to be seen - works ok so far) -5) I use new and delete. I know that doesn't work in kernel land. Not too tough to change, though. - - Pooling is now used for everything but pages -6) There is no arch-level integration. This is to be tested (to death) in user land first. * == can not be done in user land. +5) Improve locking (remains to be seen - works ok so far) +6) See how unresolvable page faults and permissions errors are handled - need to properly handle + - This may have to come at HW integration time, since they will be app signals, etc... +7) There is no arch-level integration. This is to be tested (to death) in user land first. * == can not be done in user land. diff --git a/src/kernel/vm2/cacheManager.C b/src/kernel/vm2/cacheManager.C index 4e7bc4f7c5..8ddc9fa930 100644 --- a/src/kernel/vm2/cacheManager.C +++ b/src/kernel/vm2/cacheManager.C @@ -3,10 +3,11 @@ #include extern poolvpage vpagePool; - +// TODO - we need to (somehow) make sure that the same vnodes here are shared with mmap. +// Maybe a vnode manager... cacheManager::cacheManager(void) : area () { - myLock=create_sem(1,"Area Manager Semaphore"); // Should have team name in it. + myLock=create_sem(1,"Cache Manager Semaphore"); } void *cacheManager::findBlock(vnode *target,bool readOnly) diff --git a/src/kernel/vm2/vm.h b/src/kernel/vm2/vm.h index c3b88fda6c..2a83335d58 100644 --- a/src/kernel/vm2/vm.h +++ b/src/kernel/vm2/vm.h @@ -26,4 +26,14 @@ enum addressSpec {EXACT,BASE,ANY,ANY_KERNEL,CLONE}; #define CACHE_BEGIN 0x90000000 #define CACHE_END 0xe0000000 +struct vmHeaderBlock +{ + poolarea areaPool; + poolvpage vpagePool; + poolvnode vnodePool; + pageManager pageMan(30); // Obviously this hard coded number is a hack... + swapFileManager swapMan; + cacheManager cacheMan; +}; + #endif