4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
24 * Copyright (c) 1999 by Sun Microsystems, Inc.
25 * All rights reserved.
28 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <fcode/private.h>
35 * Return a pointer to the allocated instance data.
36 * If the data was initialised then return a pointer to the initialisation
37 * buffer otherwise return a pointer to the un-init data.
40 alloc_instance_data(fcode_env_t
*env
, int init
, int n
, int *offset
)
44 *offset
= ptr
= MYSELF
->device
->data_size
[init
];
45 MYSELF
->device
->data_size
[init
] += n
;
46 if (init
== INIT_DATA
)
47 return (&MYSELF
->device
->init_data
[ptr
]);
49 return (&MYSELF
->data
[init
][ptr
]);
53 get_instance_address(fcode_env_t
*env
)
59 CHECK_DEPTH(env
, 1, "get_instance_address");
60 ptr
= (token_t
*) POP(DS
);
68 return (&MYSELF
->data
[which
][offset
]);
72 fetch_instance_data(fcode_env_t
*env
)
76 CHECK_DEPTH(env
, 1, "get_instance_data");
77 ptr
= get_instance_address(env
);
82 set_instance_data(fcode_env_t
*env
)
86 CHECK_DEPTH(env
, 2, "set_instance_data");
87 ptr
= get_instance_address(env
);
92 address_instance_data(fcode_env_t
*env
)
96 CHECK_DEPTH(env
, 1, "address_instance_data");
97 ptr
= get_instance_address(env
);
98 PUSH(DS
, (fstack_t
) ptr
);
102 instance_variable(fcode_env_t
*env
)
106 PUSH(DS
, (fstack_t
) WA
);
107 ptr
= get_instance_address(env
);
108 PUSH(DS
, (fstack_t
) ptr
);
112 idefer_exec(fcode_env_t
*env
)
114 CHECK_DEPTH(env
, 1, "idefer_exec");
115 fetch_instance_data(env
);