Kazu Hirata
kazu****@cs*****
2003年 10月 21日 (火) 12:30:19 JST
佐藤様、 __save_flags and __restore_flags の最適化です。 kernel の compile 結果を見る限り、かなりの関数で保存される register の 数が減っています。 Kazu Hirata Index: system.h =================================================================== RCS file: /cvsroot/uclinux-h8/uClinux-2.4.x/include/asm-h8300/system.h,v retrieving revision 1.8 diff -u -r1.8 system.h --- system.h 24 Jul 2003 13:11:35 -0000 1.8 +++ system.h 21 Oct 2003 03:24:07 -0000 @@ -53,10 +53,10 @@ #define __cli() asm volatile ("orc #0x80,ccr") #define __save_flags(x) \ - asm volatile ("stc ccr,r1l\n\tmov.l er1,%0":"=r" (x) : : "er1") + asm volatile ("stc ccr,%w0":"=r" (x)) #define __restore_flags(x) \ - asm volatile ("mov.l %0,er1\n\tldc r1l,ccr": :"r" (x) : "er1") + asm volatile ("ldc %w0,ccr": :"r" (x)) #define __save_and_cli(flags) do { save_flags(flags); cli(); } while(0) #define __save_and_sti(flags) do { save_flags(flags); sti(); } while(0)