Save and restore pr register within _writearray() / _writeblock(). Cleaner coding, fixes GCC 3.3.1 build.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4803 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2004-06-25 21:01:37 +00:00
parent 7c6bdd6493
commit b058366b13
2 changed files with 4 additions and 0 deletions

View file

@ -54,6 +54,7 @@ static void _writeblock(unsigned char *address, unsigned mask, unsigned bits)
* see there for an explanation) for all 8 pixels and put them on an
* extra stack */
asm (
"sts.l pr,@-r15 \n" /* save pr (fix GCC331 build, cleaner) */
"mov #8,r3 \n" /* loop count in r3: 8 pixels */
"mov %6,r2 \n" /* copy mask */
@ -103,6 +104,7 @@ static void _writeblock(unsigned char *address, unsigned mask, unsigned bits)
"add #-1,r3 \n" /* decrease loop count */
"cmp/pl r3 \n" /* loop count > 0? */
"bt .wb_loop \n" /* yes: loop */
"lds.l @r15+,pr \n" /* retsore pr */
: /* outputs */
/* %0, in & out */ "+r"(_gray_random_buffer),
/* %1, in & out */ "+r"(pat_ptr)

View file

@ -49,6 +49,7 @@ static void _writearray(unsigned char *address, unsigned char *src, int stride,
* _writepixel, see there for an explanation) for all 8 pixels and put them
* on an extra "stack" */
asm (
"sts.l pr,@-r15 \n" /* save pr (fix GCC331 build, cleaner) */
"mov #8,r3 \n" /* loop count in r3: 8 pixels */
"mov %7,r2 \n" /* copy mask */
@ -98,6 +99,7 @@ static void _writearray(unsigned char *address, unsigned char *src, int stride,
"add #-1,r3 \n" /* decrease loop count */
"cmp/pl r3 \n" /* loop count > 0? */
"bt .wa_loop \n" /* yes: loop */
"lds.l @r15+,pr \n" /* restore pr */
: /* outputs */
/* %0, in & out */ "+r"(_gray_random_buffer),
/* %1, in & out */ "+r"(pat_ptr)