source: trunk/softs/tsar_boot/src/boot_memcpy.c @ 411

Last change on this file since 411 was 292, checked in by cfuguet, 12 years ago

Changing directory structure of the TSAR boot loader.
A README.txt file has been included to explain the new structure
and the MAKEFILE parameters.

Erasing the heap segment for the boot elf loader. All the work space
is allocated in the stack.

The stack size is defined in the include/defs.h.

Important modification in the reset.S file. The non-boot
processors (processor id != 0) wait in a low comsumption energy
mode to be wake up by processor 0 using an IPI. Each processor
has a private mailbox in the local XICU. The value written in
the mailbox will be used as address to jump by the processors.

The waking up of non-boot processors is not done in this boot loader
so it must be done in the application loaded.

The boot_loader_elf function loads into memory an executable .elf file
which must be placed in the BOOT_LOADER_LBA block of the disk. This
constant can be defined in the include/defs.h file.

File size: 489 bytes
Line 
1#include <boot_memcpy.h>
2
3void * boot_memcpy(void *_dst, const void *_src, unsigned int size)
4{
5    unsigned int *dst = _dst;
6    const unsigned int *src = _src;
7    if ( ! ((unsigned int)dst & 3) && ! ((unsigned int)src & 3) )
8        while (size > 3) {
9            *dst++ = *src++;
10            size -= 4;
11        }
12
13    unsigned char *cdst = (unsigned char*) dst;
14    unsigned char *csrc = (unsigned char*) src;
15
16    while (size--) {
17        *cdst++ = *csrc++;
18    }
19    return _dst;
20}
21
Note: See TracBrowser for help on using the repository browser.