Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/pmax/stand/lib Assembly routine that takes an entry...
details: https://anonhg.NetBSD.org/src/rev/8087ee3051ea
branches: trunk
changeset: 467479:8087ee3051ea
user: simonb <simonb%NetBSD.org@localhost>
date: Thu Mar 25 04:08:59 1999 +0000
description:
Assembly routine that takes an entry point, new stack pointer address
and six extra arguments. Sets up the stack pointer with the arguments
in the right registers/stack positions and calls the entry point.
diffstat:
sys/arch/pmax/stand/lib/startprog.S | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diffs (37 lines):
diff -r ed4c8ea3c0c6 -r 8087ee3051ea sys/arch/pmax/stand/lib/startprog.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/pmax/stand/lib/startprog.S Thu Mar 25 04:08:59 1999 +0000
@@ -0,0 +1,33 @@
+/*
+ * startprog(entry, stack, argc, argv, prom_magic, prom_ptr, bi_magic, bi_ptr);
+ *
+ * load new stack pointer, then call
+ * entry(argc, argv, prom_magic, prom_ptr, bi_magic, bi_ptr);
+ */
+
+#include <mips/asm.h>
+
+LEAF(startprog)
+ subu sp,sp,32
+ addu t0,a1,-CALLFRAME_SIZ # new stack value
+ move t1,a0
+ move a0,a2
+ move a1,a3
+
+ lw a2,48(sp) # load everything from old stack we need
+ lw a3,52(sp)
+ lw v0,56(sp)
+ lw v1,60(sp)
+
+ move sp,t0 # new stack pointer
+ sw ra,24(sp)
+
+ sw v0,16(sp)
+ sw v1,20(sp)
+ jal ra,t1
+ nop # BDslot
+
+ lw ra,24(sp) # should not get back here!
+ j ra
+ addu sp,sp,32
+END(startprog)
Home |
Main Index |
Thread Index |
Old Index