root/memdump/string.h

Revision d9d56396ef1468baee9e902358467af50eae4e07, 0.5 KB (checked in by H. Peter Anvin <hpa@…>, 3 years ago)

Run Nindent on memdump/string.h

Automatically reformat memdump/string.h using Nindent.

Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).

Signed-off-by: H. Peter Anvin <hpa@…>

  • Property mode set to 100644
Line 
1/*
2 * string.h
3 */
4
5#ifndef _STRING_H
6#define _STRING_H
7
8/* Standard routines */
9#define memcpy(a,b,c)   __builtin_memcpy(a,b,c)
10#define memset(a,b,c)   __builtin_memset(a,b,c)
11#define strcpy(a,b)     __builtin_strcpy(a,b)
12#define strlen(a)       __builtin_strlen(a)
13
14/* This only returns true or false */
15static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
16{
17    _Bool rv;
18    asm volatile ("cld ; repe ; cmpsb ; setne %0":"=abd" (rv), "+D"(__m1),
19                  "+S"(__m2), "+c"(__n));
20    return rv;
21}
22
23#endif /* _STRING_H */
Note: See TracBrowser for help on using the browser.