32x: drc: new smc handling, write handlers adjusted.
[picodrive.git] / cpu / drc / cmn.c
1 #include <stdio.h>
2 #if defined(__linux__) && defined(ARM)
3 #include <sys/mman.h>
4 #endif
5
6 #include "cmn.h"
7
8 u8 __attribute__((aligned(4096))) tcache[DRC_TCACHE_SIZE];
9
10
11 void drc_cmn_init(void)
12 {
13 #if defined(__linux__) && defined(ARM)
14         void *tmp;
15
16         tmp = mmap(tcache, DRC_TCACHE_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
17         printf("mmap tcache: %p, asked %p\n", tmp, tcache);
18 #endif
19
20 }
21
22 // TODO: add calls in core, possibly to cart.c?
23 void drc_cmn_cleanup(void)
24 {
25 #if defined(__linux__) && defined(ARM)
26         int ret;
27         ret = munmap(tcache, DRC_TCACHE_SIZE);
28         printf("munmap tcache: %i\n", ret);
29 #endif
30 }
31