nativeMaschine: add module for binding target machine
authorBernhard Urban <lewurm@gmail.com>
Tue, 31 Jul 2012 20:22:28 +0000 (22:22 +0200)
committerBernhard Urban <lewurm@gmail.com>
Tue, 31 Jul 2012 20:06:00 +0000 (22:06 +0200)
TODO: use wordSize where appropriate

Mate.hs
Mate/MethodPool.hs
Mate/MethodPool.hs-boot
Mate/NativeMaschine.hs [new file with mode: 0644]
Mate/X86TrapHandling.hs

diff --git a/Mate.hs b/Mate.hs
index 4664ff188dc26229cd591324c9d69ff411f0d569..ee03d8d78ad1b3dfb19f766ae813d062f000c305 100644 (file)
--- a/Mate.hs
+++ b/Mate.hs
@@ -20,7 +20,7 @@ import Mate.BasicBlocks
 import Mate.MethodPool
 import Mate.Types
 import Mate.ClassPool
-import Mate.X86TrapHandling
+import Mate.NativeMaschine
 
 main ::  IO ()
 main = do
index 5f787a25afad127167897d51381da0350dab4e39..134428a6f539dde5c2057cf02a1123a7610627ea 100644 (file)
@@ -26,7 +26,7 @@ import Text.Printf
 
 import Mate.BasicBlocks
 import Mate.Types
-import Mate.X86CodeGen
+import Mate.NativeMaschine
 import Mate.ClassPool
 import Mate.Debug
 import Mate.Utilities
index 9392619e199851dc432e106fd5e60d64a4a329a9..477e6ccfee90cd609da103c0010d10ee0d7da363 100644 (file)
@@ -6,8 +6,10 @@ import Data.Binary
 import qualified Data.ByteString.Lazy as B
 
 import Mate.Types
+import Foreign.C.Types
 
 
 addMethodRef :: Word32 -> MethodInfo -> [B.ByteString] -> IO ()
 compileBB :: RawMethod -> MethodInfo -> IO Word32
 executeFuncPtr :: Word32 -> IO ()
+getMethodEntry :: CUInt -> CUInt -> IO CUInt
diff --git a/Mate/NativeMaschine.hs b/Mate/NativeMaschine.hs
new file mode 100644 (file)
index 0000000..e32cecc
--- /dev/null
@@ -0,0 +1,18 @@
+{-# LANGUAGE CPP #-}
+module Mate.NativeMaschine(
+  emitFromBB,
+  mateHandler,
+  register_signal,
+  wordSize
+  )where
+
+#ifdef i386_HOST_ARCH
+import Mate.X86CodeGen
+import Mate.X86TrapHandling
+
+wordSize :: Int
+wordSize = 4
+
+#else
+#error "no other arch supported yet :/"
+#endif
index 1761d6b1047671eecad02d487d8de3b3c9456401..0e07cd5e29351e38c669e50530c0c241a6f66358 100644 (file)
@@ -13,7 +13,7 @@ import Foreign
 import Foreign.C.Types
 
 import Mate.Types
-import Mate.MethodPool
+import {-# SOURCE #-} Mate.MethodPool
 import Mate.ClassPool
 
 foreign import ccall "register_signal"