1
/* Copyright (c) 2010 Jan Waclawek
3
based on libc/pmstring/memcmp_P.S which is
4
Copyright (c) 2002, 2007 Marek Michalkiewicz
5
Copyright (c) 2007 Dmitry Xmelkov
6
and on exteded program memory routines, which are
7
Copyright (c) 2006, Carlos Lamas
11
Redistribution and use in source and binary forms, with or without
12
modification, are permitted provided that the following conditions are met:
14
* Redistributions of source code must retain the above copyright
15
notice, this list of conditions and the following disclaimer.
16
* Redistributions in binary form must reproduce the above copyright
17
notice, this list of conditions and the following disclaimer in
18
the documentation and/or other materials provided with the
20
* Neither the name of the copyright holders nor the names of
21
contributors may be used to endorse or promote products derived
22
from this software without specific prior written permission.
24
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
POSSIBILITY OF SUCH DAMAGE. */
36
/* $Id: memcmp_PF.S 2191 2010-11-05 13:45:57Z arcanum $ */
40
/** \ingroup avr_pgmspace
41
\fn int memcmp_PF(const void *s1, uint_farptr_t s2, size_t len)
42
\brief Compare memory areas
44
The memcmp_PF() function compares the first \p len bytes of the memory
45
areas \p s1 and flash \p s2. The comparision is performed using unsigned
46
char operations. It is an equivalent of memcmp_P() function, except
47
that it is capable working on all FLASH including the exteded area
50
\returns The memcmp_PF() function returns an integer less than, equal
51
to, or greater than zero if the first \p len bytes of \p s1 is found,
52
respectively, to be less than, to match, or be greater than the first
53
\p len bytes of \p s2. */
56
#if !defined(__AVR_TINY__)
58
#if !defined(__DOXYGEN__)
74
/* the conditional caters for pre-1.6.8 libc and standalone use */
75
#ifdef ASSEMBLY_CLIB_SECTION
81
.type _U(memcmp_PF), @function
84
LPM_R0_ZPLUS_INIT s2_b2
91
LPM_R0_ZPLUS_NEXT s2_b2
104
.size _U(memcmp_PF), . - _U(memcmp_PF)
106
#endif /* not __DOXYGEN__ */
108
#endif /* !defined(__AVR_TINY__) */