git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix typos, some refinements
[lunaix-os.git]
/
lunaix-os
/
kernel
/
mm
/
region.c
diff --git
a/lunaix-os/kernel/mm/region.c
b/lunaix-os/kernel/mm/region.c
index a2bf82e3f6f877891b74cd6d676fa01cc9d03a53..8e9b5c7fa105d9625fce2a4914e2ddee2f4ee24e 100644
(file)
--- a/
lunaix-os/kernel/mm/region.c
+++ b/
lunaix-os/kernel/mm/region.c
@@
-1,18
+1,17
@@
-#include <lunaix/mm/page.h>
#include <lunaix/mm/region.h>
#include <lunaix/mm/valloc.h>
#include <lunaix/spike.h>
#include <lunaix/process.h>
#include <lunaix/mm/region.h>
#include <lunaix/mm/valloc.h>
#include <lunaix/spike.h>
#include <lunaix/process.h>
-#include <
sys/m
m/mempart.h>
+#include <
as
m/mempart.h>
#include <klibc/string.h>
struct mm_region*
region_create(ptr_t start, ptr_t end, u32_t attr)
{
#include <klibc/string.h>
struct mm_region*
region_create(ptr_t start, ptr_t end, u32_t attr)
{
- assert_msg(
PG_ALIGNED
(start), "not page aligned");
- assert_msg(
PG_ALIGNED
(end), "not page aligned");
+ assert_msg(
!va_offset
(start), "not page aligned");
+ assert_msg(
!va_offset
(end), "not page aligned");
struct mm_region* region = valloc(sizeof(struct mm_region));
*region =
(struct mm_region){ .attr = attr, .start = start, .end = end - 1 };
struct mm_region* region = valloc(sizeof(struct mm_region));
*region =
(struct mm_region){ .attr = attr, .start = start, .end = end - 1 };
@@
-22,12
+21,12
@@
region_create(ptr_t start, ptr_t end, u32_t attr)
struct mm_region*
region_create_range(ptr_t start, size_t length, u32_t attr)
{
struct mm_region*
region_create_range(ptr_t start, size_t length, u32_t attr)
{
- assert_msg(
PG_ALIGNED
(start), "not page aligned");
- assert_msg(
PG_ALIGNED
(length), "not page aligned");
+ assert_msg(
!va_offset
(start), "not page aligned");
+ assert_msg(
!va_offset
(length), "not page aligned");
struct mm_region* region = valloc(sizeof(struct mm_region));
*region = (struct mm_region){ .attr = attr,
.start = start,
struct mm_region* region = valloc(sizeof(struct mm_region));
*region = (struct mm_region){ .attr = attr,
.start = start,
- .end = ROUNDUP(start + length,
MEM_PAG
E) };
+ .end = ROUNDUP(start + length,
PAGE_SIZ
E) };
return region;
}
return region;
}
@@
-131,7
+130,7
@@
region_get(vm_regions_t* lead, unsigned long vaddr)
struct mm_region *pos, *n;
struct mm_region *pos, *n;
- vaddr =
PG_ALIGN
(vaddr);
+ vaddr =
page_aligned
(vaddr);
llist_for_each(pos, n, lead, head)
{
llist_for_each(pos, n, lead, head)
{