41397701 |
1 | #include <stdio.h> |
2 | #if defined(__linux__) && defined(ARM) |
3 | #include <sys/mman.h> |
4 | #endif |
5 | |
6 | #include "cmn.h" |
7 | |
8 | #ifndef ARM |
9 | unsigned int tcache[SSP_TCACHE_SIZE/4]; |
10 | unsigned int *ssp_block_table[0x5090/2]; |
11 | unsigned int *ssp_block_table_iram[15][0x800/2]; |
12 | char ssp_align[SSP_BLOCKTAB_ALIGN_SIZE]; |
13 | #endif |
14 | |
15 | |
16 | void drc_cmn_init(void) |
17 | { |
18 | #if defined(__linux__) && defined(ARM) |
19 | void *tmp; |
20 | |
21 | tmp = mmap(tcache, SSP_DRC_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_SHARED|MAP_ANONYMOUS, -1, 0); |
22 | printf("mmap tcache: %p, asked %p\n", tmp, tcache); |
23 | #endif |
24 | |
25 | } |
26 | |
27 | // TODO: add calls in core, possibly to cart.c? |
28 | void drc_cmn_cleanup(void) |
29 | { |
30 | #if defined(__linux__) && defined(ARM) |
31 | int ret; |
32 | ret = munmap(tcache, SSP_DRC_SIZE); |
33 | printf("munmap tcache: %i\n", ret); |
34 | #endif |
35 | } |
36 | |