dotgnu-pnet-commits
[Top][All Lists]
Advanced

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

[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and to


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. f786df20e8e25a80b936eb4211e98268197ec3d6
Date: Tue, 08 Sep 2009 18:54:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET engine, compilers and tools (pnet)".

The branch, master has been updated
       via  f786df20e8e25a80b936eb4211e98268197ec3d6 (commit)
      from  fab64f5929cd06894aebca178fbeba2aba85ac82 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=f786df20e8e25a80b936eb4211e98268197ec3d6

commit f786df20e8e25a80b936eb4211e98268197ec3d6
Author: Klaus Treichel <address@hidden>
Date:   Tue Sep 8 20:53:01 2009 +0200

    Add support for interrupt based exception handling for ARM.

diff --git a/ChangeLog b/ChangeLog
index b0671c1..e06fb31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,18 +1,19 @@
 2009-09-08  Klaus Treichel  <address@hidden>
 
        * engine/cvm.c: Add support for restoring the interpreter state after
-       returnining to the interpreter from a longjmp for X86_64.
+       returnining to the interpreter from a longjmp for X86_64 and ARM.
        Change restoring the interpreter register variables after returning to
        the interpreter from a lngjmp for x86.
 
-       * engine/engine.h: Add x86_64 to the platforms that support interrupt
-       based exception handling.
+       * engine/engine.h: Add x86_64 and ARM to the platforms that support
+       interrupt based exception handling.
 
-       * support/interrupt.h: Add the declaration of the interrupt context for
-       x86_64.
+       * support/interrupt.h: Add the declaration of the interrupt contexts for
+       x86_64 and ARM.
 
        * support/interrupt_posix.c (__sigaction_handler): Copy the information
-       from the signal context to the interrupt context for x86_64 now too.
+       from the signal context to the interrupt context for x86_64 amd ARM now
+       too.
 
 2009-09-07  Klaus Treichel  <address@hidden>
 
diff --git a/engine/cvm.c b/engine/cvm.c
index d56aefd..3a79525 100644
--- a/engine/cvm.c
+++ b/engine/cvm.c
@@ -114,6 +114,9 @@ extern      "C" {
        #define VM_CGOTO_BREAKNOEND(val) X86_64_CGOTO(pc)
        
 #elif defined(CVM_ARM) && defined(__GNUC__) && !defined(IL_NO_ASM)
+
+       #define REGISTER_ASM_ARM 1
+
     #define REGISTER_ASM_PC(x)              register x asm ("r4")
     #define REGISTER_ASM_STACK(x)           register x asm ("r5")
     #define REGISTER_ASM_FRAME(x)           register x asm ("r6")
@@ -262,6 +265,24 @@ extern     "C" {
                                frame = (CVMWord 
*)thread->interruptContext.R15; \
                        } \
                        while (0);
+       #elif defined(IL_INTERRUPT_HAVE_ARM_CONTEXT) && 
defined(REGISTER_ASM_ARM)
+               /*
+                * If the interrupt subsystem can provide us the arm registers
+                * at the time of interrupt then we don't need to save anything
+                */
+               #define INTERRUPT_BACKUP_FRAME()
+               #define INTERRUPT_BACKUP_PC_STACKTOP_FRAME()
+
+               /* We can restore locals directly from the register state
+                  at the time of interrupt */
+               #define INTERRUPT_RESTORE_FROM_THREAD() \
+                       do \
+                       { \
+                               pc = (unsigned char 
*)thread->interruptContext.R4; \
+                               stacktop = (CVMWord 
*)thread->interruptContext.R5; \
+                               frame = (CVMWord *)thread->interruptContext.R6; 
\
+                       } \
+                       while (0);
        #else
                #define INTERRUPT_RESTORE_FROM_THREAD()
        #endif
diff --git a/engine/engine.h b/engine/engine.h
index 885389c..284eb0e 100644
--- a/engine/engine.h
+++ b/engine/engine.h
@@ -61,6 +61,7 @@ extern        "C" {
 
 #if defined(IL_INTERRUPT_HAVE_X86_CONTEXT) || \
        defined(IL_INTERRUPT_HAVE_X86_64_CONTEXT) || \
+       defined(IL_INTERRUPT_HAVE_ARM_CONTEXT) || \
        !defined(__GNUC__) || defined(IL_NO_ASM)
 
 #if defined(IL_INTERRUPT_SUPPORTS_ILLEGAL_MEMORY_ACCESS)       
diff --git a/support/interrupt.h b/support/interrupt.h
index b585119..92fdf03 100755
--- a/support/interrupt.h
+++ b/support/interrupt.h
@@ -89,6 +89,36 @@ struct _tagILInterruptContext
        ILUInt64        Rsp;
 };
 
+#elif defined(__arm) || defined(__arm__)
+
+struct _tagILInterruptContext
+{
+       int type;
+       
+       void *memoryAddress;
+       void *instructionAddress;
+
+       /* General purpose registers */
+       unsigned long R0;
+       unsigned long R1;
+       unsigned long R2;
+       unsigned long R3;
+       unsigned long R4;
+       unsigned long R5;
+       unsigned long R6;
+       unsigned long R7;
+       unsigned long R8;
+       unsigned long R9;
+       unsigned long R10;
+
+       /* Control registers */
+       unsigned long Rfp;
+       unsigned long Rip;
+       unsigned long Rsp;
+       unsigned long Rlr;
+       unsigned long Rpc;
+};
+
 #else
 
 struct _tagILInterruptContext
@@ -159,6 +189,8 @@ struct _tagILInterruptContext
                                #define IL_INTERRUPT_HAVE_X86_CONTEXT 1
                        #elif defined(__x86_64__) || defined(__x86_64) 
                                #define IL_INTERRUPT_HAVE_X86_64_CONTEXT 1
+                       #elif defined(__arm) || defined(__arm__)
+                               #define IL_INTERRUPT_HAVE_ARM_CONTEXT 1
                        #endif
                #endif
        #endif
diff --git a/support/interrupt_posix.c b/support/interrupt_posix.c
index 610a15b..56b380d 100755
--- a/support/interrupt_posix.c
+++ b/support/interrupt_posix.c
@@ -81,6 +81,9 @@ static void __sigaction_handler(int signo, siginfo_t *info, 
void *ctx)
 #elif defined(IL_INTERRUPT_HAVE_X86_64_CONTEXT)
        ucontext_t *uc;
        uc = (ucontext_t *)ctx;
+#elif defined(IL_INTERRUPT_HAVE_ARM_CONTEXT)
+       ucontext_t *uc;
+       uc = (ucontext_t *)ctx;
 #endif
 
        thread = _ILThreadGetSelf();
@@ -139,6 +142,26 @@ static void __sigaction_handler(int signo, siginfo_t 
*info, void *ctx)
        context.Rsp = uc->uc_mcontext.gregs[REG_RSP];
 
        context.instructionAddress = (void *)context.Rip;
+#elif defined(IL_INTERRUPT_HAVE_ARM_CONTEXT)
+       context.R0 = uc->uc_mcontext.arm_r0;
+       context.R1 = uc->uc_mcontext.arm_r1;
+       context.R2 = uc->uc_mcontext.arm_r2;
+       context.R3 = uc->uc_mcontext.arm_r3;
+       context.R4 = uc->uc_mcontext.arm_r4;
+       context.R5 = uc->uc_mcontext.arm_r5;
+       context.R6 = uc->uc_mcontext.arm_r6;
+       context.R7 = uc->uc_mcontext.arm_r7;
+       context.R8 = uc->uc_mcontext.arm_r8;
+       context.R9 = uc->uc_mcontext.arm_r9;
+       context.R10 = uc->uc_mcontext.arm_r10;
+
+       context.Rfp = uc->uc_mcontext.arm_fp;
+       context.Rip = uc->uc_mcontext.arm_ip;
+       context.Rsp = uc->uc_mcontext.arm_sp;
+       context.Rlr = uc->uc_mcontext.arm_lr;
+       context.Rpc = uc->uc_mcontext.arm_pc;
+
+       context.instructionAddress = (void *)context.Rpc;
 #else
        context.instructionAddress = 0;
 #endif

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                 |   13 +++++++------
 engine/cvm.c              |   21 +++++++++++++++++++++
 engine/engine.h           |    1 +
 support/interrupt.h       |   32 ++++++++++++++++++++++++++++++++
 support/interrupt_posix.c |   23 +++++++++++++++++++++++
 5 files changed, 84 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
DotGNU Portable.NET engine, compilers and tools (pnet)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]