MCPcopy Create free account
hub / github.com/Inori/GPCS4 / registerLibC

Function registerLibC

GPCS4/Emulator/RegisterModules.cpp:15–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13 }
14
15static bool registerLibC(CSceModuleSystem* pModuleSystem)
16{
17 bool ret = false;
18 do
19 {
20 if (!pModuleSystem)
21 {
22 break;
23 }
24 auto& policyManager = pModuleSystem->getPolicyManager();
25
26 /**
27 * Defines policy for libc.
28 *
29 * The default policy for this module is Policy::UseBuitlin,
30 * which means when a sub-library of libc is not defined,
31 * it applies the Policy::UseBuiltin by default.
32 *
33 * The libc sub-library uses implementations from native modules
34 * except the symbols listed below.
35 */
36 policyManager.declareModule("libc").withDefault(Policy::UseBuiltin)
37 .declareSubLibrary("libc").with(Policy::UseNative).except
38 ({
39 0xC5E60EE2EEEEC89DULL, // fopen
40 0xAD0155057A7F0B18ULL, // fseek
41 0x40C1722E8A8DC488ULL, // setvbuf
42 0x48796DEC484EB6A0ULL, // fgetpos
43 0x2F170453E202BBC5ULL, // feof
44 0x004B85DC5D9FF130ULL, // fgetc
45 0x007C7284DF7A772EULL, // ferror
46 0x29D3FF9D42E9B86CULL, // fgets
47 0x8245A09F4A7501F5ULL, // freopen
48 0x41ACF2F0B9974EFCULL, // ftell
49 0x95B07E52566A546DULL, // fread
50 0xBA874B632522A76DULL, // fclose
51 0x8105FEE060D08E93ULL, // malloc
52 0x63B689D6EC9D3CCAULL, // realloc
53 0xD97E5A8058CAC4C7ULL, // calloc
54 0xB4886CAA3D2AB051ULL, // free
55 0x5CA45E82C1691299ULL, // catchReturnFromMain
56 0xB8C7A2D56F6EC8DAULL, // exit
57 0xC0B9459301BD51C4ULL, // time
58 0x80D435576BDF5C31ULL, // setjmp
59 0x94A10DD8879B809DULL // longjmp
60 });
61
62 /*
63 * Defines policy for libSceLibcInternal
64 *
65 * We load all of its symbols
66 */
67 policyManager
68 .declareModule("libSceLibcInternal").withDefault(Policy::UseNative);
69
70 ret = true;
71 }while(false);
72 return ret;

Callers 1

registerModulesMethod · 0.85

Calls 5

exceptMethod · 0.80
withMethod · 0.80
declareSubLibraryMethod · 0.80
withDefaultMethod · 0.80
declareModuleMethod · 0.80

Tested by

no test coverage detected