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"
47 static enum DaOptions _sopt = OPT_ALLOC;
49 void *memset(void *memblock, int c, size_t n)
51 static void *(*memsetp)(void *,int,size_t);
52 DECLARE_VARIABLE_STANDARD;
55 GET_REAL_FUNC_RTLD_NEXT(memset);
59 pret = memsetp(memblock, c, n);
61 POST_PACK_PROBEBLOCK_BEGIN();
64 PACK_COMMON_BEGIN(MSG_PROBE_MEMORY,
66 "pdx", voidp_to_uint64(memblock), c,
68 PACK_COMMON_END('p', pret, newerrno, blockresult);
69 PACK_MEMORY(n, MEMORY_API_MANAGE, pret);
72 POST_PACK_PROBEBLOCK_END();
77 int memcmp(const void * ptr1, const void * ptr2, size_t num)
79 static int(*memcmpp)(const void *,const void *,size_t);
80 DECLARE_VARIABLE_STANDARD;
82 GET_REAL_FUNC_RTLD_NEXT(memcmp);
86 ret = memcmpp(ptr1, ptr2, num);
88 POST_PACK_PROBEBLOCK_BEGIN();
91 PACK_COMMON_BEGIN(MSG_PROBE_MEMORY,
93 "ppx", voidp_to_uint64(ptr1), voidp_to_uint64(ptr2),
95 PACK_COMMON_END('d', ret, newerrno, blockresult);
96 PACK_MEMORY(num, MEMORY_API_MANAGE, ret);
99 POST_PACK_PROBEBLOCK_END();
104 void *memcpy(void * destination, const void * source, size_t num )
106 static void *(*memcpyp)(void *,const void *,size_t);
107 DECLARE_VARIABLE_STANDARD;
110 GET_REAL_FUNC_RTLD_NEXT(memcpy);
114 pret = memcpyp(destination, source, num);
116 POST_PACK_PROBEBLOCK_BEGIN();
119 PACK_COMMON_BEGIN(MSG_PROBE_MEMORY,
121 "ppx", voidp_to_uint64(destination),
122 voidp_to_uint64(source),
124 PACK_COMMON_END('p', pret, newerrno, blockresult);
125 PACK_MEMORY(num, MEMORY_API_MANAGE, pret);
128 POST_PACK_PROBEBLOCK_END();