-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathpsp-profile.c
More file actions
111 lines (85 loc) · 3.68 KB
/
Copy pathpsp-profile.c
File metadata and controls
111 lines (85 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/** @file
* PSP Emulator - PSP profile management.
*/
/*
* Copyright (C) 2020 Alexander Eichner <alexander.eichner@campus.tu-berlin.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#include <string.h>
#include <common/cdefs.h>
#include <psp-profile.h>
/*********************************************************************************************************************************
* Structures and Typedefs *
*********************************************************************************************************************************/
/** Ranges block in proxy mode get included here. */
#include "profiles/proxy-blocked-range-std.h"
/* PSP profiles get included here first. */
#include "profiles/amd-psp-zen.h"
#include "profiles/amd-psp-zen-plus.h"
#include "profiles/amd-psp-zen-2.h"
#include "profiles/amd-psp-zen-3.h"
/* CPU profiles get included here.*/
#include "profiles/amd-cpu-zen-synthetic.h"
#include "profiles/amd-cpu-ryzen7-1800x.h"
#include "profiles/amd-cpu-ryzen5-5600x.h"
/*********************************************************************************************************************************
* Global Variables *
*********************************************************************************************************************************/
/**
* Supported PSP profiles.
*/
static PCPSPPROFILE g_aPspProfiles[] =
{
&g_PspProfileZen,
&g_PspProfileZenPlus,
&g_PspProfileZen2,
&g_PspProfileZen3
};
/**
* Supported CPU profiles.
*/
static PCPSPAMDCPUPROFILE g_aCpuProfiles[] =
{
&g_AmdCpu_Zen_Synthetic,
&g_AmdCpu_Ryzen7_1800X,
&g_AmdCpu_Ryzen5_5600X
};
/*********************************************************************************************************************************
* Internal Functions *
*********************************************************************************************************************************/
PCPSPPROFILE PSPProfilePspGetById(const char *pszId)
{
for (uint32_t i = 0; i < ELEMENTS(g_aPspProfiles); i++)
{
if (!strcmp(g_aPspProfiles[i]->pszId, pszId))
return g_aPspProfiles[i];
}
return NULL;
}
PCPSPAMDCPUPROFILE PSPProfileAmdCpuGetById(const char *pszId)
{
for (uint32_t i = 0; i < ELEMENTS(g_aCpuProfiles); i++)
{
if (!strcmp(g_aCpuProfiles[i]->pszId, pszId))
return g_aCpuProfiles[i];
}
return NULL;
}
PCPSPAMDCPUPROFILE PSPProfileAmdCpuGetDefault(void)
{
return &g_AmdCpu_Zen_Synthetic;
}