1 /* $NetBSD: prom_disp.S,v 1.1 1997/01/24 01:52:58 cgd Exp $ */
4 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
7 * Author: Chris G. Demetriou
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 * Carnegie Mellon requests users of this software to return to
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science
23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
31 #include "include/asm.h"
32 #include "include/prom.h"
33 #include "include/rpb.h"
36 .globl prom_dispatch_v
37 .comm prom_dispatch_v,16
43 * Dispatcher routine. Implements prom's calling machinery, saves our
44 * callee-saved registers as required by C.
54 #define DISPATCH_FRAME_SIZE (15*8)
55 #define DISPATCH_REGS IM_RA|IM_S0|IM_S1|IM_S2|IM_S3|IM_S4|IM_S5|IM_S6
57 NESTED(prom_dispatch, 5, DISPATCH_FRAME_SIZE, ra, DISPATCH_REGS, 0)
60 lda sp, -DISPATCH_FRAME_SIZE(sp)
70 /* Lord have mercy because.. I would not. */
71 /* #define STUPID_PROM_IS_32_BITS */
72 #ifdef STUPID_PROM_IS_32_BITS
73 ldah s0, 0x2000(zero) /* hack for hack */
74 lda s0, (0x2000-8)(s0)
78 #endif /* STUPID_PROM_IS_32_BITS */
80 lda pv, prom_dispatch_v
81 ldq v0, 0(pv) /* routine */
82 ldq pv, 8(pv) /* routine_arg */
86 #ifdef STUPID_PROM_IS_32_BITS
87 ldah s0, 0x2000(zero) /* hack for hack */
88 lda s0, (0x2000-8)(s0)
91 #endif /* STUPID_PROM_IS_32_BITS */
101 lda sp, DISPATCH_FRAME_SIZE(sp)
113 #undef DISPATCH_FRAME_SIZE