diff -Ncr utkernel_source/etc/sysdepend/app_at91/makerules.sysdepend utkernel_source.th/etc/sysdepend/app_at91/makerules.sysdepend *** utkernel_source/etc/sysdepend/app_at91/makerules.sysdepend Tue Apr 7 21:38:22 2009 --- utkernel_source.th/etc/sysdepend/app_at91/makerules.sysdepend Fri Apr 10 21:15:44 2009 *************** *** 48,59 **** TARGET_ARCH = # target type ! _CPUTYPE_FLAGS = -march=armv4t -Wall -Werror _CPUTYPE_FLAGS_AS = -marmv4t -mno-fpu _TE_SYSTEM_NAME_ = _APP_AT91_ # XXX # code set ! _CODESET_FLAGS = -mno-thumb-interwork # XXX ### build option ### CFLAGS += --- 48,59 ---- TARGET_ARCH = # target type ! _CPUTYPE_FLAGS = -march=armv4t -mthumb -Wall -Werror _CPUTYPE_FLAGS_AS = -marmv4t -mno-fpu _TE_SYSTEM_NAME_ = _APP_AT91_ # XXX # code set ! _CODESET_FLAGS = -mthumb-interwork ### build option ### CFLAGS += diff -Ncr utkernel_source/include/tk/sysdepend/app_at91/syslib_depend.h utkernel_source.th/include/tk/sysdepend/app_at91/syslib_depend.h *** utkernel_source/include/tk/sysdepend/app_at91/syslib_depend.h Mon Mar 16 22:14:41 2009 --- utkernel_source.th/include/tk/sysdepend/app_at91/syslib_depend.h Fri Apr 10 21:15:44 2009 *************** *** 41,46 **** --- 41,48 ---- #define DI(intsts) ( (intsts) = disint() ) #define EI(intsts) ( enaint(intsts) ) #define isDI(intsts) ( ((intsts) & 0x00c0U) != 0 ) + IMPORT void SetCPSR_c( UINT cpsr ); + IMPORT UINT GetCPSR( void ); /* * Interrupt vector diff -Ncr utkernel_source/kernel/sysdepend/cpu/at91/cpu_insn.h utkernel_source.th/kernel/sysdepend/cpu/at91/cpu_insn.h *** utkernel_source/kernel/sysdepend/cpu/at91/cpu_insn.h Sun Mar 15 21:15:16 2009 --- utkernel_source.th/kernel/sysdepend/cpu/at91/cpu_insn.h Fri Apr 10 21:15:44 2009 *************** *** 20,25 **** --- 20,26 ---- #define _CPU_INSN_ #include + #include /* ------------------------------------------------------------------------ */ /* *************** *** 29,40 **** --- 30,44 ---- /* * Get CPSR */ + #define knl_getCPSR GetCPSR + #if 0 Inline UINT knl_getCPSR( void ) { UINT cpsr; Asm("mrs %0, cpsr": "=r"(cpsr)); return cpsr; } + #endif /* ------------------------------------------------------------------------ */ /* diff -Ncr utkernel_source/kernel/sysdepend/cpu/at91/cpu_support.S utkernel_source.th/kernel/sysdepend/cpu/at91/cpu_support.S *** utkernel_source/kernel/sysdepend/cpu/at91/cpu_support.S Tue Feb 12 17:18:49 2008 --- utkernel_source.th/kernel/sysdepend/cpu/at91/cpu_support.S Fri Apr 10 21:57:30 2009 *************** *** 13,19 **** */ /* ! * cpu_support.S (AT91) * Device-Dependent CPU Operation */ --- 13,19 ---- */ /* ! * cpu_support.S (arm) * Device-Dependent CPU Operation */ *************** *** 99,104 **** --- 99,108 ---- stmfd sp!, {ip, lr} mrs ip, cpsr bic ip, ip, #PSR_DI + tst lr, #1 // if context was in + bicne lr, lr, #1 // thumb state, + strne lr, [sp, #8] // fix lr (on the stack) + orrne ip, ip, #PSR_T // and CPSR stmfd sp!, {ip} #endif stmfd sp!, {lr} // Context save (R14_svc) diff -Ncr utkernel_source/kernel/sysdepend/device/app_at91/icrt0.S utkernel_source.th/kernel/sysdepend/device/app_at91/icrt0.S *** utkernel_source/kernel/sysdepend/device/app_at91/icrt0.S Sat Mar 21 15:24:49 2009 --- utkernel_source.th/kernel/sysdepend/device/app_at91/icrt0.S Fri Apr 10 21:52:18 2009 *************** *** 219,226 **** mrs ip, spsr str ip, [sp, #-4]! ! ldr ip, [lr, #-4] /* load SWI No. */ ! bic ip, ip, #(0xff << 24) ldr lr, =Csym(knl_intvec) /* exception vector table */ add ip, lr, ip, LSL #2 /* lr := lr + ip*4 = vecaddr */ --- 219,228 ---- mrs ip, spsr str ip, [sp, #-4]! ! tst ip, #PSR_T ! ldrneh ip, [lr, #-2] /* load SWI No. (Thumb) */ ! ldreq ip, [lr, #-4] /* load SWI No. (ARM) */ ! and ip, ip, #0xff ldr lr, =Csym(knl_intvec) /* exception vector table */ add ip, lr, ip, LSL #2 /* lr := lr + ip*4 = vecaddr */ diff -Ncr utkernel_source/kernel/sysdepend/device/app_at91/tkdev_timer.h utkernel_source.th/kernel/sysdepend/device/app_at91/tkdev_timer.h *** utkernel_source/kernel/sysdepend/device/app_at91/tkdev_timer.h Sat Mar 21 20:32:32 2009 --- utkernel_source.th/kernel/sysdepend/device/app_at91/tkdev_timer.h Fri Apr 10 21:15:44 2009 *************** *** 25,35 **** #include "tkdev_conf.h" #if USE_TRAP ! #define ENAINT Asm("msr cpsr_c, %0":: "i"(PSR_SVC)) ! #define DISINT Asm("msr cpsr_c, %0":: "i"(PSR_SVC|PSR_DI)) #else ! #define ENAINT Asm("msr cpsr_c, %0":: "i"(PSR_IRQ)) ! #define DISINT Asm("msr cpsr_c, %0":: "i"(PSR_IRQ|PSR_DI)) #endif /* --- 25,35 ---- #include "tkdev_conf.h" #if USE_TRAP ! #define ENAINT SetCPSR_c(PSR_SVC) ! #define DISINT SetCPSR_c(PSR_SVC|PSR_DI) #else ! #define ENAINT SetCPSR_c(PSR_IRQ) ! #define DISINT SetCPSR_c(PSR_IRQ|PSR_DI) #endif /* diff -Ncr utkernel_source/kernel/sysmain/build/app_at91/Makefile utkernel_source.th/kernel/sysmain/build/app_at91/Makefile *** utkernel_source/kernel/sysmain/build/app_at91/Makefile Mon Mar 30 20:39:32 2009 --- utkernel_source.th/kernel/sysmain/build/app_at91/Makefile Fri Apr 10 21:15:44 2009 *************** *** 17,23 **** # sysmain (system-dependent description) # ! BD = /home/uaa/utk/utk.lpc2388/utkernel_source GNU_BD = /usr/local TOOL_ORIGIN = GNUarm GNUarm = /usr/local/arm-elf --- 17,23 ---- # sysmain (system-dependent description) # ! BD = /home/uaa/utk/utk.lpc2388/utkernel_source.th GNU_BD = /usr/local TOOL_ORIGIN = GNUarm GNUarm = /usr/local/arm-elf diff -Ncr utkernel_source/kernel/sysmain/build/app_at91/kernel-ram.lnk utkernel_source.th/kernel/sysmain/build/app_at91/kernel-ram.lnk *** utkernel_source/kernel/sysmain/build/app_at91/kernel-ram.lnk Tue Mar 17 23:01:14 2009 --- utkernel_source.th/kernel/sysmain/build/app_at91/kernel-ram.lnk Fri Apr 10 21:15:44 2009 *************** *** 44,49 **** --- 44,51 ---- *(.rodata) *(.rodata.*) *(.rodata1) + *(.glue_7) + *(.glue_7t) . = ALIGN(0x10); } =0 __data_org = . ; diff -Ncr utkernel_source/kernel/sysmain/build/app_at91/kernel-rom.lnk utkernel_source.th/kernel/sysmain/build/app_at91/kernel-rom.lnk *** utkernel_source/kernel/sysmain/build/app_at91/kernel-rom.lnk Tue Mar 17 23:01:00 2009 --- utkernel_source.th/kernel/sysmain/build/app_at91/kernel-rom.lnk Fri Apr 10 21:15:44 2009 *************** *** 42,47 **** --- 42,49 ---- *(.rodata) *(.rodata.*) *(.rodata1) + *(.glue_7) + *(.glue_7t) . = ALIGN(0x10); } =0 __data_org = . ; diff -Ncr utkernel_source/lib/libtk/src/sysdepend/app_at91/disint.S utkernel_source.th/lib/libtk/src/sysdepend/app_at91/disint.S *** utkernel_source/lib/libtk/src/sysdepend/app_at91/disint.S Tue Feb 12 17:19:19 2008 --- utkernel_source.th/lib/libtk/src/sysdepend/app_at91/disint.S Fri Apr 10 21:15:44 2009 *************** *** 13,19 **** */ /* ! * @(#)disint.S (libtk/AT91) * * Enable/disable external interrupt */ --- 13,19 ---- */ /* ! * @(#)disint.S (libtk/arm) * * Enable/disable external interrupt */ *************** *** 56,59 **** --- 56,83 ---- bic r2, r0, #PSR_DI orr r2, r2, r3 msr cpsr_c, r2 + bx lr + + /* + * Set CPSR/c + * void SetCPSR_c( UINT cpsr ) + */ + .text + .balign 4 + .globl Csym(SetCPSR_c) + .type Csym(SetCPSR_c), %function + Csym(SetCPSR_c): + msr cpsr_c, r0 + bx lr + + /* + * Get CPSR + * UINT GetCPSR( void ) + */ + .text + .balign 4 + .globl Csym(GetCPSR) + .type Csym(GetCPSR), %function + Csym(GetCPSR): + mrs r0, cpsr bx lr