plugin_lib: fix a silly crash
[pcsx_rearmed.git] / libpcsxcore / lightrec / mem.c
index ff67e3d..91bd908 100644 (file)
@@ -3,7 +3,9 @@
  * Copyright (C) 2022 Paul Cercueil <paul@crapouillou.net>
  */
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #include <errno.h>
 #include <fcntl.h>
 #include <stdbool.h>
@@ -31,8 +33,6 @@
 #define MFD_HUGETLB 0x0004
 #endif
 
-void *code_buffer;
-
 static const uintptr_t supported_io_bases[] = {
        0x0,
        0x10000000,
@@ -190,7 +190,7 @@ int lightrec_init_mmap(void)
 err_unmap_scratch:
        munmap(psxH, 0x10000);
 err_unmap_bios:
-       munmap(psxR, 0x80000);
+       munmap(psxR, 0x200000);
 err_unmap_parallel:
        munmap(psxP, 0x10000);
 err_unmap:
@@ -205,7 +205,7 @@ void lightrec_free_mmap(void)
 
        munmap(code_buffer, CODE_BUFFER_SIZE);
        munmap(psxH, 0x10000);
-       munmap(psxR, 0x80000);
+       munmap(psxR, 0x200000);
        munmap(psxP, 0x10000);
        for (i = 0; i < 4; i++)
                munmap((void *)((uintptr_t)psxM + i * 0x200000), 0x200000);