Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sun2/sun2 Added some support for the old-school 'g0...



details:   https://anonhg.NetBSD.org/src/rev/20c1f3ccb2db
branches:  trunk
changeset: 508135:20c1f3ccb2db
user:      fredette <fredette%NetBSD.org@localhost>
date:      Fri Apr 06 14:36:08 2001 +0000

description:
Added some support for the old-school 'g0' and 'g4' monitor
hooks, and removed some old Sun3 cache and interrupt-register
related code.

diffstat:

 sys/arch/sun2/sun2/locore.s |  42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diffs (79 lines):

diff -r c208ee41d89f -r 20c1f3ccb2db sys/arch/sun2/sun2/locore.s
--- a/sys/arch/sun2/sun2/locore.s       Fri Apr 06 14:31:14 2001 +0000
+++ b/sys/arch/sun2/sun2/locore.s       Fri Apr 06 14:36:08 2001 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: locore.s,v 1.1 2001/03/29 03:24:19 fredette Exp $      */
+/*     $NetBSD: locore.s,v 1.2 2001/04/06 14:36:08 fredette Exp $      */
 
 /*
- * Copyright (c) 2001 Mathew Fredette
+ * Copyright (c) 2001 Matthew Fredette
  * Copyright (c) 1994, 1995 Gordon W. Ross
  * Copyright (c) 1993 Adam Glass
  * Copyright (c) 1988 University of Utah.
@@ -102,6 +102,16 @@
 | Force a long jump to the relocated code (high VA).
        jmp L_high_code:l               | long jump
 
+| These entry points are here in pretty low memory, so that they
+| can be reached from virtual address zero using the classic,
+| old-school "g0" and "g4" commands from the monitor.  Note that
+| on entry, we are in low memory again (i.e., not where we were
+| linked.)  We do a long jump right away to the relocated code.
+L_g0_entry:
+       jmp _C_LABEL(g0_handler):l      | long jump
+L_g4_entry:
+       jmp _C_LABEL(g4_handler):l      | long jump
+       
 L_high_code:
 | We are now running in the correctly relocated kernel, so
 | we are no longer restricted to position-independent code.
@@ -114,6 +124,18 @@
        andw    d1, d0
        movsw   d0, SYSTEM_ENAB         | disable all interrupts
        movw    d0, _C_LABEL(enable_reg_soft)
+
+| Set up our g0 and g4 handlers.  Note that we reach ourselves
+| in low memory again (i.e., not where we were linked), which
+| is why we subtract KERNBASE.  The 2 and the 6 further adjust
+| the offsets to be PC-relative.
+       movl    #0, a0
+       movw    #0x6000, a0@+                   | braw
+       movl    #(L_g0_entry-2-KERNBASE), d0
+       movw    d0, a0@+                        | L_g0_entry
+       movw    #0x6000, a0@+                   | braw
+       movl    #(L_g4_entry-6-KERNBASE), d0
+       movw    d0, a0@+                        | L_g4_entry
        
 | Do bootstrap stuff needed before main() gets called.
 | Our boot loader leaves a copy of the kernel's exec header
@@ -337,13 +359,6 @@
  * command in d0, addr in a1, length in d1
  */
 GLOBAL(trap12)
-       movl    _C_LABEL(curproc),sp@-  | push curproc pointer
-       movl    d1,sp@-                 | push length
-       movl    a1,sp@-                 | push addr
-       movl    d0,sp@-                 | push command
-       lea     _C_LABEL(cachectl1),a0
-       jsr     a0@                     | do it
-       lea     sp@(16),sp              | pop args
        jra     _ASM_LABEL(rei)         | all done
 
 /*
@@ -992,15 +1007,6 @@
        movc    a1,dfc                  | restore dfc
        rts
 
-/*
- * This strangely-named function used to initialize the soft enable register that the
- * above functions use, and used to disable interrupts entirely, as the intreg_init
- * in sun3/intreg.c does.  But now we do all of this early in this locore.s, so
- * this function does nothing.  (It still has to exist because obio_init calls it.)
- */
-ENTRY(intreg_init)
-       rts     
-
 | Define some addresses, mostly so DDB can print useful info.
 | Not using _C_LABEL() here because these symbols are never
 | referenced by any C code, and if the leading underscore



Home | Main Index | Thread Index | Old Index