From b64f23d4c36d406fe9741a3ce9a7a03ec342fb3b Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Thu, 21 May 2015 15:00:03 +0200 Subject: [PATCH] hw: free page tables (fix #1573) --- repos/base-hw/src/core/include/platform_pd.h | 4 ++-- repos/base-hw/src/core/platform_pd.cc | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/repos/base-hw/src/core/include/platform_pd.h b/repos/base-hw/src/core/include/platform_pd.h index 3659e21b7f..3966a3a1e5 100644 --- a/repos/base-hw/src/core/include/platform_pd.h +++ b/repos/base-hw/src/core/include/platform_pd.h @@ -89,6 +89,8 @@ class Hw::Address_space : public Genode::Address_space */ Address_space(Kernel::Pd* pd); + ~Address_space(); + /** * Insert memory mapping into translation table of the address space * @@ -170,8 +172,6 @@ class Genode::Platform_pd : public Hw::Address_space, */ Platform_pd(Allocator * md_alloc, char const *label); - ~Platform_pd(); - /** * Bind thread 't' to protection domain * diff --git a/repos/base-hw/src/core/platform_pd.cc b/repos/base-hw/src/core/platform_pd.cc index 14ff569786..f5360b1a00 100644 --- a/repos/base-hw/src/core/platform_pd.cc +++ b/repos/base-hw/src/core/platform_pd.cc @@ -96,6 +96,14 @@ Hw::Address_space::Address_space(Kernel::Pd * pd) } +Hw::Address_space::~Address_space() +{ + flush(platform()->vm_start(), platform()->vm_size()); + destroy(_cma(), _pslab); + destroy(_cma(), _tt); +} + + /************************************* ** Capability_space implementation ** *************************************/ @@ -161,14 +169,6 @@ Platform_pd::Platform_pd(Allocator * md_alloc, char const *label) } -Platform_pd::~Platform_pd() -{ - flush(platform()->vm_start(), platform()->vm_size()); - - /* TODO: destroy page slab and translation table!!! */ -} - - /************************************* ** Core_platform_pd implementation ** *************************************/