[MLton-commit] r5655

Matthew Fluet fluet at mlton.org
Tue Jun 19 13:18:42 PDT 2007


Use c-types.mlb to make mlnlffi-lib arch independent
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/linkage-libdl.sml
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess-a4c1s2i4l4ll8f4d8.sml
U   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess.sig
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess.sml
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-unix.sml
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.32bit-unix.mlb
U   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.mlb
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.unix.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/mlrep-i8i16i32i32i64f32f64.sml
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/mlrep.sml
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-freebsd.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-linux.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-netbsd.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-openbsd.mlb
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.cygwin.mlb
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.darwin.mlb
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.freebsd.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.hppa-linux.mlb
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.linux.mlb
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.mingw.mlb
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.netbsd.mlb
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.openbsd.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.powerpc-darwin.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.powerpc-linux.mlb
A   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.solaris.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.sparc-linux.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.sparc-solaris.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-cygwin.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-darwin.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-freebsd.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-linux.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-mingw.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-netbsd.mlb
D   mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-openbsd.mlb
U   mlton/branches/on-20050822-x86_64-branch/mlnlffigen/control.sml
A   mlton/branches/on-20050822-x86_64-branch/mlnlffigen/sizes-amd64.sml
U   mlton/branches/on-20050822-x86_64-branch/mlnlffigen/sources.mlb

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/linkage-libdl.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/linkage-libdl.sml	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/linkage-libdl.sml	2007-06-19 20:18:39 UTC (rev 5655)
@@ -34,7 +34,7 @@
         type addr_handle = h
     end
 
-    type mode = Word32.word
+    type mode = C_UInt.word
     local
        val RTLD_LAZY   = 0wx00001
        val RTLD_NOW    = 0wx00002
@@ -42,7 +42,7 @@
        val RTLD_LOCAL  = 0wx00000
     in
        fun mk_mode {lazy: bool, global: bool} : mode=
-          Word32.orb
+          C_UInt.orb
           (if lazy then RTLD_LAZY else RTLD_NOW,
            if global then RTLD_GLOBAL else RTLD_LOCAL)
     end

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess-a4c1s2i4l4ll8f4d8.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess-a4c1s2i4l4ll8f4d8.sml	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess-a4c1s2i4l4ll8f4d8.sml	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1,134 +0,0 @@
-(* memaccess-a4c1s2i4l4ll8f4d8.sml
- * 2005 Matthew Fluet (mfluet at acm.org)
- *  Adapted for MLton.
- *)
-
-(* memaccess-64-big.sml *)
-(* memaccess-64-little.sml *)
-(* memaccess-a4s2i4l4f4d8.sml
- *
- *   Primitives for "raw" memory access.
- *
- *   x86/Sparc/PPC version:
- *       addr char short  int  long float double
- *       4    1    2      4    4    4     8       (bytes)
- *
- *   (C) 2004 The Fellowship of SML/NJ
- *
- * author: Matthias Blume (blume at tti-c.org)
- *)
-structure CMemAccess : CMEMACCESS = struct
-    structure Ptr = MLton.Pointer
-
-    type addr = Ptr.t
-    val null = Ptr.null : addr
-    fun isNull a = a = null
-    infix ++ --
-    (* rely on 2's-complement for the following... *)
-    fun (a: addr) ++ i = Ptr.add (a, Word32.fromInt i)
-    val compare = Ptr.compare
-    fun a1 -- a2 = Word32.toIntX (Ptr.diff (a1, a2))
-
-    val addr_size = 0w4
-    val char_size = 0w1
-    val short_size = 0w2
-    val int_size = 0w4
-    val long_size = 0w4
-    val longlong_size = 0w8
-    val float_size = 0w4
-    val double_size = 0w8
-
-    local 
-       fun get g addr =
-          g (addr, 0)
-    in
-       val load_addr = get Ptr.getPointer
-       val load_uchar = get Ptr.getWord8
-       val load_schar = get Ptr.getInt8
-       val load_ushort = get Ptr.getWord16
-       val load_sshort = get Ptr.getInt16
-       val load_uint = get Ptr.getWord32
-       val load_sint = get Ptr.getInt32
-       val load_ulong = get Ptr.getWord32
-       val load_slong = get Ptr.getInt32
-       val load_ulonglong = get Ptr.getWord64
-       val load_slonglong = get Ptr.getInt64
-       val load_float = get Ptr.getReal32
-       val load_double = get Ptr.getReal64
-    end
-
-    local
-       fun set s (addr, x) =
-          s (addr, 0, x)
-    in
-       val store_addr = set Ptr.setPointer
-       val store_uchar = set Ptr.setWord8
-       val store_schar = set Ptr.setInt8
-       val store_ushort = set Ptr.setWord16
-       val store_sshort = set Ptr.setInt16
-       val store_uint = set Ptr.setWord32
-       val store_sint = set Ptr.setInt32
-       val store_ulong = set Ptr.setWord32
-       val store_slong = set Ptr.setInt32
-       val store_ulonglong = set Ptr.setWord64
-       val store_slonglong = set Ptr.setInt64
-       val store_float = set Ptr.setReal32
-       val store_double = set Ptr.setReal64
-    end
-
-    val int_bits = Word.fromInt Word32.wordSize
-
-    (* this needs to be severely optimized... *)
-    fun bcopy { from: addr, to: addr, bytes: word } =
-        if bytes > 0w0 then
-            (store_uchar (to, load_uchar from);
-             bcopy { from = from ++ 1, to = to ++ 1, bytes = bytes - 0w1 })
-        else ()
-
-    (* types used in C calling convention *)
-    type cc_addr = MLton.Pointer.t
-    type cc_schar = Int8.int
-    type cc_uchar = Word8.word
-    type cc_sshort = Int16.int
-    type cc_ushort = Word16.word
-    type cc_sint = Int32.int
-    type cc_uint = Word32.word
-    type cc_slong = Int32.int
-    type cc_ulong = Word32.word
-    type cc_slonglong = Int64.int
-    type cc_ulonglong = Word64.word
-    type cc_float = Real32.real
-    type cc_double = Real64.real
-
-    (* wrapping and unwrapping for cc types *)
-    fun wrap_addr (x : addr) = x : cc_addr
-    fun wrap_schar (x : MLRep.Char.Signed.int) = x : cc_schar
-    fun wrap_uchar (x : MLRep.Char.Unsigned.word) = x : cc_uchar
-    fun wrap_sshort (x : MLRep.Short.Signed.int) = x : cc_sshort
-    fun wrap_ushort (x : MLRep.Short.Unsigned.word) = x : cc_ushort
-    fun wrap_sint (x : MLRep.Int.Signed.int) = x : cc_sint
-    fun wrap_uint (x : MLRep.Int.Unsigned.word) = x : cc_uint
-    fun wrap_slong (x : MLRep.Long.Signed.int) = x : cc_slong
-    fun wrap_ulong (x : MLRep.Long.Unsigned.word) = x : cc_ulong
-    fun wrap_slonglong (x : MLRep.LongLong.Signed.int) = x : cc_slonglong
-    fun wrap_ulonglong (x : MLRep.LongLong.Unsigned.word) = x : cc_ulonglong
-    fun wrap_float (x : MLRep.Float.real) = x : cc_float
-    fun wrap_double (x : MLRep.Double.real) = x : cc_double
-
-    fun unwrap_addr (x : cc_addr) = x : addr
-    fun unwrap_schar (x : cc_schar) = x : MLRep.Char.Signed.int
-    fun unwrap_uchar (x : cc_uchar) = x : MLRep.Char.Unsigned.word
-    fun unwrap_sshort (x : cc_sshort) = x : MLRep.Short.Signed.int
-    fun unwrap_ushort (x : cc_ushort) = x : MLRep.Short.Unsigned.word
-    fun unwrap_sint (x : cc_sint) = x : MLRep.Int.Signed.int
-    fun unwrap_uint (x : cc_uint) = x : MLRep.Int.Unsigned.word
-    fun unwrap_slong (x : cc_slong) = x : MLRep.Long.Signed.int
-    fun unwrap_ulong (x : cc_ulong) = x : MLRep.Long.Unsigned.word
-    fun unwrap_slonglong (x : cc_slonglong) = x : MLRep.LongLong.Signed.int
-    fun unwrap_ulonglong (x : cc_ulonglong) = x : MLRep.LongLong.Unsigned.word
-    fun unwrap_float (x : cc_float) = x : MLRep.Float.real
-    fun unwrap_double (x : cc_double) = x : MLRep.Double.real
-
-    fun p2i (x : addr) : MLRep.Int.Unsigned.word = Ptr.diff (x, null) 
-    fun i2p (x : MLRep.Int.Unsigned.word) : addr = Ptr.add (null, x)
-end

Modified: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess.sig	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess.sig	2007-06-19 20:18:39 UTC (rev 5655)
@@ -109,6 +109,6 @@
     val unwrap_double    : cc_double    -> MLRep.Double.real
 
     (* unsafe pointer <-> int conversion *)
-    val p2i : addr -> MLRep.Int.Unsigned.word
-    val i2p : MLRep.Int.Unsigned.word -> addr
+    val p2i : addr -> MLRep.Long.Unsigned.word
+    val i2p : MLRep.Long.Unsigned.word -> addr
 end

Copied: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess.sml (from rev 5646, mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess-a4c1s2i4l4ll8f4d8.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess-a4c1s2i4l4ll8f4d8.sml	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memaccess.sml	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1,217 @@
+(* memaccess.sml
+ * 2007 Matthew Fluet (mfluet at acm.org)
+ *  Adapted for MLton.  Make use of $(SML_LIB)/basis/c-types.mlb
+ * 2005 Matthew Fluet (mfluet at acm.org)
+ *  Adapted for MLton.
+ *)
+
+(* memaccess-64-big.sml *)
+(* memaccess-64-little.sml *)
+(* memaccess-a4s2i4l4f4d8.sml
+ *
+ *   Primitives for "raw" memory access.
+ *
+ *   x86/Sparc/PPC version:
+ *       addr char short  int  long float double
+ *       4    1    2      4    4    4     8       (bytes)
+ *
+ *   (C) 2004 The Fellowship of SML/NJ
+ *
+ * author: Matthias Blume (blume at tti-c.org)
+ *)
+structure CMemAccess : CMEMACCESS = struct
+    structure Ptr = MLton.Pointer
+
+    type addr = Ptr.t
+    val null = Ptr.null : addr
+    fun isNull a = a = null
+    infix ++ --
+    (* rely on 2's-complement for the following... *)
+    fun (a: addr) ++ i = Ptr.add (a, Word.fromInt i)
+    val compare = Ptr.compare
+    fun a1 -- a2 = Word.toIntX (Ptr.diff (a1, a2))
+
+    val addr_size = Word.fromInt (C_Size.wordSize div 8)
+    val char_size = Word.fromInt (C_UChar.wordSize div 8)
+    val short_size = Word.fromInt (C_UShort.wordSize div 8)
+    val int_size = Word.fromInt (C_UInt.wordSize div 8)
+    val long_size = Word.fromInt (C_ULong.wordSize div 8)
+    val longlong_size = Word.fromInt (C_ULongLong.wordSize div 8)
+    local
+       structure RealNArg =
+          struct
+             type 'a t = int
+             val fReal32 = 32
+             val fReal64 = 64
+          end
+       structure Float = C_Float_ChooseRealN(RealNArg)
+       structure Double = C_Double_ChooseRealN(RealNArg)
+    in
+       val float_size = Word.fromInt (Float.f div 8)
+       val double_size = Word.fromInt (Double.f div 8)
+    end
+
+    local 
+       fun get g addr =
+          g (addr, 0)
+       structure IntNArg = 
+          struct
+             type 'a t = Ptr.t * int -> 'a
+             val fInt8 = Ptr.getInt8
+             val fInt16 = Ptr.getInt16
+             val fInt32 = Ptr.getInt32
+             val fInt64 = Ptr.getInt64
+          end
+       structure RealNArg = 
+          struct
+             type 'a t = Ptr.t * int -> 'a
+             val fReal32 = Ptr.getReal32
+             val fReal64 = Ptr.getReal64
+          end
+       structure WordNArg = 
+          struct
+             type 'a t = Ptr.t * int -> 'a
+             val fWord8 = Ptr.getWord8
+             val fWord16 = Ptr.getWord16
+             val fWord32 = Ptr.getWord32
+             val fWord64 = Ptr.getWord64
+          end
+       structure UChar = C_UChar_ChooseWordN(WordNArg)
+       structure SChar = C_SChar_ChooseIntN(IntNArg)
+       structure UShort = C_UShort_ChooseWordN(WordNArg)
+       structure SShort = C_SShort_ChooseIntN(IntNArg)
+       structure UInt = C_UInt_ChooseWordN(WordNArg)
+       structure SInt = C_SInt_ChooseIntN(IntNArg)
+       structure ULong = C_ULong_ChooseWordN(WordNArg)
+       structure SLong = C_SLong_ChooseIntN(IntNArg)
+       structure ULongLong = C_ULongLong_ChooseWordN(WordNArg)
+       structure SLongLong = C_SLongLong_ChooseIntN(IntNArg)
+       structure Float = C_Float_ChooseRealN(RealNArg)
+       structure Double = C_Double_ChooseRealN(RealNArg)
+    in
+       val load_addr = get Ptr.getPointer
+       val load_uchar = get UChar.f
+       val load_schar = get SChar.f
+       val load_ushort = get UShort.f
+       val load_sshort = get SShort.f
+       val load_uint = get UInt.f
+       val load_sint = get SInt.f
+       val load_ulong = get ULong.f
+       val load_slong = get SLong.f
+       val load_ulonglong = get ULongLong.f
+       val load_slonglong = get SLongLong.f
+       val load_float = get Float.f
+       val load_double = get Double.f
+    end
+
+    local
+       fun set s (addr, x) =
+          s (addr, 0, x)
+       structure IntNArg = 
+          struct
+             type 'a t = Ptr.t * int * 'a -> unit
+             val fInt8 = Ptr.setInt8
+             val fInt16 = Ptr.setInt16
+             val fInt32 = Ptr.setInt32
+             val fInt64 = Ptr.setInt64
+          end
+       structure RealNArg = 
+          struct
+             type 'a t = Ptr.t * int * 'a -> unit
+             val fReal32 = Ptr.setReal32
+             val fReal64 = Ptr.setReal64
+          end
+       structure WordNArg = 
+          struct
+             type 'a t = Ptr.t * int * 'a -> unit
+             val fWord8 = Ptr.setWord8
+             val fWord16 = Ptr.setWord16
+             val fWord32 = Ptr.setWord32
+             val fWord64 = Ptr.setWord64
+          end
+       structure UChar = C_UChar_ChooseWordN(WordNArg)
+       structure SChar = C_SChar_ChooseIntN(IntNArg)
+       structure UShort = C_UShort_ChooseWordN(WordNArg)
+       structure SShort = C_SShort_ChooseIntN(IntNArg)
+       structure UInt = C_UInt_ChooseWordN(WordNArg)
+       structure SInt = C_SInt_ChooseIntN(IntNArg)
+       structure ULong = C_ULong_ChooseWordN(WordNArg)
+       structure SLong = C_SLong_ChooseIntN(IntNArg)
+       structure ULongLong = C_ULongLong_ChooseWordN(WordNArg)
+       structure SLongLong = C_SLongLong_ChooseIntN(IntNArg)
+       structure Float = C_Float_ChooseRealN(RealNArg)
+       structure Double = C_Double_ChooseRealN(RealNArg)
+    in
+       val store_addr = set Ptr.setPointer
+       val store_uchar = set UChar.f
+       val store_schar = set SChar.f
+       val store_ushort = set UShort.f
+       val store_sshort = set SShort.f
+       val store_uint = set UInt.f
+       val store_sint = set SInt.f
+       val store_ulong = set ULong.f
+       val store_slong = set SLong.f
+       val store_ulonglong = set ULongLong.f
+       val store_slonglong = set SLongLong.f
+       val store_float = set Float.f
+       val store_double = set Double.f
+    end
+
+    val int_bits = int_size * 0w8
+
+    (* this needs to be severely optimized... *)
+    fun bcopy { from: addr, to: addr, bytes: word } =
+        if bytes > 0w0 then
+            (store_uchar (to, load_uchar from);
+             bcopy { from = from ++ 1, to = to ++ 1, bytes = bytes - 0w1 })
+        else ()
+
+    (* types used in C calling convention *)
+    type cc_addr = MLton.Pointer.t
+    type cc_schar = C_SChar.int
+    type cc_uchar = C_UChar.word
+    type cc_sshort = C_SShort.int
+    type cc_ushort = C_UShort.word
+    type cc_sint = C_SInt.int
+    type cc_uint = C_UInt.word
+    type cc_slong = C_SLong.int
+    type cc_ulong = C_ULong.word
+    type cc_slonglong = C_SLongLong.int
+    type cc_ulonglong = C_ULongLong.word
+    type cc_float = C_Float.real
+    type cc_double = C_Double.real
+
+    (* wrapping and unwrapping for cc types *)
+    fun wrap_addr (x : addr) = x : cc_addr
+    fun wrap_schar (x : MLRep.Char.Signed.int) = x : cc_schar
+    fun wrap_uchar (x : MLRep.Char.Unsigned.word) = x : cc_uchar
+    fun wrap_sshort (x : MLRep.Short.Signed.int) = x : cc_sshort
+    fun wrap_ushort (x : MLRep.Short.Unsigned.word) = x : cc_ushort
+    fun wrap_sint (x : MLRep.Int.Signed.int) = x : cc_sint
+    fun wrap_uint (x : MLRep.Int.Unsigned.word) = x : cc_uint
+    fun wrap_slong (x : MLRep.Long.Signed.int) = x : cc_slong
+    fun wrap_ulong (x : MLRep.Long.Unsigned.word) = x : cc_ulong
+    fun wrap_slonglong (x : MLRep.LongLong.Signed.int) = x : cc_slonglong
+    fun wrap_ulonglong (x : MLRep.LongLong.Unsigned.word) = x : cc_ulonglong
+    fun wrap_float (x : MLRep.Float.real) = x : cc_float
+    fun wrap_double (x : MLRep.Double.real) = x : cc_double
+
+    fun unwrap_addr (x : cc_addr) = x : addr
+    fun unwrap_schar (x : cc_schar) = x : MLRep.Char.Signed.int
+    fun unwrap_uchar (x : cc_uchar) = x : MLRep.Char.Unsigned.word
+    fun unwrap_sshort (x : cc_sshort) = x : MLRep.Short.Signed.int
+    fun unwrap_ushort (x : cc_ushort) = x : MLRep.Short.Unsigned.word
+    fun unwrap_sint (x : cc_sint) = x : MLRep.Int.Signed.int
+    fun unwrap_uint (x : cc_uint) = x : MLRep.Int.Unsigned.word
+    fun unwrap_slong (x : cc_slong) = x : MLRep.Long.Signed.int
+    fun unwrap_ulong (x : cc_ulong) = x : MLRep.Long.Unsigned.word
+    fun unwrap_slonglong (x : cc_slonglong) = x : MLRep.LongLong.Signed.int
+    fun unwrap_ulonglong (x : cc_ulonglong) = x : MLRep.LongLong.Unsigned.word
+    fun unwrap_float (x : cc_float) = x : MLRep.Float.real
+    fun unwrap_double (x : cc_double) = x : MLRep.Double.real
+
+    fun p2i (x : addr) : MLRep.Long.Unsigned.word = 
+       C_ULong.fromLarge (Word.toLarge (Ptr.diff (x, null)))
+    fun i2p (x : MLRep.Long.Unsigned.word) : addr = 
+       Ptr.add (null, Word.fromLarge (C_ULong.toLarge x))
+end

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1,56 +0,0 @@
-(* memalloc-a4-unix.sml
- * 2005 Matthew Fluet (mfluet at acm.org)
- *  Adapted for MLton.
- *)
-
-(* memalloc-a4-unix.sml
- *
- *   Memory allocation (via malloc) for Unix.
- *   Size of address: 4 bytes.
- *
- * Copyright (c) 2004 by The Fellowship of SML/NJ
- *
- * Author: Matthias Blume (blume at tti-c.org)
- *)
-structure CMemAlloc : CMEMALLOC = struct
-
-    exception OutOfMemory
-
-    structure Ptr = MLton.Pointer
-
-    type addr = Ptr.t
-    type addr' = addr
-
-(*
-    structure DL = DynLinkage
-
-    fun main's s = DL.lib_symbol (DL.main_lib, s)
-    val malloc_h = main's "malloc"
-    val free_h = main's "free"
-
-    fun sys_malloc (n : Word32.word) = 
-        let val w_p = _import * : MLton.Pointer.t -> Word32.word -> addr;
-            val a = w_p (DL.addr malloc_h) n
-        in if a = Ptr.null then raise OutOfMemory else a
-        end
-
-    fun sys_free (a : addr) = 
-        let val p_u = _import * : MLton.Pointer.t -> addr -> unit;
-        in p_u (DL.addr free_h) a
-        end
-*)
-
-    fun sys_malloc (n : Word32.word) = 
-        let val w_p = _import "malloc" : Word32.word -> addr;
-            val a = w_p n
-        in if a = Ptr.null then raise OutOfMemory else a
-        end
-
-    fun sys_free (a : addr) = 
-        let val p_u = _import "free" : addr -> unit;
-        in p_u a
-        end
-
-    fun alloc bytes = sys_malloc bytes
-    fun free a = sys_free a
-end

Copied: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-unix.sml (from rev 5646, mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-a4-unix.sml	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memalloc-unix.sml	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1,56 @@
+(* memalloc-unix.sml
+ * 2005 Matthew Fluet (mfluet at acm.org)
+ *  Adapted for MLton.
+ *)
+
+(* memalloc-a4-unix.sml
+ *
+ *   Memory allocation (via malloc) for Unix.
+ *   Size of address: 4 bytes.
+ *
+ * Copyright (c) 2004 by The Fellowship of SML/NJ
+ *
+ * Author: Matthias Blume (blume at tti-c.org)
+ *)
+structure CMemAlloc : CMEMALLOC = struct
+
+    exception OutOfMemory
+
+    structure Ptr = MLton.Pointer
+
+    type addr = Ptr.t
+    type addr' = addr
+
+(*
+    structure DL = DynLinkage
+
+    fun main's s = DL.lib_symbol (DL.main_lib, s)
+    val malloc_h = main's "malloc"
+    val free_h = main's "free"
+
+    fun sys_malloc (n : C_Size.word) = 
+        let val w_p = _import * : MLton.Pointer.t -> C_Size.word -> addr;
+            val a = w_p (DL.addr malloc_h) n
+        in if a = Ptr.null then raise OutOfMemory else a
+        end
+
+    fun sys_free (a : addr) = 
+        let val p_u = _import * : MLton.Pointer.t -> addr -> unit;
+        in p_u (DL.addr free_h) a
+        end
+*)
+
+    fun sys_malloc (n : C_Size.word) = 
+        let val w_p = _import "malloc" : C_Size.word -> addr;
+            val a = w_p n
+        in if a = Ptr.null then raise OutOfMemory else a
+        end
+
+    fun sys_free (a : addr) = 
+        let val p_u = _import "free" : addr -> unit;
+        in p_u a
+        end
+
+    fun alloc bytes = sys_malloc (C_Size.fromLarge (Word.toLarge bytes))
+    fun free a = sys_free a
+end

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.32bit-unix.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.32bit-unix.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.32bit-unix.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1,33 +0,0 @@
-local
-   $(SML_LIB)/basis/basis.mlb
-   $(SML_LIB)/basis/mlton.mlb
-in
-   ann
-      "forceUsed"
-      "sequenceNonUnit warn"
-      "warnUnused true"
-   in
-      local
-         linkage.sig
-         ann "allowFFI true" in
-            linkage-libdl.sml
-         end
-         bitop-fn.sml
-         mlrep-i8i16i32i32i64f32f64.sml
-         memaccess.sig
-         memaccess-a4c1s2i4l4ll8f4d8.sml
-         memalloc.sig
-         ann "allowFFI true" in
-            memalloc-a4-unix.sml
-         end
-         memory.sig
-         memory.sml
-      in
-         signature CMEMORY
-         structure CMemory
-         signature DYN_LINKAGE
-         structure DynLinkage
-         structure MLRep
-      end
-   end
-end

Modified: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +1 @@
-platform/memory.$(TARGET_ARCH)-$(TARGET_OS).mlb
+platform/memory.$(TARGET_OS).mlb

Copied: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.unix.mlb (from rev 5646, mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.32bit-unix.mlb)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.32bit-unix.mlb	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/memory.unix.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1,34 @@
+local
+   $(SML_LIB)/basis/basis.mlb
+   $(SML_LIB)/basis/mlton.mlb
+   $(SML_LIB)/basis/c-types.mlb
+in
+   ann
+      "forceUsed"
+      "sequenceNonUnit warn"
+      "warnUnused true"
+   in
+      local
+         linkage.sig
+         ann "allowFFI true" in
+            linkage-libdl.sml
+         end
+         bitop-fn.sml
+         mlrep.sml
+         memaccess.sig
+         memaccess.sml
+         memalloc.sig
+         ann "allowFFI true" in
+            memalloc-unix.sml
+         end
+         memory.sig
+         memory.sml
+      in
+         signature CMEMORY
+         structure CMemory
+         signature DYN_LINKAGE
+         structure DynLinkage
+         structure MLRep
+      end
+   end
+end

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/mlrep-i8i16i32i32i64f32f64.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/mlrep-i8i16i32i32i64f32f64.sml	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/mlrep-i8i16i32i32i64f32f64.sml	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1,65 +0,0 @@
-(* mlrep-i8i16i32i32i64f32f64.sml
- * 2005 Matthew Fluet (mfluet at acm.org)
- *  Adapted for MLton.
- *    char      : Int8, Word8
- *    short     : Int16, Word16
- *    int       : Int32, Word32
- *    long      : Int32, Word32
- *    long long : Int64, Word64
- *    float     : Real32
- *    double    : Real64
- *)
-
-(* mlrep-i32f64.sml
- *
- *   User-visible ML-side representation of certain primitive C types.
- *   x86/Sparc/PPC version (all ints: 32 bit, all floats: 64 bit)
- *
- * Copyright (c) 2004 by The Fellowship of SML/NJ
- *
- * Author: Matthias Blume (blume at tti-c.org)
- *)
-structure MLRep = struct
-    structure Char =
-       struct
-          structure Signed = Int8
-          structure Unsigned = Word8
-          (* word-style bit-operations on integers... *)
-          structure SignedBitops = IntBitOps(structure I = Signed
-                                             structure W = Unsigned)
-       end
-    structure Short =
-       struct
-          structure Signed = Int16
-          structure Unsigned = Word16
-          (* word-style bit-operations on integers... *)
-          structure SignedBitops = IntBitOps(structure I = Signed
-                                             structure W = Unsigned)
-       end
-    structure Int =
-       struct
-          structure Signed = Int32
-          structure Unsigned = Word32
-          (* word-style bit-operations on integers... *)
-          structure SignedBitops = IntBitOps(structure I = Signed
-                                             structure W = Unsigned)
-       end  
-    structure Long =
-       struct
-          structure Signed = Int32
-          structure Unsigned = Word32
-          (* word-style bit-operations on integers... *)
-          structure SignedBitops = IntBitOps(structure I = Signed
-                                             structure W = Unsigned)
-       end
-    structure LongLong =
-       struct
-          structure Signed = Int64
-          structure Unsigned = Word64
-          (* word-style bit-operations on integers... *)
-          structure SignedBitops = IntBitOps(structure I = Signed
-                                             structure W = Unsigned)
-       end
-    structure Float = Real32
-    structure Double = Real64
-end

Copied: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/mlrep.sml (from rev 5646, mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/mlrep-i8i16i32i32i64f32f64.sml)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/mlrep-i8i16i32i32i64f32f64.sml	2007-06-19 13:46:01 UTC (rev 5646)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/mlrep.sml	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1,60 @@
+(* mlrep.sml
+ * 2007 Matthew Fluet (mfluet at acm.org)
+ *  Adapted for MLton.  Make use of $(SML_LIB)/basis/c-types.mlb
+ * 2005 Matthew Fluet (mfluet at acm.org)
+ *  Adapted for MLton.
+ *)
+
+(* mlrep-i32f64.sml
+ *
+ *   User-visible ML-side representation of certain primitive C types.
+ *   x86/Sparc/PPC version (all ints: 32 bit, all floats: 64 bit)
+ *
+ * Copyright (c) 2004 by The Fellowship of SML/NJ
+ *
+ * Author: Matthias Blume (blume at tti-c.org)
+ *)
+structure MLRep = struct
+    structure Char =
+       struct
+          structure Signed = C_SChar
+          structure Unsigned = C_UChar
+          (* word-style bit-operations on integers... *)
+          structure SignedBitops = IntBitOps(structure I = Signed
+                                             structure W = Unsigned)
+       end
+    structure Short =
+       struct
+          structure Signed = C_SShort
+          structure Unsigned = C_UShort
+          (* word-style bit-operations on integers... *)
+          structure SignedBitops = IntBitOps(structure I = Signed
+                                             structure W = Unsigned)
+       end
+    structure Int =
+       struct
+          structure Signed = C_SInt
+          structure Unsigned = C_UInt
+          (* word-style bit-operations on integers... *)
+          structure SignedBitops = IntBitOps(structure I = Signed
+                                             structure W = Unsigned)
+       end  
+    structure Long =
+       struct
+          structure Signed = C_SLong
+          structure Unsigned = C_ULong
+          (* word-style bit-operations on integers... *)
+          structure SignedBitops = IntBitOps(structure I = Signed
+                                             structure W = Unsigned)
+       end
+    structure LongLong =
+       struct
+          structure Signed = C_SLongLong
+          structure Unsigned = C_ULongLong
+          (* word-style bit-operations on integers... *)
+          structure SignedBitops = IntBitOps(structure I = Signed
+                                             structure W = Unsigned)
+       end
+    structure Float = C_Float
+    structure Double = C_Double
+end

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-freebsd.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-freebsd.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-freebsd.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-linux.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-linux.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-linux.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-netbsd.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-netbsd.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-netbsd.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-openbsd.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-openbsd.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.amd64-openbsd.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Added: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.cygwin.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.cygwin.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.cygwin.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1 @@
+../memory.unix.mlb

Added: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.darwin.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.darwin.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.darwin.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1 @@
+../memory.unix.mlb

Added: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.freebsd.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.freebsd.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.freebsd.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1 @@
+../memory.unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.hppa-linux.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.hppa-linux.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.hppa-linux.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Added: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.linux.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.linux.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.linux.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1 @@
+../memory.unix.mlb

Added: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.mingw.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.mingw.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.mingw.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1 @@
+../memory.unix.mlb

Added: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.netbsd.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.netbsd.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.netbsd.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1 @@
+../memory.unix.mlb

Added: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.openbsd.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.openbsd.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.openbsd.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1 @@
+../memory.unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.powerpc-darwin.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.powerpc-darwin.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.powerpc-darwin.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.powerpc-linux.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.powerpc-linux.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.powerpc-linux.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Added: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.solaris.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.solaris.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.solaris.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1 @@
+../memory.unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.sparc-linux.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.sparc-linux.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.sparc-linux.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.sparc-solaris.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.sparc-solaris.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.sparc-solaris.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-cygwin.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-cygwin.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-cygwin.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-darwin.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-darwin.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-darwin.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-freebsd.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-freebsd.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-freebsd.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-linux.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-linux.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-linux.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-mingw.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-mingw.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-mingw.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-netbsd.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-netbsd.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-netbsd.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Deleted: mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-openbsd.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-openbsd.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/lib/mlnlffi/memory/platform/memory.x86-openbsd.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -1 +0,0 @@
-../memory.32bit-unix.mlb

Modified: mlton/branches/on-20050822-x86_64-branch/mlnlffigen/control.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlnlffigen/control.sml	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/mlnlffigen/control.sml	2007-06-19 20:18:39 UTC (rev 5655)
@@ -98,7 +98,9 @@
 
       fun make (t as T {arch, os}) =
          case (arch, os) of
-            (Sparc, _) => SOME {name = toString t, sizes = SizesSparc.sizes,
+            (AMD64, _) => SOME {name = toString t, sizes = SizesAMD64.sizes,
+                                endianShift = EndianLittle.shift}
+          | (Sparc, _) => SOME {name = toString t, sizes = SizesSparc.sizes,
                                 endianShift = EndianBig.shift}
           | (PowerPC, _) => SOME {name = toString t, sizes = SizesPPC.sizes,
                                   endianShift = EndianLittle.shift}

Added: mlton/branches/on-20050822-x86_64-branch/mlnlffigen/sizes-amd64.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlnlffigen/sizes-amd64.sml	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/mlnlffigen/sizes-amd64.sml	2007-06-19 20:18:39 UTC (rev 5655)
@@ -0,0 +1,25 @@
+(* This file was automatically generated using size.c.
+ * It contains information about c data sizes and layout.
+
+ * Limitations:
+ *   1. write proper test for bitFieldAlignment.
+ *   2. include date and system information in this file?
+ *)
+
+structure SizesAMD64 = struct
+val sizes = {    (*** all sizes in bits ***)
+  char = {bits = 8, align = 8},
+  short = {bits = 16, align = 16},
+  int = {bits = 32, align = 32},
+  long = {bits = 64, align = 64},
+  longlong = {bits = 64, align = 64},
+  float = {bits = 32, align = 32},
+  double = {bits = 64, align = 64},
+  longdouble = {bits = 128, align = 128},
+  pointer = {bits = 64, align = 64},
+  min_struct = {bits = 8, align = 8},
+  min_union = {bits = 8, align = 8},
+  onlyPackBitFields = false,
+  ignoreUnnamedBitFieldAlignment = true
+}
+end

Modified: mlton/branches/on-20050822-x86_64-branch/mlnlffigen/sources.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlnlffigen/sources.mlb	2007-06-19 16:27:42 UTC (rev 5654)
+++ mlton/branches/on-20050822-x86_64-branch/mlnlffigen/sources.mlb	2007-06-19 20:18:39 UTC (rev 5655)
@@ -17,6 +17,7 @@
       endian.sml
       endian-big.sml
       endian-little.sml
+      sizes-amd64.sml
       sizes-ppc.sml
       sizes-sparc.sml
       sizes-x86.sml




More information about the MLton-commit mailing list