From 4410c2a1b3b0fb91c375a072a01bb9646115cacd Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 27 Jun 2022 15:27:15 +0800 Subject: [PATCH] spinor: add discriminants to api calls Signed-off-by: Sean Cross --- services/spinor/src/api.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/services/spinor/src/api.rs b/services/spinor/src/api.rs index 642b585a4..cb18a816f 100644 --- a/services/spinor/src/api.rs +++ b/services/spinor/src/api.rs @@ -11,28 +11,28 @@ pub const SPINOR_BULK_ERASE_SIZE: u32 = 0x1_0000; // this is the bulk erase size #[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Debug)] pub(crate) enum Opcode { /// writes are split into multiple transactions. Must acquire exclusive rights before initiation - AcquireExclusive, - ReleaseExclusive, + AcquireExclusive = 0, + ReleaseExclusive = 1, /// a special token is reserved for writing to the SoC region, only one service is allowed to do that - RegisterSocToken, + RegisterSocToken = 2, /// the SocToken holder can allow for writes to the staging area by other processes - SetStagingWriteProtect, - ClearStagingWriteProtect, + SetStagingWriteProtect = 3, + ClearStagingWriteProtect = 4, /// program a region. Erase is accomplished by calling WriteRegion with all 0xFF's as data. - WriteRegion, + WriteRegion = 5, /// bulk erase a region. Has fewer safety checks, used for accelerating the bulk clear of the PDDB for init. - BulkErase, + BulkErase = 6, /// allow the susres manager to prevent new ops from happening during a suspend - AcquireSuspendLock, - ReleaseSuspendLock, + AcquireSuspendLock = 7, + ReleaseSuspendLock = 8, /// intra-thread messages for suspend and resume - SuspendInner, - ResumeInner, + SuspendInner = 9, + ResumeInner = 10, /// internal interrupt handler ops - EccError, + EccError = 11, } // Erase/Write are uninterruptable operations. Split suspend/resume // into a separate server to asynchronously manage this.