mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
User pointer validity checks.
Added routines that check whether a user pointer is accessible by the kernel, and if not ask the pager to map-in those pages. I haven't implemented yet the bit that asks the pager for paging-in.
This commit is contained in:
@@ -85,4 +85,7 @@ static inline int in_user()
|
||||
return !in_kernel();
|
||||
}
|
||||
|
||||
int pager_pagein_request(unsigned long vaddr, unsigned long size,
|
||||
unsigned int flags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,4 +18,6 @@
|
||||
#define MAP_SVC_DEFAULT_FLAGS MAP_SVC_RW_FLAGS
|
||||
#define MAP_IO_DEFAULT_FLAGS MAP_SVC_IO_FLAGS
|
||||
|
||||
int check_access(unsigned long vaddr, unsigned long size, unsigned int flags);
|
||||
|
||||
#endif /* __SPACE_H__ */
|
||||
|
||||
@@ -116,6 +116,12 @@ void remove_mapping(unsigned long vaddr);
|
||||
void remove_mapping_pgd(unsigned long vaddr, pgd_table_t *pgd);
|
||||
void prealloc_phys_pagedesc(void);
|
||||
|
||||
int check_mapping_pgd(unsigned long vaddr, unsigned long size,
|
||||
unsigned int flags, pgd_table_t *pgd);
|
||||
|
||||
int check_mapping(unsigned long vaddr, unsigned long size,
|
||||
unsigned int flags);
|
||||
|
||||
void copy_pgd_kern_all(pgd_table_t *);
|
||||
pte_t virt_to_pte(unsigned long virtual);
|
||||
pte_t virt_to_pte_from_pgd(unsigned long virtual, pgd_table_t *pgd);
|
||||
|
||||
Reference in New Issue
Block a user