From 7ae512513f37ccce1d5beeb4807b5b4b765025d7 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 16 Aug 2001 21:08:28 +0000 Subject: 2001-08-10 Radzislaw Galler * score/cpu_asm.c (sh_set_irq_priority): Changed interrupt vector number range check and handling of interrupt priority regs to conform SH2 specs. * sci/sci_termios.c: New file. * include/sci_termios.h: New file. * include/Makefile.am (EXTRA_DIST): Added sci_termios.h. (include_sh_HEADERS): Added sci_termios.h. * score/ispsh7045.c (isp): Calling an ISR with immediate argument casued negative sign extension for vector numbers of 128 and above. This was fixed. * sci/sci.c: Cleaned initialization of SCI registers; added necessary setup for new TERMIOS console cooperation --- c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c | 5 ++++- c/src/lib/libcpu/sh/sh7045/score/ispsh7045.c | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'c/src/lib/libcpu/sh/sh7045/score') diff --git a/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c b/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c index 6453105bdb..2b5fc6d71d 100644 --- a/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c +++ b/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c @@ -81,7 +81,7 @@ unsigned int sh_set_irq_priority( /* * first check for valid interrupt */ - if(( irq > 113) || (_Hardware_isr_Table[irq] == _dummy_isp)) + if(( irq > 156) || (irq < 64) || (_Hardware_isr_Table[irq] == _dummy_isp)) return -1; /* * check for valid irq priority @@ -102,6 +102,9 @@ unsigned int sh_set_irq_priority( case 0: { prioreg = INTC_IPRC; break;} case 1: { prioreg = INTC_IPRD; break;} case 2: { prioreg = INTC_IPRE; break;} + case 3: { prioreg = INTC_IPRF; break;} + case 4: { prioreg = INTC_IPRG; break;} + case 5: { prioreg = INTC_IPRH; break;} default: return -1; } } diff --git a/c/src/lib/libcpu/sh/sh7045/score/ispsh7045.c b/c/src/lib/libcpu/sh/sh7045/score/ispsh7045.c index 44aeaff8f1..85aa9d20e6 100644 --- a/c/src/lib/libcpu/sh/sh7045/score/ispsh7045.c +++ b/c/src/lib/libcpu/sh/sh7045/score/ispsh7045.c @@ -123,9 +123,10 @@ asm (".global _"Str(name)"\n\t" \ " sts.l mach,@-r15 \n\t" \ " sts.l macl,@-r15 \n\t" \ " mov r15,r14 \n\t" \ + " mov.l "Str(name)"_v, r2 \n\t" \ " mov.l "Str(name)"_k, r1\n\t" \ " jsr @r1 \n\t" \ - " mov #"Str(number)", r4\n\t" \ + " mov r2,r4 \n\t" \ " mov r14,r15 \n\t" \ " lds.l @r15+,macl \n\t" \ " lds.l @r15+,mach \n\t" \ @@ -143,7 +144,9 @@ asm (".global _"Str(name)"\n\t" \ " nop \n\t" \ " .align 2 \n\t" \ #name"_k: \n\t" \ - ".long "Str(func)); + ".long "Str(func)"\n\t" \ + #name"_v: \n\t" \ + ".long "Str(number)); /************************************************ * Dummy interrupt service procedure for -- cgit v1.2.3