1 /* $NetBSD: exec_hppa.c,v 1.4 2009/05/08 09:33:59 skrll Exp $ */
3 /* $OpenBSD: exec_hppa.c,v 1.7 1999/05/06 02:13:15 mickey Exp $ */
6 * Copyright (c) 1998-2004 Michael Shalayeff
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
32 #include <sys/param.h>
34 #include <sys/reboot.h>
36 #include <stand/boot/bootarg.h>
37 #include <sys/disklabel.h>
39 #include <lib/libsa/exec.h>
41 #include <machine/pdc.h>
44 typedef void (*startfuncp
)(int, int, int, int, int, int, void *)
45 __attribute__ ((noreturn
));
48 machdep_exec(struct x_param
*xp
, int howto
, void *loadaddr
)
54 size_t ac
= BOOTARG_LEN
;
55 void *av
= (void *)BOOTARG_OFF
;
57 makebootargs(av
, &ac
);
62 printf("ep=0x%x [", xp
->xp_entry
);
63 for (i
= 0; i
< 10240; i
++) {
65 printf("\b\n%p:", &((u_int
*)xp
->xp_entry
)[i
]);
69 printf("%x,", ((int *)xp
->xp_entry
)[i
]);
77 __asm("mtctl %r0, %cr17");
78 __asm("mtctl %r0, %cr17");
79 /* stack and the gung is ok at this point, so, no need for asm setup */
80 (*(startfuncp
)(xp
->xp_entry
)) ((int)pdc
, howto
, bootdev
, xp
->xp_end
,
81 BOOTARG_APIVER
, ac
, av
);