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 2000-2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _FCODE_PROTO_H
28 #define _FCODE_PROTO_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #define FNPROTO(x) void x(fcode_env_t *)
42 void branch_common(fcode_env_t
*, short, fstack_t
, int);
73 FNPROTO(zero_not_equals
);
75 FNPROTO(zero_less_equals
);
76 FNPROTO(zero_greater
);
77 FNPROTO(zero_greater_equals
);
82 FNPROTO(unsign_greater
);
83 FNPROTO(unsign_less_equals
);
85 FNPROTO(unsign_greater_equals
);
86 FNPROTO(greater_equals
);
123 FNPROTO(slash_w_times
);
124 FNPROTO(slash_l_times
);
163 FNPROTO(dollar_number
);
166 FNPROTO(do_constant
);
170 FNPROTO(idefer_exec
);
174 void make_common_access(fcode_env_t
*, char *, int, int, int,
175 void (*acf_i
)(fcode_env_t
*), void (*acf_s
)(fcode_env_t
*),
176 void (*set_a
)(fcode_env_t
*, int));
183 FNPROTO(dollar_find
);
184 acf_t
voc_find(fcode_env_t
*env
);
193 FNPROTO(compile_comma
);
203 FNPROTO(fc_unimplemented
);
204 FNPROTO(fc_obsolete
);
205 FNPROTO(fc_historical
);
210 FNPROTO(encode_plus
);
211 FNPROTO(encode_phys
);
212 FNPROTO(encode_string
);
213 FNPROTO(encode_bytes
);
215 FNPROTO(device_type
);
218 FNPROTO(finish_device
);
220 FNPROTO(device_name
);
230 uchar_t
next_bytecode(fcode_env_t
*);
231 ushort_t
get_short(fcode_env_t
*);
232 uint_t
get_int(fcode_env_t
*);
234 char *get_name(long *);
236 void header(fcode_env_t
*, char *, int, flag_t
);
237 void do_code(fcode_env_t
*, int, char *, FNPROTO((*)));
238 void push_string(fcode_env_t
*, char *, int);
240 FNPROTO(verify_usage
);
241 FNPROTO(dump_dictionary
);
242 void print_stack_element(fcode_env_t
*, fstack_t
);
243 void dump_data_stack(fcode_env_t
*, int);
244 void dump_return_stack(fcode_env_t
*, int);
245 char *acf_lookup(fcode_env_t
*, acf_t
);
246 char *acf_to_name(fcode_env_t
*, acf_t
);
247 int within_dictionary(fcode_env_t
*, void *);
248 char *acf_backup_search(fcode_env_t
*, acf_t
);
249 void dump_forth_environment(fcode_env_t
*);
250 void forth_abort(fcode_env_t
*, char *, ...);
251 void forth_perror(fcode_env_t
*, char *, ...);
252 void return_to_interact(fcode_env_t
*);
253 char *get_path(fcode_env_t
*, device_t
*);
254 char *search_for_fcode_file(fcode_env_t
*, char *);
255 int current_debug_state(fcode_env_t
*);
256 int debug_flags_to_mask(char *);
257 int do_exec_debug(fcode_env_t
*, void *);
258 int name_is_debugged(fcode_env_t
*, char *);
259 prop_t
*find_property(device_t
*, char *);
260 void buffer_init(fcode_env_t
*env
);
261 void check_for_debug_entry(fcode_env_t
*);
262 void check_for_debug_exit(fcode_env_t
*);
263 void check_semi_debug_exit(fcode_env_t
*);
264 void check_vitals(fcode_env_t
*);
265 void clear_debug_state(fcode_env_t
*, int);
266 void debug_set_level(fcode_env_t
*, int);
267 void define_actions(fcode_env_t
*env
, int n
, token_t
*array
);
268 void do_alias(fcode_env_t
*);
269 void do_bbranch(fcode_env_t
*env
);
270 void do_bdo(fcode_env_t
*);
271 void do_bleave(fcode_env_t
*env
);
272 void do_bloop(fcode_env_t
*env
);
273 void do_bofbranch(fcode_env_t
*env
);
274 void do_bploop(fcode_env_t
*env
);
275 void do_bqbranch(fcode_env_t
*env
);
276 void do_bqdo(fcode_env_t
*env
);
277 void do_creator(fcode_env_t
*env
);
278 void do_default_action(fcode_env_t
*env
);
279 void do_emit(fcode_env_t
*, uchar_t
);
280 void do_literal(fcode_env_t
*);
281 void dump_comma(fcode_env_t
*, char *);
282 void dump_words(fcode_env_t
*);
283 void fevaluate(fcode_env_t
*);
284 void ibuffer_init(fcode_env_t
*env
);
285 void install_builtin_nodes(fcode_env_t
*);
286 void install_does(fcode_env_t
*);
287 void install_openprom_nodes(fcode_env_t
*);
288 void install_package_nodes(fcode_env_t
*);
289 void internal_env_addr(fcode_env_t
*env
);
290 void internal_env_fetch(fcode_env_t
*env
);
291 void internal_env_store(fcode_env_t
*env
);
292 void key(fcode_env_t
*);
293 void keyquestion(fcode_env_t
*);
294 void make_a_node(fcode_env_t
*, char *, int);
295 void output_data_stack(fcode_env_t
*, int);
296 void output_return_stack(fcode_env_t
*, int, int);
297 void output_step_message(fcode_env_t
*);
298 void output_vitals(fcode_env_t
*);
299 void print_property(fcode_env_t
*, prop_t
*, char *);
300 void read_line(fcode_env_t
*);
301 void run_daemon(fcode_env_t
*);
302 void run_fcode_from_file(fcode_env_t
*, char *, int);
303 void tick_literal(fcode_env_t
*);
304 void unbug(fcode_env_t
*);
305 void xbflip(fcode_env_t
*);
306 void xfetch(fcode_env_t
*);
307 void xlflip(fcode_env_t
*);
308 void xstore(fcode_env_t
*);
309 void expose_acf(fcode_env_t
*, char *);
314 void do_run(fcode_env_t
*, int);
316 void *safe_malloc(size_t, char *, int);
317 void *safe_realloc(void *, size_t, char *, int);
318 char *safe_strdup(char *, char *, int);
319 void safe_free(void *, char *, int);
324 FNPROTO(do_definitions
);
325 FNPROTO(do_interact
);
341 FNPROTO(do_previous
);
343 FNPROTO(find_package
);
344 FNPROTO(open_package
);
345 FNPROTO(close_package
);
346 FNPROTO(find_method
);
347 FNPROTO(dollar_call_parent
);
350 FNPROTO(ihandle_to_phandle
);
351 FNPROTO(dollar_call_method
);
352 FNPROTO(dollar_open_package
);
354 FNPROTO(call_environment_method
);
360 FNPROTO(get_my_property
);
362 FNPROTO(decode_string
);
363 FNPROTO(get_inherited_prop
);
364 FNPROTO(delete_property
);
365 FNPROTO(get_package_property
);
366 void get_environment_property(fcode_env_t
*env
, int);
369 FNPROTO(current_device
);
370 FNPROTO(dot_properties
);
374 FNPROTO(do_select_dev
);
375 FNPROTO(do_unselect_dev
);
378 FNPROTO(buffer_colon
);
382 FNPROTO(use_actions
);
383 FNPROTO(action_colon
);
384 FNPROTO(perform_action
);
386 FNPROTO(bracket_tick
);
389 FNPROTO(dump_device
);
390 FNPROTO(dump_instance
);
391 FNPROTO(compile_string
);
392 FNPROTO(parse_two_int
);
394 token_t
*alloc_instance_data(fcode_env_t
*, int, int, int *);
395 FNPROTO(fetch_instance_data
);
396 FNPROTO(set_instance_data
);
397 FNPROTO(address_instance_data
);
398 FNPROTO(instance_variable
);
399 FNPROTO(decode_phys
);
401 void install_actions(fcode_env_t
*env
, token_t
*table
);
402 void set_value_actions(fcode_env_t
*env
, int);
403 void set_internal_value_actions(fcode_env_t
*env
);
404 void set_buffer_actions(fcode_env_t
*env
, int);
406 void system_message(fcode_env_t
*env
, char *msg
);
408 void check_interrupt(void);
409 void complete_interrupt(void);
411 FNPROTO(do_set_action
);
412 void push_a_string(fcode_env_t
*, char *);
413 char *pop_a_string(fcode_env_t
*, int *);
414 char *pop_a_duped_string(fcode_env_t
*, int *);
415 char *parse_a_string(fcode_env_t
*, int *);
416 void push_double(fcode_env_t
*, dforth_t
);
417 dforth_t
pop_double(fcode_env_t
*);
418 dforth_t
peek_double(fcode_env_t
*);
419 void push_xforth(fcode_env_t
*, xforth_t
);
420 xforth_t
pop_xforth(fcode_env_t
*);
421 xforth_t
peek_xforth(fcode_env_t
*);
422 void create_prop(fcode_env_t
*, char *);
423 void create_int_prop(fcode_env_t
*, char *, int);
424 void create_string_prop(fcode_env_t
*, char *, char *);
425 void make_builtin_hooks(fcode_env_t
*, char *);
426 fstack_t
mapping_to_mcookie(uint64_t, size_t, uint64_t, size_t);
427 void delete_mapping(fstack_t
);
428 int is_mcookie(fstack_t
);
429 uint64_t mcookie_to_addr(fstack_t
);
430 fstack_t
mcookie_to_rlen(fstack_t
);
431 fstack_t
mcookie_to_rvirt(fstack_t
);
432 void set_here(fcode_env_t
*, uchar_t
*, char *);
433 int call_my_parent(fcode_env_t
*, char *);
434 FILE *get_dump_fd(fcode_env_t
*);
436 void load_file(fcode_env_t
*);
437 void token_roundup(fcode_env_t
*, char *);
440 void do_fclib_trace(fcode_env_t
*, void *);
441 int do_fclib_step(fcode_env_t
*);
448 #endif /* _FCODE_PROTO_H */