Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/cm/ffi/memory.sig
ViewVC logotype

View of /sml/trunk/src/cm/ffi/memory.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (download) (as text) (annotate)
Thu Dec 21 14:54:56 2000 UTC (18 years, 8 months ago) by blume
File size: 1879 byte(s)
merging changes from private branch
(*
 * Primitives for "raw" memory access.
 *
 *   (C) 2000, Lucent Technologies, Bell Laboratories
 *
 * author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
 *)
signature CMEMORY = sig
    type addr
    val null : addr
    val isNull : addr -> bool
    val ++ : addr * int -> addr
    val -- : addr * addr -> int
    val compare : addr * addr -> order
    val bcopy : { from: addr, to: addr, bytes: word } -> unit
    val alloc : word -> addr option
    val free : addr -> unit

    type uchar
    type schar
    type ushort
    type sshort
    type uint
    type sint
    type ulong
    type slong
    type float
    type double

    val addr_size : word
    val char_size : word
    val short_size : word
    val int_size : word
    val long_size : word
    val float_size : word
    val double_size : word

    type 'a load_instr = addr -> 'a
    type 'a store_instr = addr * 'a -> unit

    val load_addr : addr load_instr
    val load_uchar : uchar load_instr
    val load_ushort : ushort load_instr
    val load_uint : uint load_instr
    val load_ulong : ulong load_instr
    val load_float : float load_instr
    val load_double : double load_instr

    val store_addr : addr store_instr
    val store_uchar : uchar store_instr
    val store_ushort : ushort store_instr
    val store_uint : uint store_instr
    val store_ulong : ulong store_instr
    val store_float : float store_instr
    val store_double : double store_instr

    val char_u2s : uchar -> schar
    val char_s2u : schar -> uchar
    val short_u2s : ushort -> sshort
    val short_s2u : sshort -> ushort
    val int_u2s : uint -> sint
    val int_s2u : sint -> uint
    val long_u2s : ulong -> slong
    val long_s2u : slong -> ulong

    val >> : uint * word -> uint
    val << : uint * word -> uint
    val andb : uint * uint -> uint
    val orb : uint * uint -> uint
    val notb : uint -> uint
end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0