mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-04 18:42:15 +02:00
Compare commits
No commits in common. "0094af6d29c0cf1eaca2839f6948c39c45bdef09" and "94cfa2be1c1cd567f99d387c46643ee9c8efc79a" have entirely different histories.
0094af6d29
...
94cfa2be1c
@ -27,4 +27,3 @@ Result clkrstOpenSession(ClkrstSession* session_out, PcvModuleId module_id, u32
|
|||||||
void clkrstCloseSession(ClkrstSession* session);
|
void clkrstCloseSession(ClkrstSession* session);
|
||||||
Result clkrstSetClockRate(ClkrstSession* session, u32 hz);
|
Result clkrstSetClockRate(ClkrstSession* session, u32 hz);
|
||||||
Result clkrstGetClockRate(ClkrstSession* session, u32 *out_hz);
|
Result clkrstGetClockRate(ClkrstSession* session, u32 *out_hz);
|
||||||
Result clkrstGetPossibleClockRates(ClkrstSession *session, u32 *rates, s32 max_count, PcvClockRatesListType *out_type, s32 *out_count);
|
|
||||||
|
@ -191,13 +191,6 @@ typedef enum {
|
|||||||
PcvModuleId_EXTPERIPH2 = 0x40000057,
|
PcvModuleId_EXTPERIPH2 = 0x40000057,
|
||||||
} PcvModuleId;
|
} PcvModuleId;
|
||||||
|
|
||||||
// Clock list type returned by GetPossibleClockRates
|
|
||||||
typedef enum {
|
|
||||||
PcvClockRatesListType_Invalid = 0,
|
|
||||||
PcvClockRatesListType_Discrete = 1,
|
|
||||||
PcvClockRatesListType_Range = 2,
|
|
||||||
} PcvClockRatesListType;
|
|
||||||
|
|
||||||
/// Initialize pcv.
|
/// Initialize pcv.
|
||||||
Result pcvInitialize(void);
|
Result pcvInitialize(void);
|
||||||
|
|
||||||
@ -217,5 +210,3 @@ Result pcvSetClockRate(PcvModule module, u32 hz);
|
|||||||
Result pcvSetVoltageEnabled(u32 power_domain, bool state);
|
Result pcvSetVoltageEnabled(u32 power_domain, bool state);
|
||||||
/// Only available on [1.0.0-7.0.1].
|
/// Only available on [1.0.0-7.0.1].
|
||||||
Result pcvGetVoltageEnabled(bool *isEnabled, u32 power_domain);
|
Result pcvGetVoltageEnabled(bool *isEnabled, u32 power_domain);
|
||||||
/// Only available on [1.0.0-7.0.1].
|
|
||||||
Result pcvGetPossibleClockRates(PcvModule module, u32 *rates, s32 max_count, PcvClockRatesListType *out_type, s32 *out_count);
|
|
||||||
|
@ -261,9 +261,8 @@ static inline void _aes128CbcDecryptBlocks(Aes128CbcContext *ctx, u8 *dst_u8, co
|
|||||||
AES_ENC_DEC_INPUT_ROUND_KEY(10)
|
AES_ENC_DEC_INPUT_ROUND_KEY(10)
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Do XOR for CBC. */
|
/* Update IV. */
|
||||||
tmp0 = veorq_u8(tmp0, cur_iv);
|
cur_iv = tmp0;
|
||||||
cur_iv = block0;
|
|
||||||
|
|
||||||
/* Store to output. */
|
/* Store to output. */
|
||||||
vst1q_u8(dst_u8, tmp0);
|
vst1q_u8(dst_u8, tmp0);
|
||||||
@ -479,9 +478,8 @@ static inline void _aes192CbcDecryptBlocks(Aes192CbcContext *ctx, u8 *dst_u8, co
|
|||||||
AES_ENC_DEC_INPUT_ROUND_KEY(12)
|
AES_ENC_DEC_INPUT_ROUND_KEY(12)
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Do XOR for CBC. */
|
/* Update IV. */
|
||||||
tmp0 = veorq_u8(tmp0, cur_iv);
|
cur_iv = tmp0;
|
||||||
cur_iv = block0;
|
|
||||||
|
|
||||||
/* Store to output. */
|
/* Store to output. */
|
||||||
vst1q_u8(dst_u8, tmp0);
|
vst1q_u8(dst_u8, tmp0);
|
||||||
@ -713,9 +711,8 @@ static inline void _aes256CbcDecryptBlocks(Aes256CbcContext *ctx, u8 *dst_u8, co
|
|||||||
AES_ENC_DEC_INPUT_ROUND_KEY(14)
|
AES_ENC_DEC_INPUT_ROUND_KEY(14)
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Do XOR for CBC. */
|
/* Update IV. */
|
||||||
tmp0 = veorq_u8(tmp0, cur_iv);
|
cur_iv = tmp0;
|
||||||
cur_iv = block0;
|
|
||||||
|
|
||||||
/* Store to output. */
|
/* Store to output. */
|
||||||
vst1q_u8(dst_u8, tmp0);
|
vst1q_u8(dst_u8, tmp0);
|
||||||
|
@ -44,20 +44,3 @@ Result clkrstSetClockRate(ClkrstSession* session, u32 hz) {
|
|||||||
Result clkrstGetClockRate(ClkrstSession* session, u32 *out_hz) {
|
Result clkrstGetClockRate(ClkrstSession* session, u32 *out_hz) {
|
||||||
return serviceDispatchOut(&session->s, 8, *out_hz);
|
return serviceDispatchOut(&session->s, 8, *out_hz);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result clkrstGetPossibleClockRates(ClkrstSession *session, u32 *rates, s32 max_count, PcvClockRatesListType *out_type, s32 *out_count) {
|
|
||||||
struct {
|
|
||||||
s32 type;
|
|
||||||
s32 count;
|
|
||||||
} out;
|
|
||||||
|
|
||||||
Result rc = serviceDispatchInOut(&session->s, 10, max_count, out,
|
|
||||||
.buffer_attrs = { SfBufferAttr_Out | SfBufferAttr_HipcAutoSelect, },
|
|
||||||
.buffers = { { rates, max_count * sizeof(u32) }, }
|
|
||||||
);
|
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc) && out_type) *out_type = out.type;
|
|
||||||
if (R_SUCCEEDED(rc) && out_count) *out_count = out.count;
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
@ -94,28 +94,3 @@ Result pcvGetVoltageEnabled(bool *isEnabled, u32 power_domain) {
|
|||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result pcvGetPossibleClockRates(PcvModule module, u32 *rates, s32 max_count, PcvClockRatesListType *out_type, s32 *out_count) {
|
|
||||||
if(hosversionAtLeast(8,0,0))
|
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
|
||||||
|
|
||||||
const struct {
|
|
||||||
PcvModule module;
|
|
||||||
s32 max_count;
|
|
||||||
} in = { module, max_count };
|
|
||||||
|
|
||||||
struct {
|
|
||||||
s32 type;
|
|
||||||
s32 count;
|
|
||||||
} out;
|
|
||||||
|
|
||||||
Result rc = serviceDispatchInOut(&g_pcvSrv, 5, in, out,
|
|
||||||
.buffer_attrs = { SfBufferAttr_Out | SfBufferAttr_HipcPointer, },
|
|
||||||
.buffers = { { rates, max_count * sizeof(u32) }, }
|
|
||||||
);
|
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc) && out_type) *out_type = out.type;
|
|
||||||
if (R_SUCCEEDED(rc) && out_count) *out_count = out.count;
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user