mirror of
https://github.com/GaloisInc/macaw.git
synced 2025-01-06 22:39:45 +03:00
IP alignment rulesfor PPC
This commit is contained in:
parent
9e8279e70c
commit
9874e6db20
@ -26,6 +26,7 @@ module Data.Macaw.PPC.Arch (
|
|||||||
import GHC.TypeLits
|
import GHC.TypeLits
|
||||||
|
|
||||||
import Control.Lens ( (^.) )
|
import Control.Lens ( (^.) )
|
||||||
|
import Data.Bits
|
||||||
import qualified Text.PrettyPrint.ANSI.Leijen as PP
|
import qualified Text.PrettyPrint.ANSI.Leijen as PP
|
||||||
import Data.Parameterized.Classes ( knownRepr )
|
import Data.Parameterized.Classes ( knownRepr )
|
||||||
import qualified Data.Parameterized.NatRepr as NR
|
import qualified Data.Parameterized.NatRepr as NR
|
||||||
@ -195,8 +196,11 @@ instance MC.IPAlignment PPC64.PPC where
|
|||||||
|
|
||||||
| otherwise = Nothing
|
| otherwise = Nothing
|
||||||
|
|
||||||
|
toIPAligned addr = addr { MM.addrOffset = MM.addrOffset addr .&. complement 0x3 }
|
||||||
|
|
||||||
instance MC.IPAlignment PPC32.PPC where
|
instance MC.IPAlignment PPC32.PPC where
|
||||||
fromIPAligned _ = error "IP alignment rules are not yet implemented for PPC32"
|
fromIPAligned _ = error "IP alignment rules are not yet implemented for PPC32"
|
||||||
|
toIPAligned addr = addr { MM.addrOffset = MM.addrOffset addr .&. complement 0x3 }
|
||||||
|
|
||||||
rewriteStmt :: (MC.ArchStmt ppc ~ PPCStmt ppc) => PPCStmt ppc (MC.Value ppc src) -> Rewriter ppc s src tgt ()
|
rewriteStmt :: (MC.ArchStmt ppc ~ PPCStmt ppc) => PPCStmt ppc (MC.Value ppc src) -> Rewriter ppc s src tgt ()
|
||||||
rewriteStmt s = do
|
rewriteStmt s = do
|
||||||
|
Loading…
Reference in New Issue
Block a user