// Copyright 2020-2024 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef __memcpy_ext_h__
#define __memcpy_ext_h__

/**
 * Constant that defines the size of a block in bytes
 */
#define MEMCPY_EXT_BLOCK_BYTES  32

/**
 * Function that efficiently copies data from external memory to internal
 * memory. The data is copied in blocks of 128 bytes. The source address
 * should be aligned on a 32-byte boundary for optimal performance, and
 * must be aligned on a 4 byte boundary
 *
 * \parm  dst     Destination address, must be a multiple of 4 (word-aligned)
 *
 * \parm  src     Source address, should be a multiple of 32 (vector aligned),
 *                must be a multiple of 4 (word-aligned)
 *
 * \parm  blocks  Block count. 32 x blocks bytes will be copied.
 */
void memcpy_ext(void *dst, void *src, unsigned blocks);

#endif
