2 * From: $NetBSD: prom_disp.S,v 1.2 1997/04/06 08:41:00 cgd Exp $
3 * $FreeBSD: src/sys/boot/alpha/libalpha/prom_disp.S,v 1.2 1999/08/28 00:39:28 peter Exp $
4 * $DragonFly: src/sys/boot/alpha/libalpha/Attic/prom_disp.S,v 1.3 2003/11/10 06:08:30 dillon Exp $
8 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
11 * Author: Chris G. Demetriou
13 * Permission to use, copy, modify and distribute this software and
14 * its documentation is hereby granted, provided that both the copyright
15 * notice and this permission notice appear in all copies of the
16 * software, derivative works or modified versions, and any portions
17 * thereof, and that both notices appear in supporting documentation.
19 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
20 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
21 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
23 * Carnegie Mellon requests users of this software to return to
25 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
26 * School of Computer Science
27 * Carnegie Mellon University
28 * Pittsburgh PA 15213-3890
30 * any improvements or extensions that they make and grant Carnegie the
31 * rights to redistribute these changes.
36 #include <machine/asm.h>
37 #include <machine/prom.h>
38 #include <machine/rpb.h>
41 .globl prom_dispatch_v
42 .comm prom_dispatch_v,16
48 * Dispatcher routine. Implements prom's calling machinery, saves our
49 * callee-saved registers as required by C.
59 #define DISPATCH_FRAME_SIZE (15*8)
60 #define DISPATCH_REGS IM_RA|IM_S0|IM_S1|IM_S2|IM_S3|IM_S4|IM_S5|IM_S6
62 NESTED(prom_dispatch, 5, DISPATCH_FRAME_SIZE, ra, DISPATCH_REGS, 0)
65 lda sp, -DISPATCH_FRAME_SIZE(sp)
75 /* Lord have mercy because.. I would not. */
76 /* #define STUPID_PROM_IS_32_BITS */
77 #ifdef STUPID_PROM_IS_32_BITS
78 ldah s0, 0x2000(zero) /* hack for hack */
79 lda s0, (0x2000-8)(s0)
83 #endif /* STUPID_PROM_IS_32_BITS */
85 lda pv, prom_dispatch_v
86 ldq v0, 0(pv) /* routine */
87 ldq pv, 8(pv) /* routine_arg */
91 #ifdef STUPID_PROM_IS_32_BITS
92 ldah s0, 0x2000(zero) /* hack for hack */
93 lda s0, (0x2000-8)(s0)
96 #endif /* STUPID_PROM_IS_32_BITS */
106 lda sp, DISPATCH_FRAME_SIZE(sp)
118 #undef DISPATCH_FRAME_SIZE