4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
33 #include <fcode/private.h>
34 #include <fcode/log.h>
36 #include <fcdriver/fcdriver.h>
38 #define MIN_VALUES 100
41 check_my_self(fcode_env_t
*env
, char *fn
)
44 forth_abort(env
, "%s: MYSELF is NULL", fn
);
48 get_number_of_parent_address_cells(fcode_env_t
*env
)
52 static char func_name
[] = "get_number_of_parent_address_cells";
54 if (MYSELF
== NULL
) /* Kludge for testing */
57 ncells
= d
->parent_adr_cells
;
59 ncells
= get_default_intprop(env
, "#address-cells", d
->parent
,
61 if (ncells
> MAX_MY_ADDR
) {
62 log_message(MSG_ERROR
, "%s: %s:"
63 " ncells (%d) > MAX_MY_ADDR (%d)\n", func_name
,
64 get_path(env
, d
->parent
), ncells
, MAX_MY_ADDR
);
67 d
->parent_adr_cells
= ncells
;
73 create_ihandle(fcode_env_t
*env
, device_t
*phandle
, instance_t
*parent
)
78 ihandle
= MALLOC(sizeof (instance_t
));
80 i
= max(phandle
->data_size
[INIT_DATA
], MIN_VALUES
);
81 ihandle
->data
[INIT_DATA
] = MALLOC(sizeof (fstack_t
) * i
);
82 memcpy(ihandle
->data
[INIT_DATA
], phandle
->init_data
,
83 (size_t) (sizeof (fstack_t
) * i
));
85 i
= max(phandle
->data_size
[UINIT_DATA
], MIN_VALUES
);
86 ihandle
->data
[UINIT_DATA
] = MALLOC(sizeof (fstack_t
) * i
);
88 ihandle
->my_space
= phandle
->my_space
;
89 memcpy(ihandle
->my_addr
, phandle
->my_addr
, sizeof (ihandle
->my_addr
));
90 ihandle
->parent
= parent
;
91 ihandle
->device
= phandle
;
96 create_phandle(fcode_env_t
*env
, device_t
*parent
)
100 phandle
= MALLOC(sizeof (device_t
));
101 phandle
->init_data
= MALLOC(sizeof (fstack_t
) * MIN_VALUES
);
102 phandle
->data_size
[INIT_DATA
] = 0;
103 phandle
->data_size
[UINIT_DATA
] = 0;
104 phandle
->parent
= parent
;
110 do_push_package(fcode_env_t
*env
, device_t
*d
)
115 CONTEXT
= (token_t
*)(&d
->vocabulary
);
116 debug_msg(DEBUG_CONTEXT
, "CONTEXT:push_package: %s%d/%p/%p\n",
117 get_path(env
, d
), env
->order_depth
, CONTEXT
, env
->current
);
122 push_package(fcode_env_t
*env
)
127 CHECK_DEPTH(env
, 1, "push-package");
129 CONVERT_PHANDLE(env
, d
, ph
);
130 do_push_package(env
, d
);
134 pop_package(fcode_env_t
*env
)
141 interpose(fcode_env_t
*env
)
143 TODO
; /* interpose - not yet implemented */
147 activate_device(fcode_env_t
*env
, device_t
*d
)
149 env
->current_device
= d
;
150 do_push_package(env
, d
);
155 deactivate_device(fcode_env_t
*env
, device_t
*d
)
157 env
->current_device
= d
;
160 CONTEXT
= (token_t
*)(&d
->vocabulary
);
161 debug_msg(DEBUG_CONTEXT
, "CONTEXT:deactivate_device:"
162 " %s%d/%p/%p\n", get_path(env
, d
), env
->order_depth
,
163 CONTEXT
, env
->current
);
169 * Starfire hack to set '/' device_type to 'upa'
171 #include <sys/systeminfo.h>
173 starfire_hack(fcode_env_t
*env
)
177 sysinfo(SI_PLATFORM
, platform
, sizeof (platform
));
178 if (strcmp(platform
, "SUNW,Ultra-Enterprise-10000") == 0 &&
179 find_property(env
->root_node
, "device_type") == NULL
) {
180 create_string_prop(env
, "device_type", "upa");
185 root_node(fcode_env_t
*env
)
188 activate_device(env
, env
->root_node
);
193 child_node(fcode_env_t
*env
)
197 CHECK_DEPTH(env
, 1, "child");
198 CONVERT_PHANDLE(env
, d
, TOS
);
199 TOS
= (fstack_t
)d
->child
;
200 REVERT_PHANDLE(env
, TOS
, d
->child
);
204 peer_node(fcode_env_t
*env
)
208 CHECK_DEPTH(env
, 1, "peer");
209 CONVERT_PHANDLE(env
, d
, TOS
);
210 REVERT_PHANDLE(env
, TOS
, d
->peer
);
214 new_device(fcode_env_t
*env
)
216 device_t
*phandle
, *parent
;
219 check_my_self(env
, "new-device");
221 parent
= MYSELF
->device
;
222 phandle
= create_phandle(env
, parent
);
223 MYSELF
= create_ihandle(env
, phandle
, MYSELF
);
224 activate_device(env
, phandle
);
226 /* Insert new child at end of peer list */
227 for (peer
= parent
->child
; peer
->peer
; peer
= peer
->peer
)
229 peer
->peer
= phandle
;
231 parent
->child
= phandle
; /* First child */
232 ALLOCATE_PHANDLE(env
);
236 finish_device(fcode_env_t
*env
)
239 device_t
*my_dev
, *parent_dev
;
240 instance_t
*parent
, *myself
= MYSELF
;
243 check_my_self(env
, "finish-device");
244 ASSERT(myself
->device
);
245 ASSERT(env
->current_device
);
246 n
= myself
->device
->data_size
[INIT_DATA
];
249 * Paranoia.. reserve a little more instance data than we need
251 mem
= MALLOC(sizeof (fstack_t
) * (n
+8));
252 memcpy(mem
, MYSELF
->device
->init_data
, sizeof (fstack_t
) * n
);
253 FREE(myself
->device
->init_data
);
254 my_dev
= myself
->device
;
255 my_dev
->init_data
= mem
;
256 parent
= MYSELF
->parent
;
257 parent_dev
= env
->current_device
->parent
;
260 activate_device(env
, parent_dev
);
264 create_internal_value(fcode_env_t
*env
, char *name
, int offset
, int token
)
266 header(env
, name
, strlen(name
), 0);
267 COMPILE_TOKEN(&noop
);
270 SET_TOKEN(token
, 0, name
, LINK_TO_ACF(env
->lastlink
));
274 set_internal_value_actions(env
);
278 create_my_self(fcode_env_t
*env
)
280 int offset
= offsetof(fcode_env_t
, my_self
);
282 create_internal_value(env
, "my-self", offset
, 0x203);
286 create_my_space(fcode_env_t
*env
)
288 int offset
= offsetof(instance_t
, my_space
);
290 create_internal_value(env
, "my-space", -offset
, 0x103);
294 my_address(fcode_env_t
*env
)
299 check_my_self(env
, "my-address");
300 ncells
= get_number_of_parent_address_cells(env
);
301 adr_ptr
= MYSELF
->my_addr
;
309 my_unit(fcode_env_t
*env
)
311 check_my_self(env
, "my-unit");
313 PUSH(DS
, MYSELF
->my_space
);
317 my_args(fcode_env_t
*env
)
319 check_my_self(env
, "my-args");
320 PUSH(DS
, (fstack_t
)MYSELF
->my_args
);
321 PUSH(DS
, (fstack_t
)MYSELF
->my_args_len
);
325 call_my_parent(fcode_env_t
*env
, char *method
)
327 push_a_string(env
, method
);
328 dollar_call_parent(env
);
329 return (env
->last_error
);
333 set_args(fcode_env_t
*env
)
338 fstack_t
*adr_ptr
, *adr_ptr1
, space
;
340 CHECK_DEPTH(env
, 4, "set-args");
342 check_my_self(env
, "set-args");
345 * Handle args argument of set-args.
347 if (MYSELF
->my_args
) {
348 FREE(MYSELF
->my_args
);
349 MYSELF
->my_args
= NULL
;
352 MYSELF
->my_args
= pop_a_duped_string(env
, &args_len
);
353 MYSELF
->my_args_len
= args_len
;
355 if (call_my_parent(env
, "decode-unit"))
356 forth_abort(env
, "set-args: decode-unit failed");
358 ncells
= get_number_of_parent_address_cells(env
);
361 * Kludge: For GP2, my-space comes from decode-unit hi.address.
362 * for PCI, my-space from decode-unit won't have the bus#, so we need
363 * to get it from config_address. Unfortunately, there is no easy
364 * way to figure out here which one we're looking at. We take the
365 * expediant of or'ing the two values together.
367 space
= POP(DS
); /* pop phys.hi */
368 if ((cdp
= (common_data_t
*)env
->private) != NULL
)
369 space
|= cdp
->fc
.config_address
;
371 MYSELF
->device
->my_space
= MYSELF
->my_space
= space
;
373 adr_ptr
= MYSELF
->my_addr
;
374 adr_ptr1
= MYSELF
->device
->my_addr
;
376 *adr_ptr
++ = *adr_ptr1
++ = POP(DS
);
381 my_parent(fcode_env_t
*env
)
383 check_my_self(env
, "my-parent");
384 PUSH(DS
, (fstack_t
)MYSELF
->parent
);
388 open_instance_chain(fcode_env_t
*env
, device_t
*phandle
, int exec
)
394 parent
= open_instance_chain(env
, phandle
->parent
, exec
);
395 return (create_ihandle(env
, phandle
, parent
));
399 close_instance_chain(fcode_env_t
*env
, instance_t
*ihandle
, int exec
)
404 parent
= ihandle
->parent
;
405 close_instance_chain(env
, parent
, exec
);
406 if (ihandle
->my_args
)
407 FREE(ihandle
->my_args
);
413 begin_package(fcode_env_t
*env
)
418 CHECK_DEPTH(env
, 6, "begin-package");
420 name
= pop_a_string(env
, NULL
);
428 MYSELF
= (instance_t
*)POP(DS
);
429 check_my_self(env
, "begin-package");
433 log_message(MSG_INFO
, "Package '%s' not found\n", name
);
438 open_package(fcode_env_t
*env
)
444 CHECK_DEPTH(env
, 3, "open-package");
445 CONVERT_PHANDLE(env
, phandle
, POP(DS
));
446 ihandle
= open_instance_chain(env
, phandle
, 1);
447 ihandle
->my_args
= pop_a_duped_string(env
, &len
);
448 ihandle
->my_args_len
= len
;
449 PUSH(DS
, (fstack_t
)ihandle
);
453 dollar_open_package(fcode_env_t
*env
)
457 CHECK_DEPTH(env
, 4, "$open-package");
470 close_package(fcode_env_t
*env
)
474 CHECK_DEPTH(env
, 1, "close-package");
475 ihandle
= (instance_t
*)POP(DS
);
476 close_instance_chain(env
, ihandle
, 1);
479 static void (*find_method_hook
)(fcode_env_t
*);
482 set_find_method_hook(fcode_env_t
*env
, void (*hook
)(fcode_env_t
*))
484 find_method_hook
= hook
;
488 find_method(fcode_env_t
*env
)
494 CHECK_DEPTH(env
, 3, "find-method");
495 if (find_method_hook
) {
496 (*find_method_hook
)(env
);
497 if (TOS
) /* Found it */
503 CONVERT_PHANDLE(env
, device
, d
);
504 PUSH(DS
, (fstack_t
)&device
->vocabulary
);
506 PUSH(DS
, (fstack_t
)acf
);
513 * 'call-package' Fcode
516 call_package(fcode_env_t
*env
)
518 instance_t
*ihandle
, *saved_myself
;
520 CHECK_DEPTH(env
, 2, "call-package");
521 ihandle
= (instance_t
*)POP(DS
);
522 saved_myself
= MYSELF
;
525 MYSELF
= saved_myself
;
529 ihandle_to_phandle(fcode_env_t
*env
)
533 CHECK_DEPTH(env
, 1, "ihandle>phandle");
534 i
= (instance_t
*)TOS
;
535 REVERT_PHANDLE(env
, TOS
, i
->device
);
539 get_package_name(fcode_env_t
*env
, device_t
*d
)
544 prop
= lookup_package_property(env
, "name", d
);
548 name
= (char *)prop
->data
;
553 static char *package_search_path
= "/packages:/openprom";
556 match_package_path(fcode_env_t
*env
, char *path
)
563 d
= env
->root_node
->child
;
566 d
= env
->current_device
;
567 while (*path
!= '\0' && d
!= NULL
) {
568 name
= get_package_name(env
, d
);
570 if (strncmp(name
, path
, len
) == 0) {
587 locate_package(fcode_env_t
*env
, char *start
)
593 if ((d
= match_package_path(env
, start
)) != NULL
)
597 * ignore starting '/'
602 fpath
= STRDUP(package_search_path
);
603 for (p
= fpath
; p
!= NULL
; p
= next_p
) {
604 if ((next_p
= strchr(p
, ':')) != NULL
)
606 tpath
= MALLOC(strlen(p
) + strlen(start
) + 2);
607 sprintf(tpath
, "%s/%s", p
, start
);
608 if ((d
= match_package_path(env
, tpath
)) != NULL
) {
620 find_package(fcode_env_t
*env
)
626 CHECK_DEPTH(env
, 2, "find-package");
627 if ((path
= pop_a_duped_string(env
, NULL
)) != NULL
) {
628 if (strcmp(path
, "/") == 0)
629 package
= env
->root_node
;
631 package
= locate_package(env
, path
);
633 REVERT_PHANDLE(env
, ph
, package
);
641 encode_unit_hack(fcode_env_t
*env
)
644 uint_t ncells
= get_number_of_parent_address_cells(env
);
646 for (i
= 0; i
< ncells
; i
++)
648 push_a_string(env
, NULL
);
652 dollar_call_method(fcode_env_t
*env
)
654 instance_t
*old_myself
;
659 CHECK_DEPTH(env
, 3, "$call-method");
660 check_my_self(env
, "$call-method");
662 myself
= (instance_t
*)POP(DS
);
664 method
= (char *)DS
[-1];
665 debug_msg(DEBUG_CALL_METHOD
, "$call_method %s\n", method
);
667 if (old_myself
&& !myself
) {
668 /* We hit the root of our tree */
669 device
= old_myself
->device
;
674 check_my_self(env
, "$call-method");
675 device
= MYSELF
->device
;
676 do_push_package(env
, device
);
677 PUSH(DS
, (fstack_t
)device
);
678 REVERT_PHANDLE(env
, TOS
, device
);
683 } else if (strcmp(method
, "encode-unit") == 0) {
684 encode_unit_hack(env
);
686 throw_from_fclib(env
, 1, "Unimplemented package method: %s%s",
687 get_path(env
, device
), method
);
690 do_push_package(env
, MYSELF
->device
);
694 dollar_call_parent(fcode_env_t
*env
)
696 CHECK_DEPTH(env
, 2, "$call-parent");
698 check_my_self(env
, "$call-parent");
700 PUSH(DS
, (fstack_t
)MYSELF
->parent
);
701 dollar_call_method(env
);
706 current_device(fcode_env_t
*env
)
708 PUSH(DS
, (fstack_t
)&env
->current_device
);
712 get_path(fcode_env_t
*env
, device_t
*d
)
714 char *pre_path
, *name
, *path
;
718 pre_path
= get_path(env
, d
->parent
);
720 pre_path
= STRDUP("");
722 name
= get_package_name(env
, d
);
723 n
= strlen(pre_path
) + strlen(name
) + 1;
725 strcpy(path
, pre_path
);
727 if (d
->child
&& d
->parent
)
734 pwd_dollar(fcode_env_t
*env
)
736 if (env
->current_device
)
737 push_a_string(env
, get_path(env
, env
->current_device
));
739 push_a_string(env
, NULL
);
743 pwd(fcode_env_t
*env
)
745 if (env
->current_device
) {
746 log_message(MSG_INFO
, "%s\n",
747 get_path(env
, env
->current_device
));
749 log_message(MSG_INFO
, "No device context\n");
754 do_ls(fcode_env_t
*env
)
758 if (env
->current_device
== NULL
) {
759 log_message(MSG_INFO
, "No device context\n");
763 d
= env
->current_device
->child
;
767 name
= get_package_name(env
, d
);
768 REVERT_PHANDLE(env
, ph
, d
);
769 log_message(MSG_INFO
, "%llx %s\n", (uint64_t)ph
, name
);
775 paren_cd(fcode_env_t
*env
)
780 str
= pop_a_string(env
, NULL
);
781 if (strcmp(str
, "/") == 0) {
786 if (env
->current_device
== NULL
) {
787 log_message(MSG_INFO
, "No device context\n");
791 if (strcmp(str
, "..") == 0)
792 p
= env
->current_device
->parent
;
794 device_t
*n
= env
->current_device
->child
;
800 name
= get_package_name(env
, n
);
801 if (strcmp(name
, str
) == 0) {
810 activate_device(env
, p
);
812 log_message(MSG_INFO
, "No such node: %s\n", str
);
817 do_cd(fcode_env_t
*env
)
824 do_unselect_dev(fcode_env_t
*env
)
826 check_my_self(env
, "unselect-dev");
827 PUSH(DS
, (fstack_t
)MYSELF
);
829 deactivate_device(env
, NULL
);
833 do_select_dev(fcode_env_t
*env
)
838 dollar_open_package(env
);
840 MYSELF
= (instance_t
*)POP(DS
);
841 check_my_self(env
, "select-dev");
842 activate_device(env
, MYSELF
->device
);
845 log_message(MSG_INFO
, "Can't open package\n");
850 device_end(fcode_env_t
*env
)
852 if (env
->current_device
) {
853 deactivate_device(env
, NULL
);
858 end_package(fcode_env_t
*env
)
861 close_instance_chain(env
, MYSELF
, 0);
867 exec_parent_method(fcode_env_t
*env
)
869 instance_t
*old_myself
;
875 check_my_self(env
, "exec-parent-method");
877 MYSELF
= MYSELF
->parent
;
879 method
= (char *)DS
[-1];
880 debug_msg(DEBUG_FIND_FCODE
, "exec_parent_method: '%s'\n", method
);
882 check_my_self(env
, "exec-parent-method");
883 device
= MYSELF
->device
;
884 do_push_package(env
, device
);
885 PUSH(DS
, (fstack_t
)device
);
886 REVERT_PHANDLE(env
, TOS
, device
);
890 debug_msg(DEBUG_FIND_FCODE
, "exec-parent-method: '%s'/%x"
891 " execute\n", method
, (int)TOS
);
895 debug_msg(DEBUG_FIND_FCODE
, "exec-parent-method: '%s'"
896 " not found\n", method
);
900 do_push_package(env
, MYSELF
->device
);
904 dump_device(fcode_env_t
*env
)
909 CONVERT_PHANDLE(env
, phandle
, POP(DS
));
910 log_message(MSG_DEBUG
, "Node: %p\n", phandle
);
911 log_message(MSG_DEBUG
, " Parent: (%8p) %p\n",
912 &phandle
->parent
, phandle
->parent
);
913 log_message(MSG_DEBUG
, " Child: (%8p) %p\n",
914 &phandle
->child
, phandle
->child
);
915 log_message(MSG_DEBUG
, " Peer: (%8p) %p\n",
916 &phandle
->peer
, phandle
->peer
);
917 log_message(MSG_DEBUG
, " Private: (%8p) %p\n",
918 &phandle
->private, phandle
->private);
919 log_message(MSG_DEBUG
, " Props: (%8p) %p\n",
920 &phandle
->properties
, phandle
->properties
);
921 log_message(MSG_DEBUG
, " Voc: (%8p) %p\n",
922 &phandle
->vocabulary
, phandle
->vocabulary
);
923 log_message(MSG_DEBUG
, " sizes: (%8p) %d %d\n",
925 phandle
->data_size
[INIT_DATA
],
926 phandle
->data_size
[UINIT_DATA
]);
927 log_message(MSG_DEBUG
, " my_space: %x\n", phandle
->my_space
);
928 log_message(MSG_DEBUG
, " my_addr :");
929 for (i
= 0; i
< MAX_MY_ADDR
; i
++)
930 log_message(MSG_DEBUG
, " %x", (int)phandle
->my_addr
[i
]);
931 log_message(MSG_DEBUG
, "\n");
932 log_message(MSG_DEBUG
, " data: (%8p)\n", phandle
->init_data
);
933 for (i
= 0; i
< phandle
->data_size
[INIT_DATA
]; i
++) {
934 log_message(MSG_DEBUG
, " %3d -> (%8p) %x\n", i
,
935 &phandle
->init_data
[i
], phandle
->init_data
[i
]);
940 dump_instance(fcode_env_t
*env
)
945 ihandle
= (instance_t
*)POP(DS
);
946 log_message(MSG_DEBUG
, "Ihandle: %p\n", ihandle
);
947 log_message(MSG_DEBUG
, " Parent: (%8p) %p\n",
948 &ihandle
->parent
, ihandle
->parent
);
949 log_message(MSG_DEBUG
, " Device: (%8p) %p\n",
950 &ihandle
->device
, ihandle
->device
);
951 log_message(MSG_DEBUG
, " args: '%s'\n",
952 ((ihandle
->my_args
) ? ihandle
->my_args
: ""));
953 log_message(MSG_DEBUG
, " my-space: %x\n", ihandle
->my_space
);
954 log_message(MSG_DEBUG
, " my_addr :");
955 for (i
= 0; i
< MAX_MY_ADDR
; i
++)
956 log_message(MSG_DEBUG
, " %x", (int)ihandle
->my_addr
[i
]);
957 log_message(MSG_DEBUG
, "\n");
958 log_message(MSG_DEBUG
, " sizes: %d %d\n",
959 ihandle
->device
->data_size
[INIT_DATA
],
960 ihandle
->device
->data_size
[UINIT_DATA
]);
961 log_message(MSG_DEBUG
, " data: (%8p) %x %x\n",
962 ihandle
->data
, ihandle
->data
[0], ihandle
->data
[1]);
963 if (ihandle
->device
->data_size
[INIT_DATA
]) {
964 log_message(MSG_DEBUG
, " Initialised:\n");
965 for (i
= 0; i
< ihandle
->device
->data_size
[INIT_DATA
]; i
++) {
966 log_message(MSG_DEBUG
, " %3d -> (%8p) %x\n", i
,
967 &ihandle
->data
[INIT_DATA
][i
],
968 ihandle
->data
[INIT_DATA
][i
]);
971 if (ihandle
->device
->data_size
[INIT_DATA
]) {
972 log_message(MSG_DEBUG
, " UnInitialised:\n");
973 for (i
= 0; i
< ihandle
->device
->data_size
[UINIT_DATA
]; i
++) {
974 log_message(MSG_DEBUG
, " %3d -> (%8p) %x\n", i
,
975 &ihandle
->data
[UINIT_DATA
][i
],
976 ihandle
->data
[UINIT_DATA
][i
]);
985 #ifdef CONVERT_HANDLES
987 safe_convert_phandle(fcode_env_t
*env
, fstack_t d
)
989 return ((device_t
*)d
);
993 safe_revert_phandle(fcode_env_t
*env
, device_t
*d
)
995 return ((fstack_t
)d
);
999 safe_allocate_phandle(fcode_env_t
*env
)
1008 fcode_env_t
*env
= initial_env
;
1015 #ifdef CONVERT_HANDLES
1016 env
->convert_phandle
= safe_convert_phandle
;
1017 env
->revert_phandle
= safe_revert_phandle
;
1018 env
->allocate_phandle
= safe_allocate_phandle
;
1021 /* build the root node */
1022 d
= create_phandle(env
, NULL
);
1023 env
->current_device
= d
;
1025 push_a_string(env
, name
);
1027 env
->current_device
= NULL
;
1029 create_my_self(env
);
1030 create_my_space(env
);
1032 P1275(0x102, 0, "my-address", my_address
);
1033 /* Fcode 0x103 "my-space" is created using create_internal_value */
1035 P1275(0x11f, 0, "new-device", new_device
);
1037 P1275(0x127, 0, "finish-device", finish_device
);
1039 FCODE(0x129, 0, "push-package", push_package
);
1040 FCODE(0x12a, 0, "pop-package", pop_package
);
1041 FCODE(0x12b, 0, "interpose", interpose
);
1043 P1275(0x202, 0, "my-args", my_args
);
1044 /* Fcode 0x203 "my-self" is created using create_internal_value */
1045 P1275(0x204, 0, "find-package", find_package
);
1046 P1275(0x205, 0, "open-package", open_package
);
1047 P1275(0x206, 0, "close-package", close_package
);
1048 P1275(0x207, 0, "find-method", find_method
);
1049 P1275(0x208, 0, "call-package", call_package
);
1050 P1275(0x209, 0, "$call-parent", dollar_call_parent
);
1051 P1275(0x20a, 0, "my-parent", my_parent
);
1052 P1275(0x20b, 0, "ihandle>phandle", ihandle_to_phandle
);
1054 P1275(0x20d, 0, "my-unit", my_unit
);
1055 P1275(0x20e, 0, "$call-method", dollar_call_method
);
1056 P1275(0x20f, 0, "$open-package", dollar_open_package
);
1058 P1275(0x23b, 0, "child", child_node
);
1059 P1275(0x23c, 0, "peer", peer_node
);
1061 P1275(0x23f, 0, "set-args", set_args
);
1063 FORTH(IMMEDIATE
, "root-node", root_node
);
1064 FORTH(0, "current-device", current_device
);
1065 FORTH(0, "pwd$", pwd_dollar
);
1066 FORTH(IMMEDIATE
, "pwd", pwd
);
1067 FORTH(IMMEDIATE
, "ls", do_ls
);
1068 FORTH(IMMEDIATE
, "(cd)", paren_cd
);
1069 FORTH(IMMEDIATE
, "cd", do_cd
);
1070 FORTH(IMMEDIATE
, "device-end", device_end
);
1071 FORTH(0, "select-dev", do_select_dev
);
1072 FORTH(0, "unselect-dev", do_unselect_dev
);
1073 FORTH(0, "begin-package", begin_package
);
1074 FORTH(0, "end-package", end_package
);
1075 FORTH(IMMEDIATE
, "dump-device", dump_device
);
1076 FORTH(IMMEDIATE
, "dump-instance", dump_instance
);
1077 FORTH(0, "exec-parent-method", exec_parent_method
);