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


Chris Morrow wrote:
> 
> The hal_copy_data() and hal_zero_bss() in the mips architecture
> currently
> do byte reads and writes. Is there any reason they shouldn't use the
> memset() and memcpy() functions from infra?

There's no guarantee that calling memcpy and memset won't reference
different versions of those functions that rely on the BSS being zeroed or
there being initialized data. e.g. in a debug build.

Better to write those to do word accesses, taking into account that the
symbols may not be word-aligned. They should, but they may not be and we
shouldn't explode if they aren't.

It would probably be even better to just code them in assembler anyway, and
avoid the call from vectors.S. It's easy to write a Duff's device
implementation in asm too. Patches welcome :).

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine

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