poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] pvm: add exception E_perm


From: Jose E. Marchesi
Subject: [PATCH 1/3] pvm: add exception E_perm
Date: Sat, 27 Mar 2021 12:37:09 +0100

This patch adds a new exception to Poke, E_perm.  This exception is to
be raised when an operation is requested and there are not enough
permissions (or capabilities) to actually perform it.  An example is
to read data from a non-readable IO space.

2021-03-27  Jose E. Marchesi  <jemarch@gnu.org>

        * libpoke/pvm.h (PVM_E_PERM): Define.
        (PVM_E_PERM_MSG): Likewise.
        (PVM_E_PERM_ESTATUS): Likewise.
        * libpoke/pkl-rt.pk (EC_perm): New variable.
        (E_perm): Likewise.
---
 ChangeLog         | 8 ++++++++
 libpoke/pkl-rt.pk | 3 +++
 libpoke/pvm.h     | 4 ++++
 3 files changed, 15 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 5b52061e..534f04d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-03-27  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * libpoke/pvm.h (PVM_E_PERM): Define.
+       (PVM_E_PERM_MSG): Likewise.
+       (PVM_E_PERM_ESTATUS): Likewise.
+       * libpoke/pkl-rt.pk (EC_perm): New variable.
+       (E_perm): Likewise.
+
 2021-03-27  Jose E. Marchesi  <jemarch@gnu.org>
            Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
 
diff --git a/libpoke/pkl-rt.pk b/libpoke/pkl-rt.pk
index bfb63259..1e0f9aee 100644
--- a/libpoke/pkl-rt.pk
+++ b/libpoke/pkl-rt.pk
@@ -98,6 +98,7 @@ var EC_inval         = 14;
 var EC_exit          = 15;
 var EC_assert        = 16;
 var EC_overflow      = 17;
+var EC_perm          = 18;
 
 /* Standard exceptions.  */
 
@@ -137,6 +138,8 @@ var E_assert
   = Exception {code = EC_assert, msg = "assertion failure", exit_status = 1};
 var E_overflow
   = Exception {code = EC_overflow, msg = "overflow", exit_status = 1};
+var E_perm
+  = Exception {code = EC_perm, msg = "wrong permissions", exit_status = 1};
 
 /* Registration of user-defined exceptions */
 
diff --git a/libpoke/pvm.h b/libpoke/pvm.h
index 82201cb4..a07b043a 100644
--- a/libpoke/pvm.h
+++ b/libpoke/pvm.h
@@ -547,6 +547,10 @@ enum pvm_exit_code
 #define PVM_E_OVERFLOW_MSG "overflow"
 #define PVM_E_OVERFLOW_ESTATUS 1
 
+#define PVM_E_PERM         18
+#define PVM_E_PERM_MSG     "wrong permissions"
+#define PVM_E_PERM_ESTATUS 1
+
 typedef struct pvm *pvm;
 
 /* Initialize a new Poke Virtual Machine and return it.  */
-- 
2.25.0.2.g232378479e




reply via email to

[Prev in Thread] Current Thread [Next in Thread]