summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/build/linker/linker.C3
-rw-r--r--src/include/sys/vfs.h2
-rw-r--r--src/sys/vfs/vfs_init.C3
-rw-r--r--src/usr/vfs/vfsrp.C6
4 files changed, 8 insertions, 6 deletions
diff --git a/src/build/linker/linker.C b/src/build/linker/linker.C
index e0acbdef4..2da9e881e 100644
--- a/src/build/linker/linker.C
+++ b/src/build/linker/linker.C
@@ -956,6 +956,7 @@ void ModuleTable::write_table(vector<Object> & i_objects)
text_offset = i->text.vma_offset + i->offset + i->base_addr;
data_offset = i->data.vma_offset + i->offset + i->base_addr;
module_size = i->data.vma_offset + i->data.size;
+ module_size = page_align(module_size);
}
else // binary blob
{
@@ -966,7 +967,7 @@ void ModuleTable::write_table(vector<Object> & i_objects)
fclose(f);
}
- module_size = page_align(module_size)/4096;
+ //module_size = page_align(module_size)/4096;
char data[sizeof(uint64_t)];
diff --git a/src/include/sys/vfs.h b/src/include/sys/vfs.h
index d427c0abb..155851398 100644
--- a/src/include/sys/vfs.h
+++ b/src/include/sys/vfs.h
@@ -81,7 +81,7 @@ struct VfsSystemModule
void (*fini)(void*); //!< ptr to fini()
uint64_t * text; //!< ptr to text (code) section
uint64_t * data; //!< ptr to data section
- uint64_t page_count; //!< no. of memory pages used
+ uint64_t byte_count; //!< no. of memory pages used
};
extern VfsSystemModule VFS_MODULES[VFS_MODULE_MAX];
diff --git a/src/sys/vfs/vfs_init.C b/src/sys/vfs/vfs_init.C
index ad08d0d7f..91e09876f 100644
--- a/src/sys/vfs/vfs_init.C
+++ b/src/sys/vfs/vfs_init.C
@@ -28,6 +28,7 @@
#include <kernel/console.H>
#include <limits.h>
#include <sys/mm.h>
+#include <util/align.H>
VfsSystemModule VFS_MODULES[VFS_MODULE_MAX];
uint64_t VFS_LAST_ADDRESS;
@@ -36,7 +37,7 @@ uint64_t VFS_LAST_ADDRESS;
int vfs_module_perms(VfsSystemModule* module)
{
int rc = 0;
- uint64_t memsize = (module->page_count*PAGESIZE);
+ uint64_t memsize = ALIGN_PAGE(module->byte_count);
uint64_t textsize= (uint64_t)module->data - (uint64_t)module->text;
uint64_t datasize = memsize - textsize;
diff --git a/src/usr/vfs/vfsrp.C b/src/usr/vfs/vfsrp.C
index 6f8f41620..e060c7b80 100644
--- a/src/usr/vfs/vfsrp.C
+++ b/src/usr/vfs/vfsrp.C
@@ -283,12 +283,12 @@ void VfsRp::_load_unload(msg_t * i_msg)
}
rc = mm_set_permission(module->text,
- module->page_count*PAGESIZE,
+ ALIGN_PAGE(module->byte_count),
NO_ACCESS);
rc = mm_remove_pages(RELEASE,
module->text,
- module->page_count*PAGESIZE);
+ ALIGN_PAGE(module->byte_count));
}
if(rc)
{
@@ -513,7 +513,7 @@ errlHndl_t VFS::module_address(const char * i_name, const char *& o_address, siz
else
{
o_address = (const char *)vfs->data;
- o_size = vfs->page_count * PAGESIZE;
+ o_size = vfs->byte_count;
}
return err;
}
OpenPOWER on IntegriCloud