This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: hal_copy_data and hal_zero_bss


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]