1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
3 * Copyright (C) 2022 Paul Cercueil <paul@crapouillou.net>
6 #ifndef __LIGHTREC_MEM_H__
7 #define __LIGHTREC_MEM_H__
11 #ifdef HW_WUP /* WiiU */
12 # define WUP_RWX_MEM_BASE 0x00802000
13 # define WUP_RWX_MEM_END 0x01000000
14 # define CODE_BUFFER_SIZE_DFT (WUP_RWX_MEM_END - WUP_RWX_MEM_BASE)
16 # define CODE_BUFFER_SIZE_DFT (8 * 1024 * 1024)
19 #ifndef CODE_BUFFER_SIZE
20 #define CODE_BUFFER_SIZE CODE_BUFFER_SIZE_DFT
23 extern void *code_buffer;
25 int lightrec_init_mmap(void);
26 void lightrec_free_mmap(void);
28 #else /* if !LIGHTREC */
30 #define lightrec_init_mmap() -1 /* should not be called */
31 #define lightrec_free_mmap()
33 #undef LIGHTREC_CUSTOM_MAP
34 #define LIGHTREC_CUSTOM_MAP 0
38 #endif /* __LIGHTREC_MEM_H__ */