Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8676047 authored by Paul Duffin's avatar Paul Duffin Committed by android-build-merger
Browse files

Merge "Move libartimagevalues to art/libartimagevalues" am: f24ffd64 am: 0e2760f2

am: d7ac979a

Change-Id: Id7706448ef346e4c42c3f4f13da72243a981af94
parents 7d8313c0 d7ac979a
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
// Inherit image values.
art_global_defaults {
    name: "libartimagevalues_defaults",
}

cc_library_static {
    name: "libartimagevalues",
    defaults: ["libartimagevalues_defaults"],
    srcs: ["art_image_values.cpp"],
    export_include_dirs: ["."],
    cflags: ["-Wconversion"],
}
+0 −37
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "art_image_values.h"

namespace android {
namespace installd {
namespace art {

uint32_t GetImageBaseAddress() {
    return ART_BASE_ADDRESS;
}
int32_t GetImageMinBaseAddressDelta() {
    return ART_BASE_ADDRESS_MIN_DELTA;
}
int32_t GetImageMaxBaseAddressDelta() {
    return ART_BASE_ADDRESS_MAX_DELTA;
}

static_assert(ART_BASE_ADDRESS_MIN_DELTA < ART_BASE_ADDRESS_MAX_DELTA, "Inconsistent setup");

}  // namespace art
}  // namespace installd
}  // namespace android
+0 −34
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef FRAMEWORKS_NATIVE_CMDS_INSTALLD_ART_HELPER_ART_IMAGE_VALUES_H
#define FRAMEWORKS_NATIVE_CMDS_INSTALLD_ART_HELPER_ART_IMAGE_VALUES_H

#include <cstdint>

namespace android {
namespace installd {
namespace art {

uint32_t GetImageBaseAddress();
int32_t GetImageMinBaseAddressDelta();
int32_t GetImageMaxBaseAddressDelta();

}  // namespace art
}  // namespace installd
}  // namespace android

#endif  // FRAMEWORKS_NATIVE_CMDS_INSTALLD_ART_HELPER_ART_IMAGE_VALUES_H
+5 −3
Original line number Diff line number Diff line
@@ -445,9 +445,11 @@ private:
        }
        cmd.push_back(StringPrintf("--oat-file=%s", oat_path.c_str()));

        int32_t base_offset = ChooseRelocationOffsetDelta(art::GetImageMinBaseAddressDelta(),
                                                          art::GetImageMaxBaseAddressDelta());
        cmd.push_back(StringPrintf("--base=0x%x", art::GetImageBaseAddress() + base_offset));
        int32_t base_offset = ChooseRelocationOffsetDelta(
                art::imagevalues::GetImageMinBaseAddressDelta(),
                art::imagevalues::GetImageMaxBaseAddressDelta());
        cmd.push_back(StringPrintf("--base=0x%x",
                art::imagevalues::GetImageBaseAddress() + base_offset));

        cmd.push_back(StringPrintf("--instruction-set=%s", isa));