mirror of
https://github.com/revyos/thead-opensbi.git
synced 2026-07-20 23:18:02 +02:00
Compare commits
3 Commits
Linux_SDK_
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
513f62819b | ||
|
|
bfbb0a7b5d | ||
|
|
aad6533a3b |
@@ -14,7 +14,7 @@
|
|||||||
#include <sbi/sbi_scratch.h>
|
#include <sbi/sbi_scratch.h>
|
||||||
#include <sbi/sbi_string.h>
|
#include <sbi/sbi_string.h>
|
||||||
|
|
||||||
u32 last_hartid_having_scratch = SBI_HARTMASK_MAX_BITS;
|
u32 last_hartid_having_scratch = SBI_HARTMASK_MAX_BITS - 1;
|
||||||
struct sbi_scratch *hartid_to_scratch_table[SBI_HARTMASK_MAX_BITS] = { 0 };
|
struct sbi_scratch *hartid_to_scratch_table[SBI_HARTMASK_MAX_BITS] = { 0 };
|
||||||
|
|
||||||
static spinlock_t extra_lock = SPIN_LOCK_INITIALIZER;
|
static spinlock_t extra_lock = SPIN_LOCK_INITIALIZER;
|
||||||
@@ -74,7 +74,7 @@ done:
|
|||||||
spin_unlock(&extra_lock);
|
spin_unlock(&extra_lock);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
for (i = 0; i < sbi_scratch_last_hartid(); i++) {
|
for (i = 0; i <= sbi_scratch_last_hartid(); i++) {
|
||||||
rscratch = sbi_hartid_to_scratch(i);
|
rscratch = sbi_hartid_to_scratch(i);
|
||||||
if (!rscratch)
|
if (!rscratch)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -29,7 +29,11 @@ static unsigned long tlb_range_flush_limit;
|
|||||||
|
|
||||||
static void sbi_tlb_flush_all(void)
|
static void sbi_tlb_flush_all(void)
|
||||||
{
|
{
|
||||||
|
#ifdef FW_NO_SFENCE_VMA
|
||||||
|
csr_write(0x9c3, 1 << 26);
|
||||||
|
#else
|
||||||
__asm__ __volatile("sfence.vma");
|
__asm__ __volatile("sfence.vma");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void sbi_tlb_local_hfence_vvma(struct sbi_tlb_info *tinfo)
|
void sbi_tlb_local_hfence_vvma(struct sbi_tlb_info *tinfo)
|
||||||
@@ -73,6 +77,9 @@ void sbi_tlb_local_hfence_gvma(struct sbi_tlb_info *tinfo)
|
|||||||
|
|
||||||
void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo)
|
void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo)
|
||||||
{
|
{
|
||||||
|
#ifdef FW_NO_SFENCE_VMA
|
||||||
|
csr_write(0x9c3, 1 << 26);
|
||||||
|
#else
|
||||||
unsigned long start = tinfo->start;
|
unsigned long start = tinfo->start;
|
||||||
unsigned long size = tinfo->size;
|
unsigned long size = tinfo->size;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
@@ -88,6 +95,7 @@ void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo)
|
|||||||
: "r"(start + i)
|
: "r"(start + i)
|
||||||
: "memory");
|
: "memory");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void sbi_tlb_local_hfence_vvma_asid(struct sbi_tlb_info *tinfo)
|
void sbi_tlb_local_hfence_vvma_asid(struct sbi_tlb_info *tinfo)
|
||||||
@@ -143,6 +151,9 @@ void sbi_tlb_local_hfence_gvma_vmid(struct sbi_tlb_info *tinfo)
|
|||||||
|
|
||||||
void sbi_tlb_local_sfence_vma_asid(struct sbi_tlb_info *tinfo)
|
void sbi_tlb_local_sfence_vma_asid(struct sbi_tlb_info *tinfo)
|
||||||
{
|
{
|
||||||
|
#ifdef FW_NO_SFENCE_VMA
|
||||||
|
csr_write(0x9c3, 1 << 26);
|
||||||
|
#else
|
||||||
unsigned long start = tinfo->start;
|
unsigned long start = tinfo->start;
|
||||||
unsigned long size = tinfo->size;
|
unsigned long size = tinfo->size;
|
||||||
unsigned long asid = tinfo->asid;
|
unsigned long asid = tinfo->asid;
|
||||||
@@ -168,6 +179,7 @@ void sbi_tlb_local_sfence_vma_asid(struct sbi_tlb_info *tinfo)
|
|||||||
: "r"(start + i), "r"(asid)
|
: "r"(start + i), "r"(asid)
|
||||||
: "memory");
|
: "memory");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void sbi_tlb_local_fence_i(struct sbi_tlb_info *tinfo)
|
void sbi_tlb_local_fence_i(struct sbi_tlb_info *tinfo)
|
||||||
|
|||||||
Reference in New Issue
Block a user