1 /* -----------------------------------------------------------------------
2 osf.S - Copyright (c) 1998 Cygnus Solutions
4 Alpha/OSF Foreign Function Interface
6 $Id: osf.S,v 1.1.1.1 1998/11/29 16:48:16 green Exp $
8 Permission is hereby granted, free of charge, to any person obtaining
9 a copy of this software and associated documentation files (the
10 ``Software''), to deal in the Software without restriction, including
11 without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense, and/or sell copies of the Software, and to
13 permit persons to whom the Software is furnished to do so, subject to
14 the following conditions:
16 The above copyright notice and this permission notice shall be included
17 in all copies or substantial portions of the Software.
19 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 OTHER DEALINGS IN THE SOFTWARE.
26 ----------------------------------------------------------------------- */
42 #define SIZEOF_FRAME (6*8)
50 lda $30, -SIZEOF_FRAME($30)
53 stq flags, flags_ofs($30)
54 stq raddr, raddr_ofs($30)
57 .frame $15, SIZEOF_FRAME, $26, 0
58 .mask 0x4008000, -SIZEOF_FRAME
61 mov callback, $27 # mov callback into place
62 subq $30, bytes, $30 # allocate stack space
64 # Call ffi_prep_args; ecif, bytes and flags are already in place.
65 mov $30, $16 # push stack arg
68 # Load up all of the (potential) argument registers.
82 # Get rid of the arg reg temp space and call the function.
87 # If the return value pointer is NULL, assume no return value.
88 ldq raddr, raddr_ofs($15)
91 ldq flags, flags_ofs($15)
92 cmpeq flags, FFI_TYPE_INT, $1
94 cmpeq flags, FFI_TYPE_FLOAT, $2
96 cmpeq flags, FFI_TYPE_DOUBLE, $3
115 lda $30, SIZEOF_FRAME($30)