am b30b159f: am 61e92a02: am 68835ee8: Merge "system/core LP64 cleanup."
* commit 'b30b159f709a94a0fb1d62aa1ed7b0da8a51120d': system/core LP64 cleanup.
This commit is contained in:
commit
260d400593
|
@ -57,13 +57,13 @@ static void test_call1()
|
|||
|
||||
static void *noisy(void *x)
|
||||
{
|
||||
char c = (unsigned) x;
|
||||
char c = (uintptr_t) x;
|
||||
for(;;) {
|
||||
usleep(250*1000);
|
||||
write(2, &c, 1);
|
||||
if(c == 'C') *((unsigned*) 0) = 42;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int ctest()
|
||||
|
@ -81,7 +81,7 @@ static int ctest()
|
|||
|
||||
static void* thread_callback(void* raw_arg)
|
||||
{
|
||||
return (void*) do_action((const char*) raw_arg);
|
||||
return (void*) (uintptr_t) do_action((const char*) raw_arg);
|
||||
}
|
||||
|
||||
static int do_action_on_thread(const char* arg)
|
||||
|
@ -90,7 +90,7 @@ static int do_action_on_thread(const char* arg)
|
|||
pthread_create(&t, NULL, thread_callback, (void*) arg);
|
||||
void* result = NULL;
|
||||
pthread_join(t, &result);
|
||||
return (int) result;
|
||||
return (int) (uintptr_t) result;
|
||||
}
|
||||
|
||||
__attribute__((noinline)) static int crash3(int a) {
|
||||
|
|
|
@ -124,9 +124,9 @@ static void cmd_boot(struct protocol_handle *phandle, const char *arg)
|
|||
goto error;
|
||||
}
|
||||
|
||||
kernel_ptr = (void *)((unsigned) ptr + hdr->page_size);
|
||||
ramdisk_ptr = (void *)((unsigned) kernel_ptr + kernel_actual);
|
||||
second_ptr = (void *)((unsigned) ramdisk_ptr + ramdisk_actual);
|
||||
kernel_ptr = (void *)((uintptr_t) ptr + hdr->page_size);
|
||||
ramdisk_ptr = (void *)((uintptr_t) kernel_ptr + kernel_actual);
|
||||
second_ptr = (void *)((uintptr_t) ramdisk_ptr + ramdisk_actual);
|
||||
|
||||
D(INFO, "preparing to boot");
|
||||
// Prepares boot physical address. Addresses from header are ignored
|
||||
|
|
|
@ -89,10 +89,10 @@ long kexec_load(unsigned int entry, unsigned long nr_segments,
|
|||
* Kernel address is not set into kernel_phys
|
||||
* Ramdisk is set to position relative to kernel
|
||||
*/
|
||||
int prepare_boot_linux(unsigned kernel_phys, void *kernel_addr, int kernel_size,
|
||||
unsigned ramdisk_phys, void *ramdisk_addr, int ramdisk_size,
|
||||
unsigned second_phys, void *second_addr, int second_size,
|
||||
unsigned atags_phys, void *atags_addr, int atags_size) {
|
||||
int prepare_boot_linux(uintptr_t kernel_phys, void *kernel_addr, int kernel_size,
|
||||
uintptr_t ramdisk_phys, void *ramdisk_addr, int ramdisk_size,
|
||||
uintptr_t second_phys, void *second_addr, int second_size,
|
||||
uintptr_t atags_phys, void *atags_addr, int atags_size) {
|
||||
struct kexec_segment segment[4];
|
||||
int segment_count = 2;
|
||||
unsigned entry = START_ADDRESS + KEXEC_ARM_ZIMAGE_OFFSET;
|
||||
|
|
|
@ -40,8 +40,8 @@
|
|||
#define KEXEC_TYPE_DEFAULT 0
|
||||
#define KEXEC_TYPE_CRASH 1
|
||||
|
||||
int prepare_boot_linux(unsigned, void *, int, unsigned, void *, int,
|
||||
unsigned, void *, int, unsigned, void *, int);
|
||||
int prepare_boot_linux(uintptr_t, void *, int, uintptr_t, void *, int,
|
||||
uintptr_t, void *, int, uintptr_t, void *, int);
|
||||
unsigned *create_atags(unsigned *, int, const struct boot_img_hdr *, int *);
|
||||
long kexec_load(unsigned int, unsigned long, struct kexec_segment *, unsigned long);
|
||||
char *read_atags(const char *, int *);
|
||||
|
|
|
@ -142,7 +142,7 @@ void fastboot_data(struct protocol_handle *phandle, size_t len)
|
|||
char response[64];
|
||||
ssize_t ret;
|
||||
|
||||
snprintf(response, 64, "DATA%08x", len);
|
||||
snprintf(response, 64, "DATA%08zx", len);
|
||||
ret = protocol_handle_write(phandle, response, strlen(response));
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include <benchmark.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <regex.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -158,10 +159,10 @@ void Run(Benchmark* b) {
|
|||
sdev = (sqrt((double)nXvariance) / gBenchmarkNum / gBenchmarkNum) + 0.5;
|
||||
}
|
||||
if (mean > (10000 * sdev)) {
|
||||
printf("%-25s %10llu %10llu%s\n", full_name,
|
||||
printf("%-25s %10" PRIu64 " %10" PRIu64 "%s\n", full_name,
|
||||
static_cast<uint64_t>(iterations), mean, throughput);
|
||||
} else {
|
||||
printf("%-25s %10llu %10llu(\317\203%llu)%s\n", full_name,
|
||||
printf("%-25s %10" PRIu64 " %10" PRIu64 "(\317\203%" PRIu64 ")%s\n", full_name,
|
||||
static_cast<uint64_t>(iterations), mean, sdev, throughput);
|
||||
}
|
||||
fflush(stdout);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <signal.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <log/log.h>
|
||||
|
@ -85,8 +86,8 @@ TEST(liblog, __android_log_btwrite) {
|
|||
|
||||
static void* ConcurrentPrintFn(void *arg) {
|
||||
int ret = __android_log_buf_print(LOG_ID_MAIN, ANDROID_LOG_INFO,
|
||||
"TEST__android_log_print", "Concurrent %d",
|
||||
reinterpret_cast<int>(arg));
|
||||
"TEST__android_log_print", "Concurrent %" PRIuPTR,
|
||||
reinterpret_cast<uintptr_t>(arg));
|
||||
return reinterpret_cast<void*>(ret);
|
||||
}
|
||||
|
||||
|
@ -106,8 +107,9 @@ TEST(liblog, concurrent_name(__android_log_buf_print, NUM_CONCURRENT)) {
|
|||
for (i=0; i < NUM_CONCURRENT; i++) {
|
||||
void* result;
|
||||
ASSERT_EQ(0, pthread_join(t[i], &result));
|
||||
if ((0 == ret) && (0 != reinterpret_cast<int>(result))) {
|
||||
ret = reinterpret_cast<int>(result);
|
||||
int this_result = reinterpret_cast<uintptr_t>(result);
|
||||
if ((0 == ret) && (0 != this_result)) {
|
||||
ret = this_result;
|
||||
}
|
||||
}
|
||||
ASSERT_LT(0, ret);
|
||||
|
|
|
@ -26,6 +26,7 @@ LOCAL_C_INCLUDES += \
|
|||
# Static Library
|
||||
LOCAL_MODULE := libnl_2
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_32_BIT_ONLY := true
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
@ -34,4 +35,5 @@ LOCAL_WHOLE_STATIC_LIBRARIES:= libnl_2
|
|||
LOCAL_SHARED_LIBRARIES:= liblog
|
||||
LOCAL_MODULE := libnl_2
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_32_BIT_ONLY := true
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
|
|
@ -200,7 +200,7 @@ static bool str_icase_equals(void *keyA, void *keyB) {
|
|||
}
|
||||
|
||||
static int int_hash(void *key) {
|
||||
return (int) key;
|
||||
return (int) (uintptr_t) key;
|
||||
}
|
||||
|
||||
static bool int_equals(void *keyA, void *keyB) {
|
||||
|
@ -487,7 +487,7 @@ static void derive_permissions_locked(struct fuse* fuse, struct node *parent,
|
|||
break;
|
||||
case PERM_ANDROID_DATA:
|
||||
case PERM_ANDROID_OBB:
|
||||
appid = (appid_t) hashmapGet(fuse->package_to_appid, node->name);
|
||||
appid = (appid_t) (uintptr_t) hashmapGet(fuse->package_to_appid, node->name);
|
||||
if (appid != 0) {
|
||||
node->uid = multiuser_get_uid(parent->userid, appid);
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ static bool get_caller_has_rw_locked(struct fuse* fuse, const struct fuse_in_hea
|
|||
}
|
||||
|
||||
appid_t appid = multiuser_get_app_id(hdr->uid);
|
||||
return hashmapContainsKey(fuse->appid_with_rw, (void*) appid);
|
||||
return hashmapContainsKey(fuse->appid_with_rw, (void*) (uintptr_t) appid);
|
||||
}
|
||||
|
||||
/* Kernel has already enforced everything we returned through
|
||||
|
@ -1621,12 +1621,12 @@ static int read_package_list(struct fuse *fuse) {
|
|||
|
||||
if (sscanf(buf, "%s %d %*d %*s %*s %s", package_name, &appid, gids) == 3) {
|
||||
char* package_name_dup = strdup(package_name);
|
||||
hashmapPut(fuse->package_to_appid, package_name_dup, (void*) appid);
|
||||
hashmapPut(fuse->package_to_appid, package_name_dup, (void*) (uintptr_t) appid);
|
||||
|
||||
char* token = strtok(gids, ",");
|
||||
while (token != NULL) {
|
||||
if (strtoul(token, NULL, 10) == fuse->write_gid) {
|
||||
hashmapPut(fuse->appid_with_rw, (void*) appid, (void*) 1);
|
||||
hashmapPut(fuse->appid_with_rw, (void*) (uintptr_t) appid, (void*) (uintptr_t) 1);
|
||||
break;
|
||||
}
|
||||
token = strtok(NULL, ",");
|
||||
|
|
Loading…
Reference in New Issue