Compare commits
3 Commits
1.3.2
...
gcc-12-sup
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7557b7eb92 | ||
|
|
187745abd5 | ||
|
|
4db485083b |
@@ -843,7 +843,7 @@ namespace ams::ncm {
|
|||||||
R_SUCCEED_IF(m_header.has_value());
|
R_SUCCEED_IF(m_header.has_value());
|
||||||
|
|
||||||
/* Get our header. */
|
/* Get our header. */
|
||||||
PatchMetaExtendedDataHeader header;
|
PatchMetaExtendedDataHeader header{};
|
||||||
R_TRY(this->GetHeader(std::addressof(header)));
|
R_TRY(this->GetHeader(std::addressof(header)));
|
||||||
|
|
||||||
/* Set our header. */
|
/* Set our header. */
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ namespace ams::pwm::driver {
|
|||||||
virtual Result SetPeriod(IPwmDevice *device, TimeSpan period) = 0;
|
virtual Result SetPeriod(IPwmDevice *device, TimeSpan period) = 0;
|
||||||
virtual Result GetPeriod(TimeSpan *out, IPwmDevice *device) = 0;
|
virtual Result GetPeriod(TimeSpan *out, IPwmDevice *device) = 0;
|
||||||
|
|
||||||
|
/* TODO: Nintendo removed these in 14.0.0. Should we? */
|
||||||
virtual Result SetDuty(IPwmDevice *device, int duty) = 0;
|
virtual Result SetDuty(IPwmDevice *device, int duty) = 0;
|
||||||
virtual Result GetDuty(int *out, IPwmDevice *device) = 0;
|
virtual Result GetDuty(int *out, IPwmDevice *device) = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -18,14 +18,14 @@
|
|||||||
#include <vapours.hpp>
|
#include <vapours.hpp>
|
||||||
#include <stratosphere/pwm/pwm_types.hpp>
|
#include <stratosphere/pwm/pwm_types.hpp>
|
||||||
|
|
||||||
#define AMS_PWM_I_CHANNEL_SESSION_INTERFACE_INFO(C, H) \
|
#define AMS_PWM_I_CHANNEL_SESSION_INTERFACE_INFO(C, H) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 0, Result, SetPeriod, (TimeSpanType period), (period) ) \
|
AMS_SF_METHOD_INFO(C, H, 0, Result, SetPeriod, (TimeSpanType period), (period)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 1, Result, GetPeriod, (ams::sf::Out<TimeSpanType> out), (out) ) \
|
AMS_SF_METHOD_INFO(C, H, 1, Result, GetPeriod, (ams::sf::Out<TimeSpanType> out), (out)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 2, Result, SetDuty, (int duty), (duty) ) \
|
AMS_SF_METHOD_INFO(C, H, 2, Result, SetDuty, (int duty), (duty), hos::Version_Min, hos::Version_13_2_1) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 3, Result, GetDuty, (ams::sf::Out<int> out), (out) ) \
|
AMS_SF_METHOD_INFO(C, H, 3, Result, GetDuty, (ams::sf::Out<int> out), (out), hos::Version_Min, hos::Version_13_2_1) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 4, Result, SetEnabled, (bool enabled), (enabled) ) \
|
AMS_SF_METHOD_INFO(C, H, 4, Result, SetEnabled, (bool enabled), (enabled)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 5, Result, GetEnabled, (ams::sf::Out<bool> out), (out) ) \
|
AMS_SF_METHOD_INFO(C, H, 5, Result, GetEnabled, (ams::sf::Out<bool> out), (out)) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 6, Result, SetScale, (double scale), (scale), hos::Version_6_0_0) \
|
AMS_SF_METHOD_INFO(C, H, 6, Result, SetScale, (double scale), (scale), hos::Version_6_0_0) \
|
||||||
AMS_SF_METHOD_INFO(C, H, 7, Result, GetScale, (ams::sf::Out<double> out), (out), hos::Version_6_0_0)
|
AMS_SF_METHOD_INFO(C, H, 7, Result, GetScale, (ams::sf::Out<double> out), (out), hos::Version_6_0_0)
|
||||||
|
|
||||||
AMS_SF_DEFINE_INTERFACE(ams::pwm::sf, IChannelSession, AMS_PWM_I_CHANNEL_SESSION_INTERFACE_INFO, 0xAC0A18F9)
|
AMS_SF_DEFINE_INTERFACE(ams::pwm::sf, IChannelSession, AMS_PWM_I_CHANNEL_SESSION_INTERFACE_INFO, 0xAC0A18F9)
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ init_libnx_shim.os.horizon.o: CXXFLAGS += -fno-lto
|
|||||||
|
|
||||||
result_get_name.o: CXXFLAGS += -fno-lto
|
result_get_name.o: CXXFLAGS += -fno-lto
|
||||||
|
|
||||||
|
crypto_sha256_generator.o: CXXFLAGS += -fno-lto
|
||||||
|
|
||||||
spl_secure_monitor_api.os.generic.o: CXXFLAGS += -I$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/include
|
spl_secure_monitor_api.os.generic.o: CXXFLAGS += -I$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/include
|
||||||
fs_id_string_impl.os.generic.o: CXXFLAGS += -I$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/include
|
fs_id_string_impl.os.generic.o: CXXFLAGS += -I$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/include
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ namespace ams::pwm::driver::board::nintendo::nx::impl {
|
|||||||
/* Configure initial settings. */
|
/* Configure initial settings. */
|
||||||
/* NOTE: None of these results are checked. */
|
/* NOTE: None of these results are checked. */
|
||||||
this->SetEnabled(device, false);
|
this->SetEnabled(device, false);
|
||||||
this->SetDuty(device, 0);
|
this->SetScale(device, 0.0);
|
||||||
this->SetPeriod(device, DefaultChannelPeriod);
|
this->SetPeriod(device, DefaultChannelPeriod);
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
@@ -169,8 +169,16 @@ namespace ams::pwm::driver::board::nintendo::nx::impl {
|
|||||||
/* Convert the scale to a duty. */
|
/* Convert the scale to a duty. */
|
||||||
const int duty = static_cast<int>(((scale * 256.0) / 100.0) + 0.5);
|
const int duty = static_cast<int>(((scale * 256.0) / 100.0) + 0.5);
|
||||||
|
|
||||||
/* Set the duty. */
|
/* Validate the duty. */
|
||||||
R_RETURN(this->SetDuty(device, duty));
|
R_UNLESS(0 <= duty && duty <= MaxDuty, pwm::ResultInvalidArgument());
|
||||||
|
|
||||||
|
/* Acquire exclusive access to the device registers. */
|
||||||
|
std::scoped_lock lk(device->SafeCastTo<PwmDeviceImpl>());
|
||||||
|
|
||||||
|
/* Update the duty. */
|
||||||
|
reg::ReadWrite(this->GetRegistersFor(device) + PWM_CONTROLLER_PWM_CSR, PWM_REG_BITS_VALUE(PWM_CSR_PWM, static_cast<u32>(duty)));
|
||||||
|
|
||||||
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
Result PwmDriverImpl::GetScale(double *out, IPwmDevice *device) {
|
Result PwmDriverImpl::GetScale(double *out, IPwmDevice *device) {
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ namespace ams::crypto {
|
|||||||
};
|
};
|
||||||
static constexpr size_t Asn1IdentifierSize = util::size(Asn1Identifier);
|
static constexpr size_t Asn1IdentifierSize = util::size(Asn1Identifier);
|
||||||
private:
|
private:
|
||||||
Impl m_impl;
|
Impl m_impl{};
|
||||||
public:
|
public:
|
||||||
Sha256Generator() { /* ... */ }
|
Sha256Generator() = default;
|
||||||
|
|
||||||
void Initialize() {
|
void Initialize() {
|
||||||
m_impl.Initialize();
|
m_impl.Initialize();
|
||||||
|
|||||||
@@ -144,12 +144,12 @@ namespace ams::util {
|
|||||||
|
|
||||||
template<std::integral T>
|
template<std::integral T>
|
||||||
constexpr ALWAYS_INLINE void StoreBigEndian(T *ptr, T val) {
|
constexpr ALWAYS_INLINE void StoreBigEndian(T *ptr, T val) {
|
||||||
*ptr = ConvertToBigEndian<T>(val);
|
*static_cast<volatile T *>(ptr) = ConvertToBigEndian<T>(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<std::integral T>
|
template<std::integral T>
|
||||||
constexpr ALWAYS_INLINE void StoreLittleEndian(T *ptr, T val) {
|
constexpr ALWAYS_INLINE void StoreLittleEndian(T *ptr, T val) {
|
||||||
*ptr = ConvertToLittleEndian<T>(val);
|
*static_cast<volatile T *>(ptr) = ConvertToLittleEndian<T>(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
namespace ams::crypto {
|
namespace ams::crypto {
|
||||||
|
|
||||||
void GenerateSha256(void *dst, size_t dst_size, const void *src, size_t src_size) {
|
void GenerateSha256(void *dst, size_t dst_size, const void *src, size_t src_size) {
|
||||||
Sha256Generator gen;
|
Sha256Generator gen{};
|
||||||
|
|
||||||
gen.Initialize();
|
gen.Initialize();
|
||||||
gen.Update(src, src_size);
|
gen.Update(src, src_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user