1*2340cfa5Sderaadt /* $OpenBSD: exec.c,v 1.6 2019/04/10 04:17:34 deraadt Exp $ */
2e8853d9aSmickey
3e8853d9aSmickey /*
4fef2e65fSmickey * Copyright (c) 2002-2004 Michael Shalayeff
5e8853d9aSmickey * All rights reserved.
6e8853d9aSmickey *
7e8853d9aSmickey * Redistribution and use in source and binary forms, with or without
8e8853d9aSmickey * modification, are permitted provided that the following conditions
9e8853d9aSmickey * are met:
10e8853d9aSmickey * 1. Redistributions of source code must retain the above copyright
11e8853d9aSmickey * notice, this list of conditions and the following disclaimer.
12e8853d9aSmickey * 2. Redistributions in binary form must reproduce the above copyright
13e8853d9aSmickey * notice, this list of conditions and the following disclaimer in the
14e8853d9aSmickey * documentation and/or other materials provided with the distribution.
15e8853d9aSmickey *
16e8853d9aSmickey * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17e8853d9aSmickey * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18e8853d9aSmickey * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19e8853d9aSmickey * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
20e8853d9aSmickey * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21e8853d9aSmickey * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22e8853d9aSmickey * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23e8853d9aSmickey * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24e8853d9aSmickey * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
25e8853d9aSmickey * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26e8853d9aSmickey * THE POSSIBILITY OF SUCH DAMAGE.
27e8853d9aSmickey */
28e8853d9aSmickey
29e8853d9aSmickey #include <sys/param.h>
305b194e1fSderaadt #include <machine/cpu.h>
31e8853d9aSmickey #include <machine/pdc.h>
32e8853d9aSmickey #include "libsa.h"
33e8853d9aSmickey #include <lib/libsa/loadfile.h>
34e8853d9aSmickey #include <stand/boot/bootarg.h>
35e8853d9aSmickey #include "dev_hppa.h"
36e8853d9aSmickey
37e2b96ebfSderaadt typedef void (*startfuncp)(int, int, int, int, int, int, caddr_t)
38e8853d9aSmickey __attribute__ ((noreturn));
39e8853d9aSmickey
40e8853d9aSmickey void
run_loadfile(uint64_t * marks,int howto)41*2340cfa5Sderaadt run_loadfile(uint64_t *marks, int howto)
42e8853d9aSmickey {
43e8853d9aSmickey fcacheall();
44e8853d9aSmickey
45e8853d9aSmickey __asm("mtctl %r0, %cr17");
46e8853d9aSmickey __asm("mtctl %r0, %cr17");
47e8853d9aSmickey /* stack and the gung is ok at this point, so, no need for asm setup */
48*2340cfa5Sderaadt (*(startfuncp)((u_long)marks[MARK_ENTRY]))((int)pdc, howto, bootdev,
49*2340cfa5Sderaadt (u_long)marks[MARK_END], BOOTARG_APIVER, BOOTARG_LEN, (caddr_t)BOOTARG_OFF);
50e8853d9aSmickey
51e8853d9aSmickey /* not reached */
52e8853d9aSmickey }
53