mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-12-24 22:53:43 +03:00
Split up the functions that will comprise ppc_linux_info
This commit is contained in:
parent
1f1a6d8561
commit
4d9c7cd028
@ -16,9 +16,13 @@ extra-source-files: ChangeLog.md
|
||||
cabal-version: >=1.10
|
||||
|
||||
library
|
||||
exposed-modules: Data.Macaw.PPC,
|
||||
Data.Macaw.PPC.ArchTypes,
|
||||
exposed-modules: Data.Macaw.PPC
|
||||
Data.Macaw.PPC.ArchTypes
|
||||
Data.Macaw.PPC.Disassemble
|
||||
Data.Macaw.PPC.Eval
|
||||
Data.Macaw.PPC.Identify
|
||||
Data.Macaw.PPC.PPCReg
|
||||
Data.Macaw.PPC.Rewrite
|
||||
-- other-modules:
|
||||
-- other-extensions:
|
||||
build-depends: base >=4.9 && <5,
|
||||
|
@ -33,8 +33,21 @@ import qualified SemMC.Architecture.PPC32 as PPC32
|
||||
import qualified SemMC.Architecture.PPC64 as PPC64
|
||||
|
||||
import Data.Macaw.PPC.ArchTypes
|
||||
import Data.Macaw.PPC.Disassemble ( disassembleFn )
|
||||
import Data.Macaw.PPC.Eval ( mkInitialAbsState,
|
||||
absEvalArchFn,
|
||||
absEvalArchStmt,
|
||||
postCallAbsState,
|
||||
preserveRegAcrossSyscall
|
||||
)
|
||||
import Data.Macaw.PPC.Identify ( identifyCall,
|
||||
identifyReturn
|
||||
)
|
||||
import Data.Macaw.PPC.PPCReg
|
||||
-- import Data.Macaw.PPC.Rewrite
|
||||
import Data.Macaw.PPC.Rewrite ( rewriteArchFn,
|
||||
rewriteArchStmt,
|
||||
rewriteArchTermStmt
|
||||
)
|
||||
|
||||
data Hole = Hole
|
||||
|
||||
@ -137,62 +150,6 @@ getReg r = PPCGenerator $ St.StateT $ \genState -> do
|
||||
let expr = ValueExpr (genState ^. blockState ^. pBlockState ^. boundValue r)
|
||||
return (expr, genState)
|
||||
|
||||
disassembleFn :: proxy ppc -> MM.Memory (ArchAddrWidth ppc)
|
||||
-> NC.NonceGenerator (ST ids) ids
|
||||
-> ArchSegmentOff ppc
|
||||
-> ArchAddrWord ppc
|
||||
-> MA.AbsBlockState (ArchReg ppc)
|
||||
-- ^ NOTE: We are leaving the type function ArchReg here because
|
||||
-- we need to generalize over PPC64 vs PPC32
|
||||
-> ST ids ([Block ppc ids], MM.MemWord (ArchAddrWidth ppc), Maybe String)
|
||||
disassembleFn = undefined
|
||||
|
||||
preserveRegAcrossSyscall :: proxy ppc -> ArchReg ppc tp -> Bool
|
||||
preserveRegAcrossSyscall = undefined
|
||||
|
||||
mkInitialAbsState :: proxy ppc -> MM.Memory (RegAddrWidth (ArchReg ppc))
|
||||
-> ArchSegmentOff ppc
|
||||
-> MA.AbsBlockState (ArchReg ppc)
|
||||
mkInitialAbsState = undefined
|
||||
|
||||
absEvalArchFn :: proxy ppc -> AbsProcessorState (ArchReg ppc) ids
|
||||
-> ArchFn ppc (Value ppc ids) tp
|
||||
-> AbsValue (RegAddrWidth (ArchReg ppc)) tp
|
||||
absEvalArchFn = undefined
|
||||
|
||||
absEvalArchStmt :: proxy ppc -> AbsProcessorState (ArchReg ppc) ids
|
||||
-> ArchStmt ppc ids
|
||||
-> AbsProcessorState (ArchReg ppc) ids
|
||||
absEvalArchStmt = undefined
|
||||
|
||||
postCallAbsState :: proxy ppc -> AbsBlockState (ArchReg ppc)
|
||||
-> ArchSegmentOff ppc
|
||||
-> AbsBlockState (ArchReg ppc)
|
||||
postCallAbsState = undefined
|
||||
|
||||
identifyCall :: proxy ppc -> MM.Memory (ArchAddrWidth ppc)
|
||||
-> [Stmt ppc ids]
|
||||
-> RegState (ArchReg ppc) (Value ppc ids)
|
||||
-> Maybe (Seq.Seq (Stmt ppc ids), ArchSegmentOff ppc)
|
||||
identifyCall = undefined
|
||||
|
||||
identifyReturn :: proxy ppc -> [Stmt ppc ids]
|
||||
-> RegState (ArchReg ppc) (Value ppc ids)
|
||||
-> Maybe [Stmt ppc ids]
|
||||
identifyReturn = undefined
|
||||
|
||||
rewriteArchFn :: proxy ppc -> ArchFn ppc (Value ppc src) tp
|
||||
-> Rewriter ppc src tgt (Value ppc tgt tp)
|
||||
rewriteArchFn = undefined
|
||||
|
||||
rewriteArchStmt :: proxy ppc -> ArchStmt ppc src
|
||||
-> Rewriter ppc src tgt ()
|
||||
rewriteArchStmt = undefined
|
||||
|
||||
rewriteArchTermStmt :: proxy ppc -> ArchTermStmt ppc src
|
||||
-> Rewriter ppc src tgt (ArchTermStmt ppc tgt)
|
||||
rewriteArchTermStmt = undefined
|
||||
|
||||
archDemandContext :: proxy ppc -> MDS.DemandContext ppc ids
|
||||
archDemandContext = undefined
|
||||
|
||||
|
18
macaw-ppc/src/Data/Macaw/PPC/Disassemble.hs
Normal file
18
macaw-ppc/src/Data/Macaw/PPC/Disassemble.hs
Normal file
@ -0,0 +1,18 @@
|
||||
module Data.Macaw.PPC.Disassemble ( disassembleFn ) where
|
||||
|
||||
import Control.Monad.ST ( ST )
|
||||
|
||||
import Data.Macaw.AbsDomain.AbsState as MA
|
||||
import Data.Macaw.CFG
|
||||
import Data.Macaw.CFG.Block
|
||||
import qualified Data.Macaw.Memory as MM
|
||||
import qualified Data.Parameterized.Nonce as NC
|
||||
|
||||
disassembleFn :: proxy ppc
|
||||
-> MM.Memory (ArchAddrWidth ppc)
|
||||
-> NC.NonceGenerator (ST ids) ids
|
||||
-> ArchSegmentOff ppc
|
||||
-> ArchAddrWord ppc
|
||||
-> MA.AbsBlockState (ArchReg ppc)
|
||||
-> ST ids ([Block ppc ids], MM.MemWord (ArchAddrWidth ppc), Maybe String)
|
||||
disassembleFn = undefined
|
38
macaw-ppc/src/Data/Macaw/PPC/Eval.hs
Normal file
38
macaw-ppc/src/Data/Macaw/PPC/Eval.hs
Normal file
@ -0,0 +1,38 @@
|
||||
module Data.Macaw.PPC.Eval (
|
||||
mkInitialAbsState,
|
||||
absEvalArchFn,
|
||||
absEvalArchStmt,
|
||||
postCallAbsState,
|
||||
preserveRegAcrossSyscall
|
||||
) where
|
||||
|
||||
import Data.Macaw.AbsDomain.AbsState as MA
|
||||
import Data.Macaw.CFG
|
||||
import qualified Data.Macaw.Memory as MM
|
||||
|
||||
preserveRegAcrossSyscall :: proxy ppc -> ArchReg ppc tp -> Bool
|
||||
preserveRegAcrossSyscall = undefined
|
||||
|
||||
mkInitialAbsState :: proxy ppc
|
||||
-> MM.Memory (RegAddrWidth (ArchReg ppc))
|
||||
-> ArchSegmentOff ppc
|
||||
-> MA.AbsBlockState (ArchReg ppc)
|
||||
mkInitialAbsState = undefined
|
||||
|
||||
absEvalArchFn :: proxy ppc
|
||||
-> AbsProcessorState (ArchReg ppc) ids
|
||||
-> ArchFn ppc (Value ppc ids) tp
|
||||
-> AbsValue (RegAddrWidth (ArchReg ppc)) tp
|
||||
absEvalArchFn = undefined
|
||||
|
||||
absEvalArchStmt :: proxy ppc
|
||||
-> AbsProcessorState (ArchReg ppc) ids
|
||||
-> ArchStmt ppc ids
|
||||
-> AbsProcessorState (ArchReg ppc) ids
|
||||
absEvalArchStmt = undefined
|
||||
|
||||
postCallAbsState :: proxy ppc
|
||||
-> AbsBlockState (ArchReg ppc)
|
||||
-> ArchSegmentOff ppc
|
||||
-> AbsBlockState (ArchReg ppc)
|
||||
postCallAbsState = undefined
|
22
macaw-ppc/src/Data/Macaw/PPC/Identify.hs
Normal file
22
macaw-ppc/src/Data/Macaw/PPC/Identify.hs
Normal file
@ -0,0 +1,22 @@
|
||||
module Data.Macaw.PPC.Identify (
|
||||
identifyCall,
|
||||
identifyReturn
|
||||
) where
|
||||
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
import Data.Macaw.CFG
|
||||
import qualified Data.Macaw.Memory as MM
|
||||
|
||||
identifyCall :: proxy ppc
|
||||
-> MM.Memory (ArchAddrWidth ppc)
|
||||
-> [Stmt ppc ids]
|
||||
-> RegState (ArchReg ppc) (Value ppc ids)
|
||||
-> Maybe (Seq.Seq (Stmt ppc ids), ArchSegmentOff ppc)
|
||||
identifyCall = undefined
|
||||
|
||||
identifyReturn :: proxy ppc
|
||||
-> [Stmt ppc ids]
|
||||
-> RegState (ArchReg ppc) (Value ppc ids)
|
||||
-> Maybe [Stmt ppc ids]
|
||||
identifyReturn = undefined
|
23
macaw-ppc/src/Data/Macaw/PPC/Rewrite.hs
Normal file
23
macaw-ppc/src/Data/Macaw/PPC/Rewrite.hs
Normal file
@ -0,0 +1,23 @@
|
||||
module Data.Macaw.PPC.Rewrite (
|
||||
rewriteArchFn,
|
||||
rewriteArchStmt,
|
||||
rewriteArchTermStmt
|
||||
) where
|
||||
|
||||
import Data.Macaw.CFG
|
||||
import Data.Macaw.CFG.Rewriter
|
||||
|
||||
rewriteArchFn :: proxy ppc
|
||||
-> ArchFn ppc (Value ppc src) tp
|
||||
-> Rewriter ppc src tgt (Value ppc tgt tp)
|
||||
rewriteArchFn = undefined
|
||||
|
||||
rewriteArchStmt :: proxy ppc
|
||||
-> ArchStmt ppc src
|
||||
-> Rewriter ppc src tgt ()
|
||||
rewriteArchStmt = undefined
|
||||
|
||||
rewriteArchTermStmt :: proxy ppc
|
||||
-> ArchTermStmt ppc src
|
||||
-> Rewriter ppc src tgt (ArchTermStmt ppc tgt)
|
||||
rewriteArchTermStmt = undefined
|
Loading…
Reference in New Issue
Block a user