mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@867 be3aeb3a-fb24-0410-a615-afba39da0efa
29 lines
511 B
C
29 lines
511 B
C
#include <stdio.h>
|
|
#ifdef __linux__
|
|
#include <sys/mman.h>
|
|
#endif
|
|
|
|
#include "cmn.h"
|
|
|
|
u8 __attribute__((aligned(4096))) tcache[DRC_TCACHE_SIZE];
|
|
|
|
|
|
void drc_cmn_init(void)
|
|
{
|
|
#ifdef __linux__
|
|
void *tmp;
|
|
|
|
tmp = mmap(tcache, DRC_TCACHE_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
|
|
printf("mmap tcache: %p, asked %p\n", tmp, tcache);
|
|
#endif
|
|
}
|
|
|
|
void drc_cmn_cleanup(void)
|
|
{
|
|
#ifdef __linux__
|
|
int ret;
|
|
ret = munmap(tcache, DRC_TCACHE_SIZE);
|
|
printf("munmap tcache: %i\n", ret);
|
|
#endif
|
|
}
|
|
|