Skip to content

Commit

Permalink
update Android build
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdesaulniers committed Sep 23, 2016
1 parent 14355fc commit 1c66ad6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
9 changes: 3 additions & 6 deletions Android.mk
Expand Up @@ -16,17 +16,14 @@ LOCAL_SRC_FILES := \
src/sat.cc \
src/sat_factory.cc \
src/worker.cc

# just build a 32b version, even on 64b hosts
LOCAL_MULTILIB := 32
LOCAL_MODULE:= stressapptest
LOCAL_MODULE_TAGS := optional

LOCAL_CFLAGS := -DHAVE_CONFIG_H -DANDROID -DNDEBUG -UDEBUG -DCHECKOPTS

LOCAL_C_INCLUDES := \
bionic \
external/stlport/stlport

LOCAL_CPP_EXTENSION := .cc

LOCAL_SHARED_LIBRARIES := libc libstlport

include $(BUILD_EXECUTABLE)
26 changes: 13 additions & 13 deletions src/adler32memcpy.cc
Expand Up @@ -423,22 +423,22 @@ bool AdlerMemcpyAsm(uint64 *dstmem64, uint64 *srcmem64,
#define crc_r "r6"

asm volatile (
"mov "src_r", %[src]; \n"
"mov "dst_r", %[dst]; \n"
"mov "crc_r", %[crc]; \n"
"mov "blocks_r", %[blocks]; \n"
"mov " src_r ", %[src]; \n"
"mov " dst_r ", %[dst]; \n"
"mov " crc_r ", %[crc]; \n"
"mov " blocks_r ", %[blocks]; \n"

// Loop over block count.
"cmp "blocks_r", #0; \n" // Compare counter to zero.
"cmp " blocks_r ", #0; \n" // Compare counter to zero.
"ble END; \n"


// Preload upcoming cacheline.
"pld ["src_r", #0x0]; \n"
"pld ["src_r", #0x20]; \n"
"pld [" src_r ", #0x0]; \n"
"pld [" src_r ", #0x20]; \n"

// Init checksum
"vldm "crc_r", {q0}; \n"
"vldm " crc_r ", {q0}; \n"
"vmov.i32 q1, #0; \n"

// Start of the loop which copies 48 bytes from source to dst each time.
Expand All @@ -448,8 +448,8 @@ bool AdlerMemcpyAsm(uint64 *dstmem64, uint64 *srcmem64,
// We are using 2 words out of 4 words in each qX register,
// word index 0 and word index 2. We'll swizzle them in a bit.
// Copy it.
"vldm "src_r"!, {q8, q9, q10, q11}; \n"
"vstm "dst_r"!, {q8, q9, q10, q11}; \n"
"vldm " src_r "!, {q8, q9, q10, q11}; \n"
"vstm " dst_r "!, {q8, q9, q10, q11}; \n"

// Arrange it.
"vmov.i64 q12, #0; \n"
Expand Down Expand Up @@ -487,8 +487,8 @@ bool AdlerMemcpyAsm(uint64 *dstmem64, uint64 *srcmem64,
"vadd.i64 q1, q1, q0; \n"

// Increment counter and loop.
"sub "blocks_r", "blocks_r", #1; \n"
"cmp "blocks_r", #0; \n" // Compare counter to zero.
"sub " blocks_r ", " blocks_r ", #1; \n"
"cmp " blocks_r ", #0; \n" // Compare counter to zero.
"bgt TOP; \n"


Expand All @@ -497,7 +497,7 @@ bool AdlerMemcpyAsm(uint64 *dstmem64, uint64 *srcmem64,
// 64 bit numbers and have to be converted to 64 bit numbers)
// seems like Adler128 (since size of each part is 4 byte rather than
// 1 byte).
"vstm "crc_r", {q0, q1}; \n"
"vstm " crc_r ", {q0, q1}; \n"

// Output registers.
:
Expand Down
2 changes: 1 addition & 1 deletion src/stressapptest_config_android.h
Expand Up @@ -52,7 +52,7 @@
#define HAVE_NETDB_H 1

/* Define to 1 if you have the `posix_memalign' function. */
/* #undef HAVE_POSIX_MEMALIGN */
#define HAVE_POSIX_MEMALIGN 1

/* Define to 1 if you have the <pthread.h> header file. */
#define HAVE_PTHREAD_H 1
Expand Down
2 changes: 1 addition & 1 deletion src/worker.cc
Expand Up @@ -2056,7 +2056,7 @@ bool NetworkListenThread::Listen() {
sa.sin_addr.s_addr = INADDR_ANY;
sa.sin_port = htons(kNetworkPort);

if (-1 == bind(sock_, (struct sockaddr*)&sa, sizeof(struct sockaddr))) {
if (-1 == ::bind(sock_, (struct sockaddr*)&sa, sizeof(struct sockaddr))) {
char buf[256];
sat_strerror(errno, buf, sizeof(buf));
logprintf(0, "Process Error: Cannot bind socket: %s\n", buf);
Expand Down

0 comments on commit 1c66ad6

Please sign in to comment.