tmpfs(5): Remove old initialization (overrode prior init of vop_bmap).
[dragonfly.git] / sys / boot / ia64 / libski / sal_stub.c
blob941b017a725ed5f82e64360ee8186ea761f40460
1 /*
2 * Copyright (c) 2003 Marcel Moolenaar
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 * $FreeBSD: src/sys/boot/ia64/libski/sal_stub.c,v 1.2 2003/09/08 09:11:32 obrien Exp $
27 * $DragonFly: src/sys/boot/ia64/libski/sal_stub.c,v 1.1 2003/11/10 06:08:37 dillon Exp $
30 #include <sys/types.h>
31 #include <machine/md_var.h>
32 #include <machine/sal.h>
33 #include <stand.h>
34 #include "libski.h"
36 extern void PalProc(void);
37 static sal_entry_t SalProc;
39 struct {
40 struct sal_system_table header;
41 struct sal_entrypoint_descriptor entry;
42 struct sal_ap_wakeup_descriptor wakeup;
43 } sal_systab = {
44 /* Header. */
46 SAL_SIGNATURE,
47 sizeof(sal_systab),
48 { 00, 03 }, /* Revision 3.0. */
49 2, /* Number of decsriptors. */
50 0, /* XXX checksum. */
51 { 0 },
52 { 00, 00 }, /* XXX SAL_A version. */
53 { 00, 00 }, /* XXX SAL_B version. */
54 "FreeBSD",
55 "Ski loader",
56 { 0 }
58 /* Entrypoint. */
60 0, /* Type=entrypoint descr. */
61 { 0 },
62 0, /* XXX PalProc. */
63 0, /* XXX SalProc. */
64 0, /* XXX SalProc GP. */
65 { 0 }
67 /* AP wakeup. */
69 5, /* Type=AP wakeup descr. */
70 0, /* External interrupt. */
71 { 0 },
72 255 /* Wakeup vector. */
76 static inline void
77 puts(const char *s)
79 s = (const char *)((7UL << 61) | (u_long)s);
80 while (*s)
81 ski_cons_putchar(*s++);
84 static struct ia64_sal_result
85 SalProc(u_int64_t a1, u_int64_t a2, u_int64_t a3, u_int64_t a4, u_int64_t a5,
86 u_int64_t a6, u_int64_t a7, u_int64_t a8)
88 struct ia64_sal_result res;
90 res.sal_status = -3;
91 res.sal_result[0] = 0;
92 res.sal_result[1] = 0;
93 res.sal_result[2] = 0;
95 if (a1 == SAL_FREQ_BASE) {
96 res.sal_status = 0;
97 res.sal_result[0] = 133338184;
98 } else if (a1 == SAL_SET_VECTORS) {
99 /* XXX unofficial SSC function. */
100 ssc(a2, a3, a4, a5, SSC_SAL_SET_VECTORS);
101 } else if (a1 != SAL_GET_STATE_INFO_SIZE) {
102 puts("SAL: unimplemented function called\n");
105 return (res);
108 void
109 sal_stub_init(void)
111 struct ia64_fdesc *fd;
113 fd = (void*)PalProc;
114 sal_systab.entry.sale_pal_proc = fd->func;
115 fd = (void*)SalProc;
116 sal_systab.entry.sale_sal_proc = fd->func;
117 sal_systab.entry.sale_sal_gp = fd->gp;