1 /*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2012-2019. All rights reserved.
3 * Description: Boot string function implementation.
4 *
5 * Create: 2012-12-22
6 */
7
8 /**
9 * memcmp - Compare two areas of memory
10 * @cs: One area of memory
11 * @ct: Another area of memory
12 * @count: The size of the area.
13 */
memcmp(const void * cs,const void * ct,unsigned int count)14 int memcmp(const void *cs, const void *ct, unsigned int count)
15 {
16 unsigned int cnt = count;
17 const unsigned char *l = cs;
18 const unsigned char *r = ct;
19 for (; (cnt != 0) && (*l == *r); cnt--, l++, r++) {
20 };
21 return (cnt != 0) ? *l - *r : 0;
22 }
23