public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/cygwin-2.0] Store entire context for or1k
@ 2015-05-27 11:31 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2015-05-27 11:31 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b46d3b55368878227752b040cd731ba95c02fe85

commit b46d3b55368878227752b040cd731ba95c02fe85
Author: Jeff Johnston <jjohnstn@redhat.com>
Date:   Tue May 26 15:23:39 2015 -0400

    Store entire context for or1k
    
    - Store the exception program counter (from EPCR) and exception status
      register (from ESR) also during the exception. A runtime system may
      replace them thereby to implement a thread switch.
    
        * or1k/exception-asm.S: Store missing state

Diff:
---
 libgloss/ChangeLog             |  4 ++++
 libgloss/or1k/exceptions-asm.S | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog
index adda155..1dc57b6 100644
--- a/libgloss/ChangeLog
+++ b/libgloss/ChangeLog
@@ -1,5 +1,9 @@
 2015-05-26  Stefan Wallentowitz  <stefan.wallentowitz@tum.de>
 
+	* or1k/exception-asm.S: Store missing state
+
+2015-05-26  Stefan Wallentowitz  <stefan.wallentowitz@tum.de>
+
 	* or1k/crt0.S: Fix exception stack frame
 	* or1k/exception-asm.S: ditto
 
diff --git a/libgloss/or1k/exceptions-asm.S b/libgloss/or1k/exceptions-asm.S
index 762a509..91a2d89 100644
--- a/libgloss/or1k/exceptions-asm.S
+++ b/libgloss/or1k/exceptions-asm.S
@@ -73,6 +73,10 @@ _or1k_exception_handler:
 	l.sw	GPR_BUF_OFFSET(29)(r1),r29
 	l.sw	GPR_BUF_OFFSET(30)(r1),r30
 	l.sw	GPR_BUF_OFFSET(31)(r1),r31
+	l.mfspr r14,r0,OR1K_SPR_SYS_EPCR_BASE
+	l.sw	0x80(r1),r14
+	l.mfspr r14,r0,OR1K_SPR_SYS_ESR_BASE
+	l.sw	0x84(r1),r14
 
 	/* Replace impure pointer for exception */
 	l.movhi	r20,hi(_or1k_exception_impure_ptr)
@@ -156,6 +160,12 @@ _or1k_exception_handler:
 	l.sw	0(r21),r20
 
 	/* Restore state */
+	l.lwz   r2,0x80(r1)
+	l.mtspr r0,r2,OR1K_SPR_SYS_EPCR_BASE
+
+	l.lwz   r2,0x84(r1)
+	l.mtspr r0,r2,OR1K_SPR_SYS_ESR_BASE
+
 	l.lwz	r2,GPR_BUF_OFFSET(2)(r1)
 	l.lwz	r3,GPR_BUF_OFFSET(3)(r1)
 	l.lwz	r4,GPR_BUF_OFFSET(4)(r1)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-27 11:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 11:31 [newlib-cygwin/cygwin-2.0] Store entire context for or1k Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).