From 08e80a9a9d678ddfbeed077ca35105a1183706ad Mon Sep 17 00:00:00 2001 From: Christian Herber Date: Wed, 11 Sep 2024 13:44:58 +0200 Subject: [PATCH] Improved clarity regarding xcause when switching between CLIC and CLINT modes --- src/clic.adoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/clic.adoc b/src/clic.adoc index be278ae..be28ced 100644 --- a/src/clic.adoc +++ b/src/clic.adoc @@ -970,13 +970,13 @@ through the trap handling process. 11:0 exccode[11:0] Exception/interrupt code ---- -The `mcause.mpp` and `mcause.mpie` fields typically mirror the `mstatus.mpp` and -`mstatus.mpie` fields, and are aliased into `mcause` to reduce context -save/restore code. For backwards compatibility in implementations supporting both CLINT and CLIC modes, when -switching to CLINT mode the new CLIC {cause} state field -({pil}) is zeroed. The other new CLIC {cause} fields, -{pp} and {pie}, appear as zero in the {cause} CSR but the corresponding -state bits in the `mstatus` register are not cleared. +The `mcause.mpp` and `mcause.mpie` fields mirror the `mstatus.mpp` and +`mstatus.mpie` fields when in CLIC mode to reduce context +save/restore code. +Else, these fields read as zero. +For backwards compatibility in implementations supporting both CLINT and CLIC modes, when +switching to CLINT mode the new CLIC {cause}.{pil} state field +is zeroed. If the hart is currently running at some privilege mode (`pp`) at some interrupt level (`pil`) and an enabled interrupt becomes pending at