From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Morrow To: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] hal_copy_data and hal_zero_bss Date: Tue, 27 Feb 2001 01:54:00 -0000 Message-id: <3A9B7940.5C1C5038@YottaYotta.com> References: <3A6369EB.E071860B@YottaYotta.com> <3A63B257.4E238048@redhat.com> <3A99B9B6.444A2F22@YottaYotta.com> <3A9AE517.255581C4@redhat.com> X-SW-Source: 2001-02/msg00406.html Jonathan Larmour wrote: > > Chris Morrow wrote: > > > > An assembler version of hal_zero_bss is included > > at the end of this message. I placed mine in > > vectors.S. I'm not sure where you would like it. > One slight problem. If bss is exactly a multiple of the block size, the byte loop goes wild. Sorry about that. diff -c -r1.23 vectors.S *** vectors.S 2001/02/27 01:21:47 1.23 --- vectors.S 2001/02/27 09:46:57 *************** *** 803,814 **** bne a3,a0,2b # to next store nop # finish 1 byte at a time 1: sb zero,0(a0) # zero memory addiu a0,a0,1 # next addr bne a0,a1,1b # to next store nop ! jr ra FUNC_END(hal_zero_bss) --- 803,820 ---- bne a3,a0,2b # to next store nop + # If length is a multiple of block size then we + # are done and need to skip the byte loop + beq a1,a0,3f + nop + # finish 1 byte at a time 1: sb zero,0(a0) # zero memory addiu a0,a0,1 # next addr bne a0,a1,1b # to next store nop ! 3: jr ra ! nop FUNC_END(hal_zero_bss) -- Chris Morrow YottaYotta Inc. email: cmorrow@yottayotta.com phone: (780) 439 9000 ext 227 web: http://www.yottayotta.com