From 2aadbf958981b2bf247915aa546ce56112b8319d Mon Sep 17 00:00:00 2001 From: Matthew Brecknell Date: Thu, 24 Jun 2021 18:23:18 +1000 Subject: [PATCH] trivial: restyle `spec/machine/ARM*/Platform.thy` Signed-off-by: Matthew Brecknell --- spec/machine/ARM/Platform.thy | 30 +++++++-------------- spec/machine/ARM_HYP/Platform.thy | 44 +++++++++++-------------------- 2 files changed, 26 insertions(+), 48 deletions(-) diff --git a/spec/machine/ARM/Platform.thy b/spec/machine/ARM/Platform.thy index e34707af7..307b4073e 100644 --- a/spec/machine/ARM/Platform.thy +++ b/spec/machine/ARM/Platform.thy @@ -29,45 +29,35 @@ type_synonym paddr = word32 abbreviation (input) "toPAddr \ id" abbreviation (input) "fromPAddr \ id" -definition - pageColourBits :: nat where +definition pageColourBits :: nat where "pageColourBits \ 2" -definition - cacheLineBits :: nat where +definition cacheLineBits :: nat where "cacheLineBits = 5" -definition - cacheLine :: nat where +definition cacheLine :: nat where "cacheLine = 2^cacheLineBits" (* Arch specific kernel base address used for haskell spec *) -definition - pptrBase :: word32 where +definition pptrBase :: word32 where "pptrBase \ 0xe0000000" -definition - physBase :: word32 where +definition physBase :: word32 where "physBase \ 0x10000000" -definition - pptrBaseOffset :: word32 where +definition pptrBaseOffset :: word32 where "pptrBaseOffset \ pptrBase - physBase" -definition - ptrFromPAddr :: "paddr \ word32" where +definition ptrFromPAddr :: "paddr \ word32" where "ptrFromPAddr paddr \ paddr + pptrBaseOffset" -definition - addrFromPPtr :: "word32 \ paddr" where +definition addrFromPPtr :: "word32 \ paddr" where "addrFromPPtr pptr \ pptr - pptrBaseOffset" -definition - minIRQ :: "irq" where +definition minIRQ :: "irq" where "minIRQ \ 0" -definition - maxIRQ :: "irq" where +definition maxIRQ :: "irq" where "maxIRQ \ 0x9F" end diff --git a/spec/machine/ARM_HYP/Platform.thy b/spec/machine/ARM_HYP/Platform.thy index 2a0b60465..7f9b72ced 100644 --- a/spec/machine/ARM_HYP/Platform.thy +++ b/spec/machine/ARM_HYP/Platform.thy @@ -29,62 +29,50 @@ type_synonym paddr = word32 abbreviation (input) "toPAddr \ id" abbreviation (input) "fromPAddr \ id" -definition - pageColourBits :: nat where +definition pageColourBits :: nat where "pageColourBits \ 2" -definition - cacheLineBits :: nat where +definition cacheLineBits :: nat where "cacheLineBits = 6" -definition - cacheLine :: nat where +definition cacheLine :: nat where "cacheLine = 2^cacheLineBits" (* Arch specific kernel base address used for haskell spec *) -definition - pptrBase :: word32 where +definition pptrBase :: word32 where "pptrBase \ 0xe0000000" -definition - physBase :: word32 where +definition physBase :: word32 where "physBase \ 0x80000000" abbreviation (input) "paddrBase \ physBase" -definition - pptrTop :: "32 word" where +definition pptrTop :: "32 word" where "pptrTop \ 0xfff00000" -definition - paddrTop :: "32 word" where +definition paddrTop :: "32 word" where "paddrTop \ pptrTop - (pptrBase - physBase)" -definition - pptrBaseOffset :: word32 where +definition pptrBaseOffset :: word32 where "pptrBaseOffset \ pptrBase - physBase" -definition - ptrFromPAddr :: "paddr \ word32" where +definition ptrFromPAddr :: "paddr \ word32" where "ptrFromPAddr paddr \ paddr + pptrBaseOffset" -definition - addrFromPPtr :: "word32 \ paddr" where +definition addrFromPPtr :: "word32 \ paddr" where "addrFromPPtr pptr \ pptr - pptrBaseOffset" -definition - minIRQ :: "irq" where +definition minIRQ :: "irq" where "minIRQ \ 0" -definition - maxIRQ :: "irq" where +definition maxIRQ :: "irq" where "maxIRQ \ 191" -definition irqVGICMaintenance :: "irq" - where "irqVGICMaintenance \ 25" +definition irqVGICMaintenance :: "irq" where + "irqVGICMaintenance \ 25" -definition irqVTimerEvent :: "irq" - where "irqVTimerEvent \ 27" +definition irqVTimerEvent :: "irq" where + "irqVTimerEvent \ 27" end