kern: further codegen tweaks

This commit is contained in:
Michael Scire 2021-01-08 02:35:29 -08:00
parent 4aa18b06e8
commit 1e643f7ab0
7 changed files with 35 additions and 35 deletions

View file

@ -583,15 +583,15 @@ namespace ams::kern::board::nintendo::nx {
constinit KMemoryControllerInterruptTask g_mc_interrupt_task;
/* Memory controller utilities. */
void SmmuSynchronizationBarrier() {
ALWAYS_INLINE void SmmuSynchronizationBarrier() {
ReadMcRegister(MC_SMMU_CONFIG);
}
void InvalidatePtc() {
ALWAYS_INLINE void InvalidatePtc() {
WriteMcRegister(MC_SMMU_PTC_FLUSH_0, 0);
}
void InvalidatePtc(KPhysicalAddress address) {
ALWAYS_INLINE void InvalidatePtc(KPhysicalAddress address) {
WriteMcRegister(MC_SMMU_PTC_FLUSH_1, (static_cast<u64>(GetInteger(address)) >> 32));
WriteMcRegister(MC_SMMU_PTC_FLUSH_0, (GetInteger(address) & 0xFFFFFFF0u) | 1u);
}
@ -606,15 +606,15 @@ namespace ams::kern::board::nintendo::nx {
return ((match_asid ? 1u : 0u) << 31) | ((asid & 0x7F) << 24) | (((address & 0xFFC00000u) >> DevicePageBits)) | (match);
}
void InvalidateTlb() {
ALWAYS_INLINE void InvalidateTlb() {
return WriteMcRegister(MC_SMMU_TLB_FLUSH, EncodeTlbFlushValue(false, 0, 0, TlbFlushVaMatch_All));
}
void InvalidateTlb(u8 asid) {
ALWAYS_INLINE void InvalidateTlb(u8 asid) {
return WriteMcRegister(MC_SMMU_TLB_FLUSH, EncodeTlbFlushValue(true, asid, 0, TlbFlushVaMatch_All));
}
void InvalidateTlbSection(u8 asid, KDeviceVirtualAddress address) {
ALWAYS_INLINE void InvalidateTlbSection(u8 asid, KDeviceVirtualAddress address) {
return WriteMcRegister(MC_SMMU_TLB_FLUSH, EncodeTlbFlushValue(true, asid, address, TlbFlushVaMatch_Section));
}

View file

@ -37,7 +37,7 @@ namespace ams::kern {
uintptr_t m_msg_buffer_end;
uintptr_t m_msg_buffer_space_end;
public:
static constexpr int GetEntryCount(const ipc::MessageBuffer::MessageHeader &header) {
static constexpr ALWAYS_INLINE int GetEntryCount(const ipc::MessageBuffer::MessageHeader &header) {
const auto count = header.GetReceiveListCount();
switch (count) {
case ipc::MessageBuffer::MessageHeader::ReceiveListCountType_None:
@ -82,7 +82,7 @@ namespace ams::kern {
}
}
constexpr bool IsIndex() const {
constexpr ALWAYS_INLINE bool IsIndex() const {
return m_recv_list_count > ipc::MessageBuffer::MessageHeader::ReceiveListCountType_CountOffset;
}