cff531af |
1 | /* |
2 | * PicoDrive |
3 | * Copyright (C) 2009,2010 notaz |
4 | * |
5 | * This work is licensed under the terms of MAME license. |
6 | * See COPYING file in the top-level directory. |
7 | */ |
41397701 |
8 | #include <stdio.h> |
7f5a3fc1 |
9 | #ifdef __linux__ |
41397701 |
10 | #include <sys/mman.h> |
11 | #endif |
12 | |
13 | #include "cmn.h" |
14 | |
f4bb5d6b |
15 | u8 __attribute__((aligned(4096))) tcache[DRC_TCACHE_SIZE]; |
41397701 |
16 | |
17 | |
18 | void drc_cmn_init(void) |
19 | { |
7f5a3fc1 |
20 | #ifdef __linux__ |
41397701 |
21 | void *tmp; |
22 | |
a736af3e |
23 | tmp = mmap(tcache, DRC_TCACHE_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); |
41397701 |
24 | printf("mmap tcache: %p, asked %p\n", tmp, tcache); |
25 | #endif |
41397701 |
26 | } |
27 | |
41397701 |
28 | void drc_cmn_cleanup(void) |
29 | { |
7f5a3fc1 |
30 | #ifdef __linux__ |
41397701 |
31 | int ret; |
679af8a3 |
32 | ret = munmap(tcache, DRC_TCACHE_SIZE); |
41397701 |
33 | printf("munmap tcache: %i\n", ret); |
34 | #endif |
35 | } |
36 | |