shadPS4/src/core/hle/libraries/libs.h

42 lines
2.7 KiB
C
Raw Normal View History

2024-02-23 21:32:32 +00:00
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2023-06-26 17:45:16 +00:00
#pragma once
2023-11-05 23:11:54 +00:00
#include "core/loader/elf.h"
#include "core/loader/symbols_resolver.h"
2023-07-13 09:56:36 +00:00
#define LIB_FUNCTION(nid, lib, libversion, mod, moduleVersionMajor, moduleVersionMinor, function) \
{ \
Core::Loader::SymbolResolver sr{}; \
sr.name = nid; \
sr.library = lib; \
sr.library_version = libversion; \
sr.module = mod; \
sr.module_version_major = moduleVersionMajor; \
sr.module_version_minor = moduleVersionMinor; \
sr.type = Core::Loader::SymbolType::Function; \
auto func = reinterpret_cast<u64>(function); \
sym->AddSymbol(sr, func); \
}
#define LIB_OBJ(nid, lib, libversion, mod, moduleVersionMajor, moduleVersionMinor, function) \
{ \
Core::Loader::SymbolResolver sr{}; \
sr.name = nid; \
sr.library = lib; \
sr.library_version = libversion; \
sr.module = mod; \
sr.module_version_major = moduleVersionMajor; \
sr.module_version_minor = moduleVersionMinor; \
sr.type = Core::Loader::SymbolType::Object; \
auto func = reinterpret_cast<u64>(function); \
sym->AddSymbol(sr, func); \
}
2023-11-05 23:11:54 +00:00
namespace Core::Libraries {
void InitHLELibs(Loader::SymbolsResolver* sym);
} // namespace Core::Libraries