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]
23 * Copyright (c) 1999 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <fcode/private.h>
32 #include <fcode/log.h>
35 do_run(fcode_env_t
*env
, int next
)
37 token_t target
, indirect
;
38 void (*fn
)(fcode_env_t
*env
);
39 int debug_state
= current_debug_state(env
);
40 extern void do_memory_watch(fcode_env_t
*env
);
44 DEBUGF(NEXT_VITALS
, output_vitals(env
);
45 log_message(MSG_FC_DEBUG
, "\n"));
52 check_for_debug_entry(env
);
55 target
= indirect
& ~1;
56 target
= *((token_t
*)target
);
59 fn
= (void (*)(fcode_env_t
*)) target
;
60 if (do_exec_debug(env
, (void *)fn
))
63 PUSH(DS
, (fstack_t
) (WA
+1));
64 WA
= (token_t
*) target
;
69 check_for_debug_exit(env
);
73 clear_debug_state(env
, debug_state
);
77 do_semi(fcode_env_t
*env
)
79 CHECK_RETURN_DEPTH(env
, 1, ";");
80 check_semi_debug_exit(env
);
81 IP
= (token_t
*) POP(RS
);
85 do_colon(fcode_env_t
*env
)
87 PUSH(RS
, (fstack_t
) IP
);
92 do_alias(fcode_env_t
*env
)
104 execute(fcode_env_t
*env
)
109 * In order to ensure that only this token executes we
110 * force IP to zero after stashing it, then when the stack
111 * unwinds (do_run returns) we can restore the old value.
113 CHECK_DEPTH(env
, 1, "execute");
117 WA
= (token_t
*) POP(DS
);