mirror of
https://github.com/drasko/codezero.git
synced 2026-02-18 12:53:19 +01:00
Added first part of extended ipc support.
- Extended ipc tests - Need to copy from ktcb-to-ktcb instead of ktcb-to-user - Need to check flags of both ipc parties before ipc copy type.
This commit is contained in:
@@ -162,17 +162,24 @@ struct address_space *address_space_create(struct address_space *orig)
|
||||
int check_access(unsigned long vaddr, unsigned long size, unsigned int flags, int page_in)
|
||||
{
|
||||
int err;
|
||||
unsigned long start, end, mapsize;
|
||||
|
||||
/* Do not allow ridiculously big sizes */
|
||||
if (size >= USER_AREA_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
/* Get lower and upper page boundaries */
|
||||
start = page_align(vaddr);
|
||||
end = page_align_up(vaddr + size);
|
||||
mapsize = end - start;
|
||||
|
||||
/* Check if the address is mapped with given flags */
|
||||
if (!check_mapping(vaddr, size, flags)) {
|
||||
if (!check_mapping(start, mapsize, flags)) {
|
||||
/* Is a page in requested? */
|
||||
if (page_in) {
|
||||
/* Ask pager if paging in is possible */
|
||||
if((err = pager_pagein_request(vaddr, size, flags)) < 0)
|
||||
if((err = pager_pagein_request(start, mapsize,
|
||||
flags)) < 0)
|
||||
return err;
|
||||
} else
|
||||
return -EFAULT;
|
||||
|
||||
Reference in New Issue
Block a user