Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips If on entry the stack is within 4kB of _s...



details:   https://anonhg.NetBSD.org/src/rev/41b0a393cd8c
branches:  trunk
changeset: 467377:41b0a393cd8c
user:      simonb <simonb%NetBSD.org@localhost>
date:      Tue Mar 23 22:43:18 1999 +0000

description:
If on entry the stack is within 4kB of _start, don't reset the stack
pointer to just underneath _start.  Allows bootblocks (or other kernel
calling programs) to pass more than 4 arguments if it sets up the stack
properly.

The 4kB figure may be overkill - on the pmax it only needs to be a dozen
of so bytes.

diffstat:

 sys/arch/mips/mips/locore.S |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r ac278525107d -r 41b0a393cd8c sys/arch/mips/mips/locore.S
--- a/sys/arch/mips/mips/locore.S       Tue Mar 23 22:25:31 1999 +0000
+++ b/sys/arch/mips/mips/locore.S       Tue Mar 23 22:43:18 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.64 1999/02/28 20:36:31 mhitch Exp $       */
+/*     $NetBSD: locore.S,v 1.65 1999/03/23 22:43:18 simonb Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -85,7 +85,17 @@
 /*
  * Initialize stack and call machine startup.
  */
-       la      sp, start - CALLFRAME_SIZ       # for the sake of debugger
+       la      $3,start
+       slt     $2,$3,sp
+       bne     $2,$0,1f
+       addu    $2,$3,-CALLFRAME_SIZ
+       subu    $2,$3,sp
+       slt     $2,$2,4096                      # within 4kB of _start
+       beq     $2,$0,2f
+       addu    $2,$3,-CALLFRAME_SIZ
+1:
+       move    sp,$2
+2:
 #ifdef __GP_SUPPORT__
        la      gp, _C_LABEL(_gp)
 #endif



Home | Main Index | Thread Index | Old Index