1 /* $NetBSD: Locore.c,v 1.7 2000/08/20 07:04:59 tsubai Exp $ */
4 * SPDX-License-Identifier:BSD-4-Clause AND BSD-2-Clause-FreeBSD
6 * Copyright (C) 1995, 1996 Wolfgang Solfrank.
7 * Copyright (C) 1995, 1996 TooLs GmbH.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by TooLs GmbH.
21 * 4. The name of TooLs GmbH may not be used to endorse or promote products
22 * derived from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
30 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
32 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 * Copyright (C) 2000 Benno Rice.
37 * All rights reserved.
39 * Redistribution and use in source and binary forms, with or without
40 * modification, are permitted provided that the following conditions
42 * 1. Redistributions of source code must retain the above copyright
43 * notice, this list of conditions and the following disclaimer.
44 * 2. Redistributions in binary form must reproduce the above copyright
45 * notice, this list of conditions and the following disclaimer in the
46 * documentation and/or other materials provided with the distribution.
48 * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR
49 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
50 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
51 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
52 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
53 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
54 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
55 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
56 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
57 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 #include <sys/cdefs.h>
61 __FBSDID("$FreeBSD$");
63 #include <sys/param.h>
64 #include <sys/kernel.h>
66 #include <sys/mutex.h>
67 #include <sys/systm.h>
70 #include <vm/vm_page.h>
73 #include <machine/bus.h>
74 #include <machine/md_var.h>
75 #include <machine/ofw_machdep.h>
76 #include <machine/stdarg.h>
78 #include <dev/ofw/openfirm.h>
79 #include <dev/ofw/ofwvar.h>
82 static int ofw_real_init(ofw_t, void *openfirm);
83 static int ofw_real_test(ofw_t, const char *name);
84 static phandle_t ofw_real_peer(ofw_t, phandle_t node);
85 static phandle_t ofw_real_child(ofw_t, phandle_t node);
86 static phandle_t ofw_real_parent(ofw_t, phandle_t node);
87 static phandle_t ofw_real_instance_to_package(ofw_t, ihandle_t instance);
88 static ssize_t ofw_real_getproplen(ofw_t, phandle_t package,
89 const char *propname);
90 static ssize_t ofw_real_getprop(ofw_t, phandle_t package, const char *propname,
91 void *buf, size_t buflen);
92 static int ofw_real_nextprop(ofw_t, phandle_t package, const char *previous,
94 static int ofw_real_setprop(ofw_t, phandle_t package, const char *propname,
95 const void *buf, size_t len);
96 static ssize_t ofw_real_canon(ofw_t, const char *device, char *buf, size_t len);
97 static phandle_t ofw_real_finddevice(ofw_t, const char *device);
98 static ssize_t ofw_real_instance_to_path(ofw_t, ihandle_t instance, char *buf,
100 static ssize_t ofw_real_package_to_path(ofw_t, phandle_t package, char *buf,
102 static int ofw_real_call_method(ofw_t, ihandle_t instance, const char *method,
103 int nargs, int nreturns, cell_t *args_and_returns);
104 static int ofw_real_interpret(ofw_t ofw, const char *cmd, int nreturns,
106 static ihandle_t ofw_real_open(ofw_t, const char *device);
107 static void ofw_real_close(ofw_t, ihandle_t instance);
108 static ssize_t ofw_real_read(ofw_t, ihandle_t instance, void *addr, size_t len);
109 static ssize_t ofw_real_write(ofw_t, ihandle_t instance, const void *addr,
111 static int ofw_real_seek(ofw_t, ihandle_t instance, u_int64_t pos);
112 static caddr_t ofw_real_claim(ofw_t, void *virt, size_t size, u_int align);
113 static void ofw_real_release(ofw_t, void *virt, size_t size);
114 static void ofw_real_enter(ofw_t);
115 static void ofw_real_exit(ofw_t);
117 static ofw_method_t ofw_real_methods[] = {
118 OFWMETHOD(ofw_init, ofw_real_init),
119 OFWMETHOD(ofw_peer, ofw_real_peer),
120 OFWMETHOD(ofw_child, ofw_real_child),
121 OFWMETHOD(ofw_parent, ofw_real_parent),
122 OFWMETHOD(ofw_instance_to_package, ofw_real_instance_to_package),
123 OFWMETHOD(ofw_getproplen, ofw_real_getproplen),
124 OFWMETHOD(ofw_getprop, ofw_real_getprop),
125 OFWMETHOD(ofw_nextprop, ofw_real_nextprop),
126 OFWMETHOD(ofw_setprop, ofw_real_setprop),
127 OFWMETHOD(ofw_canon, ofw_real_canon),
128 OFWMETHOD(ofw_finddevice, ofw_real_finddevice),
129 OFWMETHOD(ofw_instance_to_path, ofw_real_instance_to_path),
130 OFWMETHOD(ofw_package_to_path, ofw_real_package_to_path),
132 OFWMETHOD(ofw_test, ofw_real_test),
133 OFWMETHOD(ofw_call_method, ofw_real_call_method),
134 OFWMETHOD(ofw_interpret, ofw_real_interpret),
135 OFWMETHOD(ofw_open, ofw_real_open),
136 OFWMETHOD(ofw_close, ofw_real_close),
137 OFWMETHOD(ofw_read, ofw_real_read),
138 OFWMETHOD(ofw_write, ofw_real_write),
139 OFWMETHOD(ofw_seek, ofw_real_seek),
140 OFWMETHOD(ofw_claim, ofw_real_claim),
141 OFWMETHOD(ofw_release, ofw_real_release),
142 OFWMETHOD(ofw_enter, ofw_real_enter),
143 OFWMETHOD(ofw_exit, ofw_real_exit),
148 static ofw_def_t ofw_real = {
155 static ofw_def_t ofw_32bit = {
162 static MALLOC_DEFINE(M_OFWREAL, "ofwreal",
163 "Open Firmware Real Mode Bounce Page");
165 static int (*openfirmware)(void *);
167 static vm_offset_t of_bounce_phys;
168 static caddr_t of_bounce_virt;
169 static off_t of_bounce_offset;
170 static size_t of_bounce_size;
171 static struct mtx of_bounce_mtx;
173 extern int ofw_real_mode;
176 * After the VM is up, allocate a wired, low memory bounce page.
179 static void ofw_real_bounce_alloc(void *);
181 SYSINIT(ofw_real_bounce_alloc, SI_SUB_KMEM, SI_ORDER_ANY,
182 ofw_real_bounce_alloc, NULL);
187 mtx_lock(&of_bounce_mtx);
188 of_bounce_offset = 0;
194 mtx_unlock(&of_bounce_mtx);
198 ofw_real_bounce_alloc(void *junk)
203 * Check that ofw_real is actually in use before allocating wads
204 * of memory. Do this by checking if our mutex has been set up.
206 if (!mtx_initialized(&of_bounce_mtx))
210 * Allocate a page of contiguous, wired physical memory that can
211 * fit into a 32-bit address space and accessed from real mode.
213 temp = contigmalloc(4 * PAGE_SIZE, M_OFWREAL, 0, 0,
214 ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE,
217 panic("%s: Not able to allocated contiguous memory\n", __func__);
219 mtx_lock(&of_bounce_mtx);
221 of_bounce_virt = temp;
223 of_bounce_phys = vtophys(of_bounce_virt);
224 of_bounce_size = 4 * PAGE_SIZE;
227 * For virtual-mode OF, direct map this physical address so that
228 * we have a 32-bit virtual address to give OF.
231 if (!ofw_real_mode && (!hw_direct_map || DMAP_BASE_ADDRESS != 0))
232 pmap_kenter(of_bounce_phys, of_bounce_phys);
234 mtx_unlock(&of_bounce_mtx);
238 ofw_real_map(const void *buf, size_t len)
240 static char emergency_buffer[255];
243 mtx_assert(&of_bounce_mtx, MA_OWNED);
245 if (of_bounce_virt == NULL) {
247 * If we haven't set up the MMU, then buf is guaranteed
248 * to be accessible to OF, because the only memory we
249 * can use right now is memory mapped by firmware.
251 if (!pmap_bootstrapped)
252 return (cell_t)((uintptr_t)buf & ~DMAP_BASE_ADDRESS);
255 * XXX: It is possible for us to get called before the VM has
256 * come online, but after the MMU is up. We don't have the
257 * bounce buffer yet, but can no longer presume a 1:1 mapping.
258 * Copy into the emergency buffer, and reset at the end.
260 of_bounce_virt = emergency_buffer;
261 of_bounce_phys = (vm_offset_t)of_bounce_virt &
263 of_bounce_size = sizeof(emergency_buffer);
267 * Make sure the bounce page offset satisfies any reasonable
268 * alignment constraint.
270 of_bounce_offset += sizeof(register_t) -
271 (of_bounce_offset % sizeof(register_t));
273 if (of_bounce_offset + len > of_bounce_size) {
274 panic("Oversize Open Firmware call!");
279 memcpy(of_bounce_virt + of_bounce_offset, buf, len);
283 phys = of_bounce_phys + of_bounce_offset;
285 of_bounce_offset += len;
291 ofw_real_unmap(cell_t physaddr, void *buf, size_t len)
293 mtx_assert(&of_bounce_mtx, MA_OWNED);
295 if (of_bounce_virt == NULL)
301 memcpy(buf,of_bounce_virt + (physaddr - of_bounce_phys),len);
307 ofw_real_init(ofw_t ofw, void *openfirm)
309 openfirmware = (int (*)(void *))openfirm;
311 mtx_init(&of_bounce_mtx, "OF Bounce Page", NULL, MTX_DEF);
312 of_bounce_virt = NULL;
320 /* Test to see if a service exists. */
322 ofw_real_test(ofw_t ofw, const char *name)
333 args.name = (cell_t)(uintptr_t)"test";
339 args.service = ofw_real_map(name, strlen(name) + 1);
340 argsptr = ofw_real_map(&args, sizeof(args));
341 if (args.service == 0 || openfirmware((void *)argsptr) == -1) {
345 ofw_real_unmap(argsptr, &args, sizeof(args));
347 return (args.missing);
351 * Device tree functions
354 /* Return the next sibling of this node or 0. */
356 ofw_real_peer(ofw_t ofw, phandle_t node)
367 args.name = (cell_t)(uintptr_t)"peer";
373 argsptr = ofw_real_map(&args, sizeof(args));
374 if (openfirmware((void *)argsptr) == -1) {
378 ofw_real_unmap(argsptr, &args, sizeof(args));
383 /* Return the first child of this node or 0. */
385 ofw_real_child(ofw_t ofw, phandle_t node)
396 args.name = (cell_t)(uintptr_t)"child";
402 argsptr = ofw_real_map(&args, sizeof(args));
403 if (openfirmware((void *)argsptr) == -1) {
407 ofw_real_unmap(argsptr, &args, sizeof(args));
412 /* Return the parent of this node or 0. */
414 ofw_real_parent(ofw_t ofw, phandle_t node)
425 args.name = (cell_t)(uintptr_t)"parent";
431 argsptr = ofw_real_map(&args, sizeof(args));
432 if (openfirmware((void *)argsptr) == -1) {
436 ofw_real_unmap(argsptr, &args, sizeof(args));
438 return (args.parent);
441 /* Return the package handle that corresponds to an instance handle. */
443 ofw_real_instance_to_package(ofw_t ofw, ihandle_t instance)
454 args.name = (cell_t)(uintptr_t)"instance-to-package";
458 args.instance = instance;
460 argsptr = ofw_real_map(&args, sizeof(args));
461 if (openfirmware((void *)argsptr) == -1) {
465 ofw_real_unmap(argsptr, &args, sizeof(args));
467 return (args.package);
470 /* Get the length of a property of a package. */
472 ofw_real_getproplen(ofw_t ofw, phandle_t package, const char *propname)
484 args.name = (cell_t)(uintptr_t)"getproplen";
490 args.package = package;
491 args.propname = ofw_real_map(propname, strlen(propname) + 1);
492 argsptr = ofw_real_map(&args, sizeof(args));
493 if (args.propname == 0 || openfirmware((void *)argsptr) == -1) {
497 ofw_real_unmap(argsptr, &args, sizeof(args));
499 return (args.proplen);
502 /* Get the value of a property of a package. */
504 ofw_real_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf,
519 args.name = (cell_t)(uintptr_t)"getprop";
525 args.package = package;
526 args.propname = ofw_real_map(propname, strlen(propname) + 1);
527 args.buf = ofw_real_map(buf, buflen);
528 args.buflen = buflen;
529 argsptr = ofw_real_map(&args, sizeof(args));
530 if (args.propname == 0 || args.buf == 0 ||
531 openfirmware((void *)argsptr) == -1) {
535 ofw_real_unmap(argsptr, &args, sizeof(args));
536 ofw_real_unmap(args.buf, buf, buflen);
542 /* Get the next property of a package. */
544 ofw_real_nextprop(ofw_t ofw, phandle_t package, const char *previous,
545 char *buf, size_t size)
558 args.name = (cell_t)(uintptr_t)"nextprop";
564 args.package = package;
565 args.previous = ofw_real_map(previous, (previous != NULL) ? (strlen(previous) + 1) : 0);
566 args.buf = ofw_real_map(buf, size);
567 argsptr = ofw_real_map(&args, sizeof(args));
568 if (args.buf == 0 || openfirmware((void *)argsptr) == -1) {
572 ofw_real_unmap(argsptr, &args, sizeof(args));
573 ofw_real_unmap(args.buf, buf, size);
579 /* Set the value of a property of a package. */
580 /* XXX Has a bug on FirePower */
582 ofw_real_setprop(ofw_t ofw, phandle_t package, const char *propname,
583 const void *buf, size_t len)
597 args.name = (cell_t)(uintptr_t)"setprop";
603 args.package = package;
604 args.propname = ofw_real_map(propname, strlen(propname) + 1);
605 args.buf = ofw_real_map(buf, len);
607 argsptr = ofw_real_map(&args, sizeof(args));
608 if (args.propname == 0 || args.buf == 0 ||
609 openfirmware((void *)argsptr) == -1) {
613 ofw_real_unmap(argsptr, &args, sizeof(args));
618 /* Convert a device specifier to a fully qualified pathname. */
620 ofw_real_canon(ofw_t ofw, const char *device, char *buf, size_t len)
633 args.name = (cell_t)(uintptr_t)"canon";
639 args.device = ofw_real_map(device, strlen(device) + 1);
640 args.buf = ofw_real_map(buf, len);
642 argsptr = ofw_real_map(&args, sizeof(args));
643 if (args.device == 0 || args.buf == 0 ||
644 openfirmware((void *)argsptr) == -1) {
648 ofw_real_unmap(argsptr, &args, sizeof(args));
649 ofw_real_unmap(args.buf, buf, len);
655 /* Return a package handle for the specified device. */
657 ofw_real_finddevice(ofw_t ofw, const char *device)
668 args.name = (cell_t)(uintptr_t)"finddevice";
674 args.device = ofw_real_map(device, strlen(device) + 1);
675 argsptr = ofw_real_map(&args, sizeof(args));
676 if (args.device == 0 ||
677 openfirmware((void *)argsptr) == -1) {
681 ofw_real_unmap(argsptr, &args, sizeof(args));
683 return (args.package);
686 /* Return the fully qualified pathname corresponding to an instance. */
688 ofw_real_instance_to_path(ofw_t ofw, ihandle_t instance, char *buf, size_t len)
701 args.name = (cell_t)(uintptr_t)"instance-to-path";
707 args.instance = instance;
708 args.buf = ofw_real_map(buf, len);
710 argsptr = ofw_real_map(&args, sizeof(args));
712 openfirmware((void *)argsptr) == -1) {
716 ofw_real_unmap(argsptr, &args, sizeof(args));
717 ofw_real_unmap(args.buf, buf, len);
723 /* Return the fully qualified pathname corresponding to a package. */
725 ofw_real_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len)
738 args.name = (cell_t)(uintptr_t)"package-to-path";
744 args.package = package;
745 args.buf = ofw_real_map(buf, len);
747 argsptr = ofw_real_map(&args, sizeof(args));
749 openfirmware((void *)argsptr) == -1) {
753 ofw_real_unmap(argsptr, &args, sizeof(args));
754 ofw_real_unmap(args.buf, buf, len);
760 /* Call the method in the scope of a given instance. */
762 ofw_real_call_method(ofw_t ofw, ihandle_t instance, const char *method,
763 int nargs, int nreturns, cell_t *args_and_returns)
772 cell_t args_n_results[12];
777 args.name = (cell_t)(uintptr_t)"call-method";
785 args.nargs = nargs + 2;
786 args.nreturns = nreturns + 1;
787 args.method = ofw_real_map(method, strlen(method) + 1);
788 args.instance = instance;
790 ap = args_and_returns;
791 for (cp = args.args_n_results + (n = nargs); --n >= 0;)
793 argsptr = ofw_real_map(&args, sizeof(args));
794 if (args.method == 0 ||
795 openfirmware((void *)argsptr) == -1) {
799 ofw_real_unmap(argsptr, &args, sizeof(args));
801 if (args.args_n_results[nargs])
802 return (args.args_n_results[nargs]);
803 for (cp = args.args_n_results + nargs + (n = args.nreturns); --n > 0;)
809 ofw_real_interpret(ofw_t ofw, const char *cmd, int nreturns, cell_t *returns)
821 args.name = (cell_t)(uintptr_t)"interpret";
825 args.nreturns = ++nreturns;
826 args.slot[i++] = ofw_real_map(cmd, strlen(cmd) + 1);
827 argsptr = ofw_real_map(&args, sizeof(args));
828 if (openfirmware((void *)argsptr) == -1) {
832 ofw_real_unmap(argsptr, &args, sizeof(args));
834 status = args.slot[i++];
835 while (i < 1 + nreturns)
836 returns[j++] = args.slot[i++];
841 * Device I/O functions
844 /* Open an instance for a device. */
846 ofw_real_open(ofw_t ofw, const char *device)
857 args.name = (cell_t)(uintptr_t)"open";
863 args.device = ofw_real_map(device, strlen(device) + 1);
864 argsptr = ofw_real_map(&args, sizeof(args));
865 if (args.device == 0 || openfirmware((void *)argsptr) == -1
866 || args.instance == 0) {
870 ofw_real_unmap(argsptr, &args, sizeof(args));
872 return (args.instance);
875 /* Close an instance. */
877 ofw_real_close(ofw_t ofw, ihandle_t instance)
887 args.name = (cell_t)(uintptr_t)"close";
890 args.instance = instance;
892 argsptr = ofw_real_map(&args, sizeof(args));
893 openfirmware((void *)argsptr);
897 /* Read from an instance. */
899 ofw_real_read(ofw_t ofw, ihandle_t instance, void *addr, size_t len)
912 args.name = (cell_t)(uintptr_t)"read";
918 args.instance = instance;
919 args.addr = ofw_real_map(addr, len);
921 argsptr = ofw_real_map(&args, sizeof(args));
922 if (args.addr == 0 || openfirmware((void *)argsptr) == -1) {
926 ofw_real_unmap(argsptr, &args, sizeof(args));
927 ofw_real_unmap(args.addr, addr, len);
930 return (args.actual);
933 /* Write to an instance. */
935 ofw_real_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len)
948 args.name = (cell_t)(uintptr_t)"write";
954 args.instance = instance;
955 args.addr = ofw_real_map(addr, len);
957 argsptr = ofw_real_map(&args, sizeof(args));
958 if (args.addr == 0 || openfirmware((void *)argsptr) == -1) {
962 ofw_real_unmap(argsptr, &args, sizeof(args));
964 return (args.actual);
967 /* Seek to a position. */
969 ofw_real_seek(ofw_t ofw, ihandle_t instance, u_int64_t pos)
982 args.name = (cell_t)(uintptr_t)"seek";
986 args.instance = instance;
987 args.poshi = pos >> 32;
990 argsptr = ofw_real_map(&args, sizeof(args));
991 if (openfirmware((void *)argsptr) == -1) {
995 ofw_real_unmap(argsptr, &args, sizeof(args));
997 return (args.status);
1004 /* Claim an area of memory. */
1006 ofw_real_claim(ofw_t ofw, void *virt, size_t size, u_int align)
1008 vm_offset_t argsptr;
1019 args.name = (cell_t)(uintptr_t)"claim";
1023 args.virt = (cell_t)(uintptr_t)virt;
1027 argsptr = ofw_real_map(&args, sizeof(args));
1028 if (openfirmware((void *)argsptr) == -1) {
1030 return ((void *)-1);
1032 ofw_real_unmap(argsptr, &args, sizeof(args));
1034 return ((void *)(uintptr_t)args.baseaddr);
1037 /* Release an area of memory. */
1039 ofw_real_release(ofw_t ofw, void *virt, size_t size)
1041 vm_offset_t argsptr;
1050 args.name = (cell_t)(uintptr_t)"release";
1054 args.virt = (cell_t)(uintptr_t)virt;
1057 argsptr = ofw_real_map(&args, sizeof(args));
1058 openfirmware((void *)argsptr);
1063 * Control transfer functions
1066 /* Suspend and drop back to the Open Firmware interface. */
1068 ofw_real_enter(ofw_t ofw)
1070 vm_offset_t argsptr;
1077 args.name = (cell_t)(uintptr_t)"enter";
1082 argsptr = ofw_real_map(&args, sizeof(args));
1083 openfirmware((void *)argsptr);
1084 /* We may come back. */
1088 /* Shut down and drop back to the Open Firmware interface. */
1090 ofw_real_exit(ofw_t ofw)
1092 vm_offset_t argsptr;
1099 args.name = (cell_t)(uintptr_t)"exit";
1104 argsptr = ofw_real_map(&args, sizeof(args));
1105 openfirmware((void *)argsptr);
1106 for (;;) /* just in case */