diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-04-11 14:49:13 -0500 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2011-04-11 14:49:13 -0500 |
commit | c0776eaa0548fc3ddec21e3113539198fa1cf875 (patch) | |
tree | 11f96dbbbad5e099b0f33502010a15123027a94b /src | |
parent | 55eaeb37070dc1f635dc5f02ed49c7c7bba4627a (diff) | |
download | talos-hostboot-c0776eaa0548fc3ddec21e3113539198fa1cf875.tar.gz talos-hostboot-c0776eaa0548fc3ddec21e3113539198fa1cf875.zip |
VBU: Move dcbz code into PageManager.
The space after our code image but before the first page is unused, so
we only need to dcbz the pages. This reduces any dependency on cache
size in the dcbz loop boundary condition calculations.
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/kernel.C | 12 | ||||
-rw-r--r-- | src/kernel/pagemgr.C | 10 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/kernel/kernel.C b/src/kernel/kernel.C index 5d16033d0..f42498e26 100644 --- a/src/kernel/kernel.C +++ b/src/kernel/kernel.C @@ -75,18 +75,6 @@ void Kernel::cppBootstrap() void Kernel::memBootstrap() { - // Populate L3 cache lines after code space. - // Needs to be rounded up to nearest 256 bytes (cache line size). - uint64_t* cache_line = (uint64_t*) (VFS_LAST_ADDRESS + - ((VFS_LAST_ADDRESS % 256) ? (256 - (VFS_LAST_ADDRESS % 256)) : 0)) - ; - uint64_t* end_cache_line = (uint64_t*) VmmManager::FULL_MEM_SIZE; - while (cache_line != end_cache_line) - { - dcbz(cache_line); - cache_line++; - } - PageManager::init(); HeapManager::init(); VmmManager::init(); diff --git a/src/kernel/pagemgr.C b/src/kernel/pagemgr.C index 972508420..5d6637203 100644 --- a/src/kernel/pagemgr.C +++ b/src/kernel/pagemgr.C @@ -2,6 +2,7 @@ #include <util/singleton.H> #include <kernel/console.H> #include <sys/vfs.h> +#include <arch/ppc.H> void PageManager::init() { @@ -36,6 +37,15 @@ PageManager::PageManager() length, (uint64_t)page); + // Populate L3 cache lines. + uint64_t* cache_line = (uint64_t*) addr; + uint64_t* end_cache_line = (uint64_t*) VmmManager::FULL_MEM_SIZE; + while (cache_line != end_cache_line) + { + dcbz(cache_line); + cache_line++; + } + // Allocate pages to buckets. size_t page_length = BUCKETS-1; while(length > 0) |