X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=linux%2Fplat.c;h=492007cd853474ac02eb614d5525f02dfc735018;hb=997b2e4ff9773b32d81bb8e1faa17bb9c379f68b;hp=d777f23b2a09f29d011bc54ea4133715e37ac20c;hpb=5ff8efa9e5947664c2b6a5a195e375362818e05e;p=libpicofe.git diff --git a/linux/plat.c b/linux/plat.c index d777f23..492007c 100644 --- a/linux/plat.c +++ b/linux/plat.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "../common/plat.h" @@ -108,3 +109,21 @@ int plat_wait_event(int *fds_hnds, int count, int timeout_ms) return ret; } +void *plat_mmap(unsigned long addr, size_t size) +{ + void *req, *ret; + req = (void *)addr; + ret = mmap(req, size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0); + if (ret == MAP_FAILED) + return NULL; + if (ret != req) + printf("warning: mmaped to %p, requested %p\n", ret, req); + + return ret; +} + +void plat_munmap(void *ptr, size_t size) +{ + munmap(ptr, size); +} +