CFLAGS = $(WARN_CFLAGS) -fPIC
CFLAGS+= -DLINKER_PATH=\"$(LINKER_PATH)\"
+CFLAGS+= -DARCH_DIR=\"$(ARCH_DIR)\"
CFLAGS+= -DPROBELIB_MAIN=\"$(PROBELIB_MAIN)\"
CFLAGS+= -DPROBELIB_EVENT=\"$(PROBELIB_EVENT)\"
CFLAGS+= -DPROBELIB_CAPI=\"$(PROBELIB_CAPI)\"
ASM_SRC = ./helper/da_call_original.S
+DUMMY_FUNCS_SRC = ./sysdeps/$(ARCH_DIR)/probe_dummies.S
+
## Totally brain-dead.
## FIXME: Rewrite this normally with eval.
ASM_OBJ = $(patsubst %.S,%.o, $(ASM_SRC))
-TIZEN_OBJS = $(patsubst %.cpp,%.o, $(patsubst %.c,%.o, $(TIZEN_SRCS))) $(ASM_OBJ)
+DUMMY_FUNCS_OBJ = $(patsubst %.S,%.o, $(DUMMY_FUNCS_SRC))
+TIZEN_OBJS = $(patsubst %.cpp,%.o, $(patsubst %.c,%.o, $(TIZEN_SRCS))) $(ASM_OBJ) $(DUMMY_FUNCS_OBJ)
PROBE_EVENT_OBJS = $(patsubst %.cpp,%.o, $(patsubst %.c,%.o, $(PROBE_EVENT_SRCS)))
PROBE_GRAPHICS_OBJS = $(patsubst %.cpp,%.o, $(patsubst %.c,%.o, $(PROBE_GRAPHICS_SRCS)))
PROBE_UI_OBJS = $(patsubst %.cpp,%.o, $(patsubst %.c,%.o, $(PROBE_UI_SRCS)))
$(ASM_OBJ): $(ASM_SRC)
$(CC) $(ASMFLAG) -c $^ -o $@
+$(DUMMY_FUNCS_OBJ): $(DUMMY_FUNCS_SRC)
+ $(CC) $(ASMFLAG) -c $^ -o $@
+
API_NAME_LIST = scripts/api_names_all.txt
GENERATED_HEADERS = include/api_id_mapping.h include/x_define_api_id_list.h
SOURCE_HEADERS = include/api_ld_mapping.h
#include "common_probe_init.h"
#include "lsan_open.h"
#include "got_patching.h"
+#include "arch_probe_dummies.h"
#define UDS_NAME "/run/swap/lib.socket"
#define TIMERFD_INTERVAL 100000000 /* 0.1 sec */
return (uint64_t)tv.tv_sec * 1000 * 1000 * 1000 + tv.tv_usec * 1000;
}
-unsigned long get_caller_addr(unsigned long caller_addr)
-{
- return caller_addr;
-}
-
-unsigned char get_call_type(unsigned char call_type)
-{
- return call_type;
-}
-
-void write_msg(unsigned long __unused msg_buf,
- size_t __unused len,
- unsigned long __unused call_type_p,
- unsigned long __unused caller_p,
- unsigned long __unused caller_address,
- unsigned long __unused orig_p)
-{
- return;
-}
/************************************************************************
* probe functions
--- /dev/null
+#ifndef __ARCH_PROBE_DUMBS_H__
+#define __ARCH_PROBE_DUMBS_H__
+
+/* Architecture-dependent includes */
+
+unsigned long get_caller_addr(unsigned long caller_addr);
+
+unsigned char get_call_type(unsigned char call_type);
+
+void write_msg(unsigned long msg_buf, size_t len, unsigned long call_type_p,
+ unsigned long caller_p, unsigned long caller_address,
+ unsigned long orig_p);
+
+
+#endif /* __ARHC_PROBE_DUMBS_H__ */
BuildRequires: cmake
%endif
+# Define architecture
+%ifarch armv7l
+ %define ARCH_DIR arm
+%else
+ %ifarch aarch64
+ %define ARCH_DIR arm64
+ %else
+ %define ARCH_DIR i386
+ %endif
+%endif
+
+
# Applied python acceleration
%ifarch armv7l
BuildRequires: python-accel-armv7l-cross-arm
export LIBDIR=%{_libdir}
export INCLUDEDIR=%{_includedir}
export LIB=%{_lib}
+export ARCH_DIR=%{ARCH_DIR}
# set linker path
make -C elf_parsing
export BINDIR=%{_bindir}
export LIBDIR=%{_libdir}
export INCLUDEDIR=%{_includedir}
+export ARCH_DIR=%{ARCH_DIR}
rm -rf ${RPM_BUILD_ROOT}
--- /dev/null
+ .text
+
+@ void write_msg(unsigned long msg_buf, size_t len, unsigned long call_type_p,
+@ unsigned long caller_p, unsigned long caller_address,
+@ unsigned long orig_p);
+
+ .globl write_msg
+ .type write_msg, #function
+write_msg:
+ mov r0, r0
+ bx lr
+ .size write_msg, .-write_msg
+
+
+
+@ unsigned long get_caller_addr(unsigned long caller_addr);
+
+ .globl get_caller_addr
+ .type get_caller_addr, #function
+get_caller_addr:
+@ arm GCC standard call convention implies that both first arg and ret val are
+@ stored in r0, so do nothing
+ mov r0, r0
+ bx lr
+ .size get_caller_addr, .-get_caller_addr
+
+
+
+@ unsigned char get_call_type(unsigned char call_type);
+
+ .globl get_call_type
+ .type get_call_type, #function
+get_call_type:
+@ arm GCC standard call convention implies that both first arg and ret val are
+@ stored in r0, so do nothing
+ mov r0, r0
+ bx lr
+ .size get_call_type, .-get_call_type
--- /dev/null
+ .text
+
+# void write_msg(unsigned long msg_buf, size_t len, unsigned long call_type_p,
+# unsigned long caller_p, unsigned long caller_address,
+# unsigned long orig_p);
+
+ .globl write_msg
+ .type write_msg, @function
+write_msg:
+ nop
+ ret
+ .size write_msg, .-write_msg
+
+
+
+# unsigned long get_caller_addr(unsigned long caller_addr);
+
+ .globl get_caller_addr
+ .type get_caller_addr, @function
+get_caller_addr:
+# arm64 GCC standard call convention implies that both first arg and ret val
+# are stored in r0, so do nothing
+ nop
+ ret
+ .size get_caller_addr, .-get_caller_addr
+
+
+
+# unsigned char get_call_type(unsigned char call_type);
+
+ .globl get_call_type
+ .type get_call_type, @function
+get_call_type:
+# arm64 GCC standard call convention implies that both first arg and ret val
+# are stored in r0, so do nothing
+ nop
+ ret
+ .size get_call_type, .-get_call_type
--- /dev/null
+ .text
+
+# void write_msg(unsigned long msg_buf, size_t len, unsigned long call_type_p,
+# unsigned long caller_p, unsigned long caller_address,
+# unsigned long orig_p);
+
+ .globl write_msg
+ .type write_msg, @function
+write_msg:
+ nop
+ ret
+ .size write_msg, .-write_msg
+
+
+
+# unsigned long get_caller_addr(unsigned long caller_addr);
+
+ .globl get_caller_addr
+ .type get_caller_addr, @function
+get_caller_addr:
+# x86 GCC using cdecl stores both first arg and ret val in EAX, so do nothing
+ nop
+ ret
+ .size get_caller_addr, .-get_caller_addr
+
+
+
+# unsigned char get_call_type(unsigned char call_type);
+
+ .globl get_call_type
+ .type get_call_type, @function
+get_call_type:
+# x86 GCC using cdecl stores both first arg and ret val in EAX, so do nothing
+ nop
+ ret
+ .size get_call_type, .-get_call_type