mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-01-11 14:24:08 +00:00
Compare commits
2 Commits
v1.8
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74434f2558 | ||
|
|
65fac65311 |
@@ -186,7 +186,7 @@ extern u32 sbi_scratch_hart_count;
|
||||
/** HART index to HART id table */
|
||||
extern u32 hartindex_to_hartid_table[];
|
||||
|
||||
/** Get sbi_scratch from HART index */
|
||||
/** Get HART id from HART index */
|
||||
#define sbi_hartindex_to_hartid(__hartindex) \
|
||||
({ \
|
||||
((__hartindex) < SBI_HARTMASK_MAX_BITS) ? \
|
||||
|
||||
@@ -54,7 +54,7 @@ int sbi_hart_protection_configure(struct sbi_scratch *scratch)
|
||||
struct sbi_hart_protection *hprot = sbi_hart_protection_best();
|
||||
|
||||
if (!hprot)
|
||||
return SBI_EINVAL;
|
||||
return 0;
|
||||
if (!hprot->configure)
|
||||
return SBI_ENOSYS;
|
||||
|
||||
@@ -75,9 +75,7 @@ int sbi_hart_protection_map_range(unsigned long base, unsigned long size)
|
||||
{
|
||||
struct sbi_hart_protection *hprot = sbi_hart_protection_best();
|
||||
|
||||
if (!hprot)
|
||||
return SBI_EINVAL;
|
||||
if (!hprot->map_range)
|
||||
if (!hprot || !hprot->map_range)
|
||||
return 0;
|
||||
|
||||
return hprot->map_range(sbi_scratch_thishart_ptr(), base, size);
|
||||
@@ -87,9 +85,7 @@ int sbi_hart_protection_unmap_range(unsigned long base, unsigned long size)
|
||||
{
|
||||
struct sbi_hart_protection *hprot = sbi_hart_protection_best();
|
||||
|
||||
if (!hprot)
|
||||
return SBI_EINVAL;
|
||||
if (!hprot->unmap_range)
|
||||
if (!hprot || !hprot->unmap_range)
|
||||
return 0;
|
||||
|
||||
return hprot->unmap_range(sbi_scratch_thishart_ptr(), base, size);
|
||||
|
||||
Reference in New Issue
Block a user