This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: hal_copy_data and hal_zero_bss
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: Re: [ECOS] hal_copy_data and hal_zero_bss
- From: Chris Morrow <cmorrow at YottaYotta dot com>
- Date: Tue, 27 Feb 2001 02:54:08 -0700
- Organization: YottaYotta Inc.
- References: <ELEIIPIOKOBPDLLMNHKJAEBLCBAA.ppham@mit.edu> <3A6369EB.E071860B@YottaYotta.com> <3A63B257.4E238048@redhat.com> <3A99B9B6.444A2F22@YottaYotta.com> <3A9AE517.255581C4@redhat.com>
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