diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2018-12-21 13:19:54 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2018-12-21 14:02:30 +0300 |
commit | 27332e63faaf6d3220a9d56bcfb280921114f012 (patch) | |
tree | 10ab1d82fc03f31c851e2b38dab15929bd6be8b8 /include | |
parent | db6c1fe78bebc103670becba39e1c34bcdc48185 (diff) | |
download | opensbi-27332e63faaf6d3220a9d56bcfb280921114f012.tar.xz |
Introduce HAS_MFAULTS_DELEGATION feature
Conditionnally delegate page fault exceptions from M mode to S mode
based on the platform features.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sbi/sbi_platform.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index 39dfb49..6de52f6 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -18,13 +18,15 @@ enum sbi_platform_features { SBI_PLATFORM_HAS_PMP = (1 << 2), SBI_PLATFORM_HAS_SCOUNTEREN = (1 << 3), SBI_PLATFORM_HAS_MCOUNTEREN = (1 << 4), + SBI_PLATFORM_HAS_MFAULTS_DELEGATION = (1 << 5), }; #define SBI_PLATFORM_DEFAULT_FEATURES \ (SBI_PLATFORM_HAS_MMIO_TIMER_VALUE | \ SBI_PLATFORM_HAS_PMP | \ SBI_PLATFORM_HAS_SCOUNTEREN | \ - SBI_PLATFORM_HAS_MCOUNTEREN) + SBI_PLATFORM_HAS_MCOUNTEREN | \ + SBI_PLATFORM_HAS_MFAULTS_DELEGATION) struct sbi_platform { char name[64]; @@ -71,6 +73,8 @@ struct sbi_platform { ((__p)->features & SBI_PLATFORM_HAS_SCOUNTEREN) #define sbi_platform_has_mcounteren(__p) \ ((__p)->features & SBI_PLATFORM_HAS_MCOUNTEREN) +#define sbi_platform_has_mfaults_delegation(__p) \ + ((__p)->features & SBI_PLATFORM_HAS_MFAULTS_DELEGATION) static inline const char *sbi_platform_name(struct sbi_platform *plat) { |