00001
00002
00003 #ifndef _CORE_MEMORY_SHMEM_HPP
00004 #define _CORE_MEMORY_SHMEM_HPP
00005
00006 #include "src/ipc/lock.hpp"
00007 #include "src/memory/pager.hpp"
00008
00009 namespace Memory {
00010 namespace Shmem {
00011
00012 struct shmem_t
00013 {
00014 class blist_t li;
00015 int cnt, cows;
00016 uint32 size;
00017 bool super;
00018 uint32 *pgs;
00019 };
00020
00021 struct shmem_s
00022 {
00023 struct shmem_t *sm;
00024 class Memory::Pager::memtree *tree;
00025 bool cow;
00026 uint32 offset;
00027 uint32 virtaddr;
00028 uint32 lgth;
00029 };
00030
00031 int shmem_create(struct shmem_t *sh, class Memory::Pager::memtree *tree, uint32 virtaddr, uint32 size, bool cow, bool super);
00032 int shmem_attach(struct shmem_t *sh, class Memory::Pager::memtree *tree, uint32 virtaddr, uint32 offset, uint32 lgth, bool cow);
00033 int shmem_mapdone(mmap_t *mpt, mmap_s *mps);
00034 int shmem_roall(struct shmem_t *sh);
00035 int shmem_map(struct shmem_s *sh);
00036
00037 };
00038 };
00039
00040 int shmem_paging_pfh(struct env_t *en, uint32 virt, uint32 phys);
00041
00042 #endif