4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
8 * Jaewon Lim <jaewon81.lim@samsung.com>
9 * Woojin Jung <woojin2.jung@samsung.com>
10 * Juyoung Kim <j0.kim@samsung.com>
11 * Anastasia Lyupa <a.lyupa@samsung.com>
13 * This library is free software; you can redistribute it and/or modify it under
14 * the terms of the GNU Lesser General Public License as published by the
15 * Free Software Foundation; either version 2.1 of the License, or (at your option)
18 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
19 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
21 * License for more details.
23 * You should have received a copy of the GNU Lesser General Public License
24 * along with this library; if not, write to the Free Software Foundation, Inc., 51
25 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 * - Samsung RnD Institute Russia
41 #include "probeinfo.h"
43 #include "da_memory.h"
45 #include "common_probe_init.h"
46 #include "real_functions.h"
48 static enum DaOptions _sopt = OPT_ALLOC;
50 void *memset(void *memblock, int c, size_t n)
52 static void *(*memsetp)(void *,int,size_t);
53 DECLARE_VARIABLE_STANDARD;
56 GET_REAL_FUNC_RTLD_NEXT(memset);
60 pret = memsetp(memblock, c, n);
62 POST_PACK_PROBEBLOCK_BEGIN();
65 PACK_COMMON_BEGIN(MSG_PROBE_MEMORY,
67 "pdx", voidp_to_uint64(memblock), c,
69 PACK_COMMON_END('p', pret, newerrno, blockresult);
70 PACK_MEMORY(n, MEMORY_API_MANAGE, pret);
73 POST_PACK_PROBEBLOCK_END();
78 int memcmp(const void * ptr1, const void * ptr2, size_t num)
80 static int(*memcmpp)(const void *,const void *,size_t);
81 DECLARE_VARIABLE_STANDARD;
83 GET_REAL_FUNC_RTLD_NEXT(memcmp);
87 ret = memcmpp(ptr1, ptr2, num);
89 POST_PACK_PROBEBLOCK_BEGIN();
92 PACK_COMMON_BEGIN(MSG_PROBE_MEMORY,
94 "ppx", voidp_to_uint64(ptr1), voidp_to_uint64(ptr2),
96 PACK_COMMON_END('d', ret, newerrno, blockresult);
97 PACK_MEMORY(num, MEMORY_API_MANAGE, ret);
100 POST_PACK_PROBEBLOCK_END();
105 void *memcpy(void * destination, const void * source, size_t num )
107 static void *(*memcpyp)(void *,const void *,size_t);
108 DECLARE_VARIABLE_STANDARD;
111 GET_REAL_FUNC_RTLD_NEXT(memcpy);
115 pret = memcpyp(destination, source, num);
117 POST_PACK_PROBEBLOCK_BEGIN();
120 PACK_COMMON_BEGIN(MSG_PROBE_MEMORY,
122 "ppx", voidp_to_uint64(destination),
123 voidp_to_uint64(source),
125 PACK_COMMON_END('p', pret, newerrno, blockresult);
126 PACK_MEMORY(num, MEMORY_API_MANAGE, pret);
129 POST_PACK_PROBEBLOCK_END();