Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- art/.git
- diff --git a/compiler/optimizing/intrinsics_arm.cc b/compiler/optimizing/intrinsics_arm.cc
- index 0ec0366ed..d08aacae3 100644
- --- a/compiler/optimizing/intrinsics_arm.cc
- +++ b/compiler/optimizing/intrinsics_arm.cc
- @@ -2216,15 +2216,51 @@ void IntrinsicCodeGeneratorARM::VisitDoubleIsInfinite(HInvoke* invoke) {
- __ Lsr(out, out, 5);
- }
- +void IntrinsicLocationsBuilderARM::VisitMathCeil(HInvoke* invoke) {
- + if (features_.HasARMv8AInstructions()) {
- + CreateFPToFPLocations(arena_, invoke);
- + }
- +}
- +
- +void IntrinsicCodeGeneratorARM::VisitMathCeil(HInvoke* invoke) {
- + ArmAssembler* assembler = GetAssembler();
- + DCHECK(codegen_->GetInstructionSetFeatures().HasARMv8AInstructions());
- + __ vrintdp(FromLowSToD(invoke->GetLocations()->Out().AsFpuRegisterPairLow<SRegister>()),
- + FromLowSToD(invoke->GetLocations()->InAt(0).AsFpuRegisterPairLow<SRegister>()));
- +}
- +
- +void IntrinsicLocationsBuilderARM::VisitMathFloor(HInvoke* invoke) {
- + if (features_.HasARMv8AInstructions()) {
- + CreateFPToFPLocations(arena_, invoke);
- + }
- +}
- +
- +void IntrinsicCodeGeneratorARM::VisitMathFloor(HInvoke* invoke) {
- + ArmAssembler* assembler = GetAssembler();
- + DCHECK(codegen_->GetInstructionSetFeatures().HasARMv8AInstructions());
- + __ vrintdm(FromLowSToD(invoke->GetLocations()->Out().AsFpuRegisterPairLow<SRegister>()),
- + FromLowSToD(invoke->GetLocations()->InAt(0).AsFpuRegisterPairLow<SRegister>()));
- +}
- +
- +void IntrinsicLocationsBuilderARM::VisitMathRint(HInvoke* invoke) {
- + if (features_.HasARMv8AInstructions()) {
- + CreateFPToFPLocations(arena_, invoke);
- + }
- +}
- +
- +void IntrinsicCodeGeneratorARM::VisitMathRint(HInvoke* invoke) {
- + ArmAssembler* assembler = GetAssembler();
- + DCHECK(codegen_->GetInstructionSetFeatures().HasARMv8AInstructions());
- + __ vrintdn(FromLowSToD(invoke->GetLocations()->Out().AsFpuRegisterPairLow<SRegister>()),
- + FromLowSToD(invoke->GetLocations()->InAt(0).AsFpuRegisterPairLow<SRegister>()));
- +}
- +
- UNIMPLEMENTED_INTRINSIC(ARM, MathMinDoubleDouble)
- UNIMPLEMENTED_INTRINSIC(ARM, MathMinFloatFloat)
- UNIMPLEMENTED_INTRINSIC(ARM, MathMaxDoubleDouble)
- UNIMPLEMENTED_INTRINSIC(ARM, MathMaxFloatFloat)
- UNIMPLEMENTED_INTRINSIC(ARM, MathMinLongLong)
- UNIMPLEMENTED_INTRINSIC(ARM, MathMaxLongLong)
- -UNIMPLEMENTED_INTRINSIC(ARM, MathCeil) // Could be done by changing rounding mode, maybe?
- -UNIMPLEMENTED_INTRINSIC(ARM, MathFloor) // Could be done by changing rounding mode, maybe?
- -UNIMPLEMENTED_INTRINSIC(ARM, MathRint)
- UNIMPLEMENTED_INTRINSIC(ARM, MathRoundDouble) // Could be done by changing rounding mode, maybe?
- UNIMPLEMENTED_INTRINSIC(ARM, MathRoundFloat) // Could be done by changing rounding mode, maybe?
- UNIMPLEMENTED_INTRINSIC(ARM, UnsafeCASLong) // High register pressure.
- diff --git a/compiler/utils/arm/assembler_arm.cc b/compiler/utils/arm/assembler_arm.cc
- index a7f454751..939119538 100644
- --- a/compiler/utils/arm/assembler_arm.cc
- +++ b/compiler/utils/arm/assembler_arm.cc
- @@ -944,5 +944,37 @@ void ArmAssembler::FinalizeTrackedLabels() {
- }
- }
- +int32_t ArmAssembler::EncodeVRINTr(VRINTRoundingMode rm,
- + int output_register_code,
- + int input_register_code,
- + bool is_64bit) {
- + CHECK_NE(output_register_code, kNoSRegister);
- + CHECK_NE(input_register_code, kNoSRegister);
- + uint32_t D, M;
- + uint32_t Vd, Vm;
- + if (is_64bit) {
- + // Encoded as D:Vd and M:Vm.
- + D = (output_register_code >> 4) & 1;
- + Vd = output_register_code & 0xf;
- + M = (input_register_code >> 4) & 1;
- + Vm = input_register_code & 0xf;
- + } else {
- + // Encoded as Vd:D and Vm:M.
- + D = output_register_code & 1;
- + Vd = (output_register_code >> 1) & 0xf;
- + M = input_register_code & 1;
- + Vm = (input_register_code >> 1) & 0xf;
- + }
- + int32_t encoding = (static_cast<int32_t>(kSpecialCondition) << kConditionShift) |
- + B27 | B26 | B25 | B23 |
- + B21 | B20 | B19 |
- + B11 | B9 | B6 |
- + (rm * B16) |
- + is_64bit * B8 |
- + D * B22 | (Vd * B12) |
- + M * B5 | (Vm * B0);
- + return encoding;
- +}
- +
- } // namespace arm
- } // namespace art
- diff --git a/compiler/utils/arm/assembler_arm.h b/compiler/utils/arm/assembler_arm.h
- index 91fe0e14c..d602f6e0f 100644
- --- a/compiler/utils/arm/assembler_arm.h
- +++ b/compiler/utils/arm/assembler_arm.h
- @@ -665,6 +665,29 @@ class ArmAssembler : public Assembler {
- virtual void vcvtsu(SRegister sd, SRegister sm, Condition cond = AL) = 0;
- virtual void vcvtdu(DRegister dd, SRegister sm, Condition cond = AL) = 0;
- + enum VRINTRoundingMode {
- + kVRINTA = 0,
- + kVRINTN = 1,
- + kVRINTP = 2,
- + kVRINTM = 3,
- + };
- +
- + int32_t EncodeVRINTr(VRINTRoundingMode rm,
- + int output_register_code,
- + int input_register_code,
- + bool is_64bit);
- +
- + virtual void vrints(VRINTRoundingMode rm, SRegister sd, SRegister sm) = 0;
- + virtual void vrintd(VRINTRoundingMode rm, DRegister dd, DRegister dm) = 0;
- + void vrintsa(SRegister sd, SRegister sm) { vrints(kVRINTA, sd, sm); }
- + void vrintda(DRegister dd, DRegister dm) { vrintd(kVRINTA, dd, dm); }
- + void vrintsn(SRegister sd, SRegister sm) { vrints(kVRINTN, sd, sm); }
- + void vrintdn(DRegister dd, DRegister dm) { vrintd(kVRINTN, dd, dm); }
- + void vrintsp(SRegister sd, SRegister sm) { vrints(kVRINTP, sd, sm); }
- + void vrintdp(DRegister dd, DRegister dm) { vrintd(kVRINTP, dd, dm); }
- + void vrintsm(SRegister sd, SRegister sm) { vrints(kVRINTM, sd, sm); }
- + void vrintdm(DRegister dd, DRegister dm) { vrintd(kVRINTM, dd, dm); }
- +
- virtual void vcmps(SRegister sd, SRegister sm, Condition cond = AL) = 0;
- virtual void vcmpd(DRegister dd, DRegister dm, Condition cond = AL) = 0;
- virtual void vcmpsz(SRegister sd, Condition cond = AL) = 0;
- diff --git a/compiler/utils/arm/assembler_arm32.cc b/compiler/utils/arm/assembler_arm32.cc
- index 2805d8647..cfbec2962 100644
- --- a/compiler/utils/arm/assembler_arm32.cc
- +++ b/compiler/utils/arm/assembler_arm32.cc
- @@ -526,6 +526,16 @@ void Arm32Assembler::vcvtdu(DRegister dd, SRegister sm, Condition cond) {
- }
- +void Arm32Assembler::vrints(VRINTRoundingMode rm, SRegister sd, SRegister sm) {
- + Emit(EncodeVRINTr(rm, static_cast<int>(sd), static_cast<int>(sm), /* is_64bit */ false));
- +}
- +
- +
- +void Arm32Assembler::vrintd(VRINTRoundingMode rm, DRegister dd, DRegister dm) {
- + Emit(EncodeVRINTr(rm, static_cast<int>(dd), static_cast<int>(dm), /* is_64bit */ true));
- +}
- +
- +
- void Arm32Assembler::vcmps(SRegister sd, SRegister sm, Condition cond) {
- EmitVFPsss(cond, B23 | B21 | B20 | B18 | B6, sd, S0, sm);
- }
- diff --git a/compiler/utils/arm/assembler_arm32.h b/compiler/utils/arm/assembler_arm32.h
- index 63be2e2aa..b8ecfcc7f 100644
- --- a/compiler/utils/arm/assembler_arm32.h
- +++ b/compiler/utils/arm/assembler_arm32.h
- @@ -199,6 +199,9 @@ class Arm32Assembler FINAL : public ArmAssembler {
- void vcvtsu(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
- void vcvtdu(DRegister dd, SRegister sm, Condition cond = AL) OVERRIDE;
- + void vrints(VRINTRoundingMode rm, SRegister sd, SRegister sm) OVERRIDE;
- + void vrintd(VRINTRoundingMode rm, DRegister dd, DRegister dm) OVERRIDE;
- +
- void vcmps(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
- void vcmpd(DRegister dd, DRegister dm, Condition cond = AL) OVERRIDE;
- void vcmpsz(SRegister sd, Condition cond = AL) OVERRIDE;
- diff --git a/compiler/utils/arm/assembler_thumb2.cc b/compiler/utils/arm/assembler_thumb2.cc
- index bd5875f08..b3c1d9fc0 100644
- --- a/compiler/utils/arm/assembler_thumb2.cc
- +++ b/compiler/utils/arm/assembler_thumb2.cc
- @@ -1114,6 +1114,18 @@ void Thumb2Assembler::vcvtdu(DRegister dd, SRegister sm, Condition cond) {
- }
- +void Thumb2Assembler::vrints(VRINTRoundingMode rm, SRegister sd, SRegister sm) {
- + CheckCondition(AL); // VRINT instructions are unpredictable in IT blocks.
- + Emit32(EncodeVRINTr(rm, static_cast<int>(sd), static_cast<int>(sm), /* is_64bit */ false));
- +}
- +
- +
- +void Thumb2Assembler::vrintd(VRINTRoundingMode rm, DRegister dd, DRegister dm) {
- + CheckCondition(AL); // VRINT instructions are unpredictable in IT blocks.
- + Emit32(EncodeVRINTr(rm, static_cast<int>(dd), static_cast<int>(dm), /* is_64bit */ true));
- +}
- +
- +
- void Thumb2Assembler::vcmps(SRegister sd, SRegister sm, Condition cond) {
- EmitVFPsss(cond, B23 | B21 | B20 | B18 | B6, sd, S0, sm);
- }
- diff --git a/compiler/utils/arm/assembler_thumb2.h b/compiler/utils/arm/assembler_thumb2.h
- index 47a55ebfa..8d012dcd0 100644
- --- a/compiler/utils/arm/assembler_thumb2.h
- +++ b/compiler/utils/arm/assembler_thumb2.h
- @@ -245,6 +245,9 @@ class Thumb2Assembler FINAL : public ArmAssembler {
- void vcvtsu(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
- void vcvtdu(DRegister dd, SRegister sm, Condition cond = AL) OVERRIDE;
- + void vrints(VRINTRoundingMode rm, SRegister sd, SRegister sm) OVERRIDE;
- + void vrintd(VRINTRoundingMode rm, DRegister dd, DRegister dm) OVERRIDE;
- +
- void vcmps(SRegister sd, SRegister sm, Condition cond = AL) OVERRIDE;
- void vcmpd(DRegister dd, DRegister dm, Condition cond = AL) OVERRIDE;
- void vcmpsz(SRegister sd, Condition cond = AL) OVERRIDE;
- diff --git a/disassembler/disassembler_arm.cc b/disassembler/disassembler_arm.cc
- index ee4953f8e..be3d7a94d 100644
- --- a/disassembler/disassembler_arm.cc
- +++ b/disassembler/disassembler_arm.cc
- @@ -1481,6 +1481,32 @@ size_t DisassemblerArm::DumpThumb32(std::ostream& os, const uint8_t* instr_ptr)
- }
- break;
- }
- + case 0x6B: // 1101011
- + case 0x6F: { // 1101111
- + constexpr uint32_t fixed_bits_mask = 0xFFBC0ED0;
- + constexpr uint32_t vrintr_fixed_bits = 0xFEB80A40;
- + if ((instr & fixed_bits_mask) == vrintr_fixed_bits) {
- + opcode << "vrint";
- + int rounding_mode = instr >> 16 & 0x3;
- + switch (rounding_mode) {
- + case 0: opcode << "a"; break;
- + case 1: opcode << "n"; break;
- + case 2: opcode << "p"; break;
- + case 3: opcode << "m"; break;
- + default:
- + LOG(FATAL) << "Unexpected rounding mode " << rounding_mode;
- + UNREACHABLE();
- + }
- + bool double_precision = instr >> 8 & 0x1;
- + if (double_precision) {
- + opcode << ".f64.f64 ";
- + } else {
- + opcode << ".f32.f32 ";
- + }
- + opcode << FpRegister(instr, 12, 22) << ", " << FpRegister(instr, 0, 5);
- + }
- + FALLTHROUGH_INTENDED;
- + }
- case 0x7B: case 0x7F: {
- FpRegister d(instr, 12, 22);
- FpRegister m(instr, 0, 5);
- diff --git a/runtime/Android.mk b/runtime/Android.mk
- index a4b1a3cb5..3bc025966 100644
- --- a/runtime/Android.mk
- +++ b/runtime/Android.mk
- @@ -582,11 +582,6 @@ endif
- LOCAL_NATIVE_COVERAGE := $(ART_COVERAGE)
- ifeq ($$(art_target_or_host),target)
- - ifneq ($$(art_ndebug_or_debug),debug)
- - # Leave the symbols in the shared library so that stack unwinders can
- - # produce meaningful name resolution.
- - LOCAL_STRIP_MODULE := keep_symbols
- - endif
- include $$(BUILD_SHARED_LIBRARY)
- else # host
- ifeq ($$(art_static_or_shared),static)
- diff --git a/runtime/arch/arm/instruction_set_features_arm.cc b/runtime/arch/arm/instruction_set_features_arm.cc
- index 2aa4ee21d..01faf5cd5 100644
- --- a/runtime/arch/arm/instruction_set_features_arm.cc
- +++ b/runtime/arch/arm/instruction_set_features_arm.cc
- @@ -29,6 +29,7 @@
- #if defined(__arm__)
- extern "C" bool artCheckForArmSdivInstruction();
- +extern "C" bool artCheckForArmv8AInstructions();
- #endif
- namespace art {
- @@ -39,23 +40,28 @@ const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromVariant(
- // TODO: set the SMP support based on variant.
- const bool smp = true;
- - // Look for variants that have divide support.
- - static const char* arm_variants_with_div[] = {
- - "cortex-a7", "cortex-a12", "cortex-a15", "cortex-a17", "cortex-a53", "cortex-a57",
- - "cortex-a53.a57", "cortex-m3", "cortex-m4", "cortex-r4", "cortex-r5",
- - "cyclone", "denver", "krait", "kryo", "swift" };
- + static const char* arm_variants_with_armv8a[] =
- + { "cortex-a53", "cortex-a57", "cortex-a35", "cortex-a72", "cortex-a53.a57", "cyclone", "denver", "kryo" };
- + bool has_armv8a =
- + FindVariantInArray(arm_variants_with_armv8a, arraysize(arm_variants_with_armv8a), variant);
- - bool has_div = FindVariantInArray(arm_variants_with_div, arraysize(arm_variants_with_div),
- - variant);
- + // SDIV is always available on ARMv8-A. Look for divide support in other variants.
- + static const char* non_armv8_variants_with_div[] = {
- + "cortex-a7", "cortex-a12", "cortex-a15", "cortex-a17", "krait", "swift" };
- - // Look for variants that have LPAE support.
- - static const char* arm_variants_with_lpae[] = {
- - "cortex-a7", "cortex-a15", "krait", "kryo", "denver", "cortex-a53", "cortex-a57", "cortex-a53.a57"
- - };
- - bool has_lpae = FindVariantInArray(arm_variants_with_lpae, arraysize(arm_variants_with_lpae),
- - variant);
- + bool has_div = has_armv8a || FindVariantInArray(non_armv8_variants_with_div,
- + arraysize(non_armv8_variants_with_div),
- + variant);
- - if (has_div == false && has_lpae == false) {
- + // ARMv8-A CPUs that support 32bit have atomic 64bit accesses.
- + // Look for other variants that have LPAE support. LPAE support implies atomic LDRD/STRD.
- + static const char* non_armv8_variants_with_lpae[] = { "cortex-a7", "cortex-a15", "krait" };
- + bool has_atomic_ldrd_strd =
- + has_armv8a || FindVariantInArray(non_armv8_variants_with_lpae,
- + arraysize(non_armv8_variants_with_lpae),
- + variant);
- +
- + if (has_div == false && has_atomic_ldrd_strd == false) {
- // Avoid unsupported variants.
- static const char* unsupported_arm_variants[] = {
- // ARM processors that aren't ARMv7 compatible aren't supported.
- @@ -97,37 +103,47 @@ const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromVariant(
- << ") using conservative defaults";
- }
- }
- - return new ArmInstructionSetFeatures(smp, has_div, has_lpae);
- +
- + return new ArmInstructionSetFeatures(smp, has_div, has_atomic_ldrd_strd, has_armv8a);
- }
- const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromBitmap(uint32_t bitmap) {
- bool smp = (bitmap & kSmpBitfield) != 0;
- bool has_div = (bitmap & kDivBitfield) != 0;
- bool has_atomic_ldrd_strd = (bitmap & kAtomicLdrdStrdBitfield) != 0;
- - return new ArmInstructionSetFeatures(smp, has_div, has_atomic_ldrd_strd);
- + bool has_armv8a = (bitmap & kARMv8A) != 0;
- + return new ArmInstructionSetFeatures(smp, has_div, has_atomic_ldrd_strd, has_armv8a);
- }
- const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromCppDefines() {
- const bool smp = true;
- -#if defined(__ARM_ARCH_EXT_IDIV__)
- +#if defined(__ARM_ARCH_8A__)
- + const bool has_armv8a = true;
- +#else
- + const bool has_armv8a = false;
- +#endif
- + // SDIV is always available on ARMv8-A.
- +#if defined(__ARM_ARCH_8A__) || defined(__ARM_ARCH_EXT_IDIV__)
- const bool has_div = true;
- #else
- const bool has_div = false;
- #endif
- -#if defined(__ARM_FEATURE_LPAE)
- - const bool has_lpae = true;
- +#if defined(__ARM_ARCH_8A__) || defined(__ARM_FEATURE_LPAE)
- + // ARMv8-A implies atomic 64bit accesses.
- + const bool has_atomic_ldrd_strd = true;
- #else
- - const bool has_lpae = false;
- + const bool has_atomic_ldrd_strd = false;
- #endif
- - return new ArmInstructionSetFeatures(smp, has_div, has_lpae);
- + return new ArmInstructionSetFeatures(smp, has_div, has_atomic_ldrd_strd, has_armv8a);
- }
- const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromCpuInfo() {
- // Look in /proc/cpuinfo for features we need. Only use this when we can guarantee that
- // the kernel puts the appropriate feature flags in here. Sometimes it doesn't.
- bool smp = false;
- - bool has_lpae = false;
- + bool has_atomic_ldrd_strd = false;
- bool has_div = false;
- + bool has_armv8a = false;
- std::ifstream in("/proc/cpuinfo");
- if (!in.fail()) {
- @@ -145,11 +161,20 @@ const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromCpuInfo() {
- has_div = true;
- }
- if (line.find("lpae") != std::string::npos) {
- - has_lpae = true;
- + has_atomic_ldrd_strd = true;
- }
- } else if (line.find("processor") != std::string::npos &&
- line.find(": 1") != std::string::npos) {
- smp = true;
- + } else if (line.find("architecture") != std::string::npos &&
- + line.find(": 8") != std::string::npos) {
- + LOG(INFO) << "found architecture ARMv8";
- + // Android is only run on A cores, so ARMv8 implies ARMv8-A.
- + has_armv8a = true;
- + // SDIV is always available on ARMv8-A.
- + has_div = true;
- + // ARMv8-A CPUs that support 32bit have atomic 64bit accesses.
- + has_atomic_ldrd_strd = true;
- }
- }
- }
- @@ -157,16 +182,25 @@ const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromCpuInfo() {
- } else {
- LOG(ERROR) << "Failed to open /proc/cpuinfo";
- }
- - return new ArmInstructionSetFeatures(smp, has_div, has_lpae);
- +
- + return new ArmInstructionSetFeatures(smp, has_div, has_atomic_ldrd_strd, has_armv8a);
- }
- const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromHwcap() {
- bool smp = sysconf(_SC_NPROCESSORS_CONF) > 1;
- bool has_div = false;
- - bool has_lpae = false;
- + bool has_atomic_ldrd_strd = false;
- + bool has_armv8a = false;
- #if defined(__ANDROID__) && defined(__arm__)
- +#if (__ARM_FP & 0x8)
- + has_armv8a = true;
- + // SDIV is always available on ARMv8-A.
- + has_div = true;
- + // ARMv8-A CPUs that support 32bit have atomic 64bit accesses.
- + has_atomic_ldrd_strd = true;
- +#elif defined(__arm__)
- uint64_t hwcaps = getauxval(AT_HWCAP);
- LOG(INFO) << "hwcaps=" << hwcaps;
- if ((hwcaps & HWCAP_IDIVT) != 0) {
- @@ -176,18 +210,19 @@ const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromHwcap() {
- has_div = true;
- }
- if ((hwcaps & HWCAP_LPAE) != 0) {
- - has_lpae = true;
- + has_atomic_ldrd_strd = true;
- }
- #endif
- +#endif
- - return new ArmInstructionSetFeatures(smp, has_div, has_lpae);
- + return new ArmInstructionSetFeatures(smp, has_div, has_atomic_ldrd_strd, has_armv8a);
- }
- // A signal handler called by a fault for an illegal instruction. We record the fact in r0
- // and then increment the PC in the signal context to return to the next instruction. We know the
- // instruction is an sdiv (4 bytes long).
- -static void bad_divide_inst_handle(int signo ATTRIBUTE_UNUSED, siginfo_t* si ATTRIBUTE_UNUSED,
- - void* data) {
- +static void bad_inst_handle(int signo ATTRIBUTE_UNUSED, siginfo_t* si ATTRIBUTE_UNUSED,
- + void* data) {
- #if defined(__arm__)
- struct ucontext *uc = (struct ucontext *)data;
- struct sigcontext *sc = &uc->uc_mcontext;
- @@ -201,18 +236,22 @@ static void bad_divide_inst_handle(int signo ATTRIBUTE_UNUSED, siginfo_t* si ATT
- const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromAssembly() {
- const bool smp = true;
- - // See if have a sdiv instruction. Register a signal handler and try to execute an sdiv
- - // instruction. If we get a SIGILL then it's not supported.
- + // See if SDIV and ARMv8-A instructions are available. Register a signal handler and
- + // try to execute an sdiv instruction. If we get a SIGILL then it's not supported.
- struct sigaction sa, osa;
- sa.sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;
- - sa.sa_sigaction = bad_divide_inst_handle;
- + sa.sa_sigaction = bad_inst_handle;
- sigaction(SIGILL, &sa, &osa);
- bool has_div = false;
- + bool has_armv8a = false;
- #if defined(__arm__)
- if (artCheckForArmSdivInstruction()) {
- has_div = true;
- }
- + if (artCheckForArmv8AInstructions()) {
- + has_armv8a = true;
- + }
- #endif
- // Restore the signal handler.
- @@ -225,7 +264,7 @@ const ArmInstructionSetFeatures* ArmInstructionSetFeatures::FromAssembly() {
- #else
- const bool has_lpae = false;
- #endif
- - return new ArmInstructionSetFeatures(smp, has_div, has_lpae);
- + return new ArmInstructionSetFeatures(smp, has_div, has_lpae, has_armv8a);
- }
- bool ArmInstructionSetFeatures::Equals(const InstructionSetFeatures* other) const {
- @@ -235,13 +274,15 @@ bool ArmInstructionSetFeatures::Equals(const InstructionSetFeatures* other) cons
- const ArmInstructionSetFeatures* other_as_arm = other->AsArmInstructionSetFeatures();
- return IsSmp() == other_as_arm->IsSmp() &&
- has_div_ == other_as_arm->has_div_ &&
- - has_atomic_ldrd_strd_ == other_as_arm->has_atomic_ldrd_strd_;
- + has_atomic_ldrd_strd_ == other_as_arm->has_atomic_ldrd_strd_ &&
- + has_armv8a_ == other_as_arm->has_armv8a_;
- }
- uint32_t ArmInstructionSetFeatures::AsBitmap() const {
- return (IsSmp() ? kSmpBitfield : 0) |
- (has_div_ ? kDivBitfield : 0) |
- - (has_atomic_ldrd_strd_ ? kAtomicLdrdStrdBitfield : 0);
- + (has_atomic_ldrd_strd_ ? kAtomicLdrdStrdBitfield : 0) |
- + (has_armv8a_ ? kARMv8A : 0);
- }
- std::string ArmInstructionSetFeatures::GetFeatureString() const {
- @@ -261,6 +302,11 @@ std::string ArmInstructionSetFeatures::GetFeatureString() const {
- } else {
- result += ",-atomic_ldrd_strd";
- }
- + if (has_armv8a_) {
- + result += ",armv8a";
- + } else {
- + result += ",-armv8a";
- + }
- return result;
- }
- @@ -268,6 +314,7 @@ const InstructionSetFeatures* ArmInstructionSetFeatures::AddFeaturesFromSplitStr
- const bool smp, const std::vector<std::string>& features, std::string* error_msg) const {
- bool has_atomic_ldrd_strd = has_atomic_ldrd_strd_;
- bool has_div = has_div_;
- + bool has_armv8a = has_armv8a_;
- for (auto i = features.begin(); i != features.end(); i++) {
- std::string feature = Trim(*i);
- if (feature == "div") {
- @@ -278,12 +325,16 @@ const InstructionSetFeatures* ArmInstructionSetFeatures::AddFeaturesFromSplitStr
- has_atomic_ldrd_strd = true;
- } else if (feature == "-atomic_ldrd_strd") {
- has_atomic_ldrd_strd = false;
- + } else if (feature == "armv8a") {
- + has_armv8a = true;
- + } else if (feature == "-armv8a") {
- + has_armv8a = false;
- } else {
- *error_msg = StringPrintf("Unknown instruction set feature: '%s'", feature.c_str());
- return nullptr;
- }
- }
- - return new ArmInstructionSetFeatures(smp, has_div, has_atomic_ldrd_strd);
- + return new ArmInstructionSetFeatures(smp, has_div, has_atomic_ldrd_strd, has_armv8a);
- }
- } // namespace art
- diff --git a/runtime/arch/arm/instruction_set_features_arm.h b/runtime/arch/arm/instruction_set_features_arm.h
- index 221bf1fbc..61f7d0b6a 100644
- --- a/runtime/arch/arm/instruction_set_features_arm.h
- +++ b/runtime/arch/arm/instruction_set_features_arm.h
- @@ -67,6 +67,11 @@ class ArmInstructionSetFeatures FINAL : public InstructionSetFeatures {
- return has_atomic_ldrd_strd_;
- }
- + // Are ARMv8-A instructions available?
- + bool HasARMv8AInstructions() const {
- + return has_armv8a_;
- + }
- +
- virtual ~ArmInstructionSetFeatures() {}
- protected:
- @@ -76,20 +81,28 @@ class ArmInstructionSetFeatures FINAL : public InstructionSetFeatures {
- std::string* error_msg) const OVERRIDE;
- private:
- - ArmInstructionSetFeatures(bool smp, bool has_div, bool has_atomic_ldrd_strd)
- + ArmInstructionSetFeatures(bool smp,
- + bool has_div,
- + bool has_atomic_ldrd_strd,
- + bool has_armv8a)
- : InstructionSetFeatures(smp),
- - has_div_(has_div), has_atomic_ldrd_strd_(has_atomic_ldrd_strd) {
- - }
- + has_div_(has_div),
- + has_atomic_ldrd_strd_(has_atomic_ldrd_strd),
- + has_armv8a_(has_armv8a) {}
- // Bitmap positions for encoding features as a bitmap.
- enum {
- - kSmpBitfield = 1,
- - kDivBitfield = 2,
- - kAtomicLdrdStrdBitfield = 4,
- + kSmpBitfield = 1 << 0,
- + kDivBitfield = 1 << 1,
- + kAtomicLdrdStrdBitfield = 1 << 2,
- + kARMv8A = 1 << 3
- };
- const bool has_div_;
- const bool has_atomic_ldrd_strd_;
- + // TODO: Eventually we may want a finer grain description, keeping track of the architecture
- + // version and variant. For now this is enough for our purpose.
- + const bool has_armv8a_;
- DISALLOW_COPY_AND_ASSIGN(ArmInstructionSetFeatures);
- };
- diff --git a/runtime/arch/arm/instruction_set_features_assembly_tests.S b/runtime/arch/arm/instruction_set_features_assembly_tests.S
- index c1086df0f..4178ef6f0 100644
- --- a/runtime/arch/arm/instruction_set_features_assembly_tests.S
- +++ b/runtime/arch/arm/instruction_set_features_assembly_tests.S
- @@ -17,22 +17,39 @@
- #include "asm_support_arm.S"
- .section .text
- -// This function is used to check for the CPU's support for the sdiv
- -// instruction at runtime. It will either return the value 1 or
- -// will cause an invalid instruction trap (SIGILL signal). The
- -// caller must arrange for the signal handler to set the r0
- -// register to 0 and move the pc forward by 4 bytes (to skip
- -// the invalid instruction).
- +// These functions are used to check for the CPU's support for the sdiv and
- +// ARMv8-A instructions at runtime. They will either return the value 1 or will
- +// cause an invalid instruction trap (SIGILL signal). The caller must arrange
- +// for the signal handler to set the r0 register to 0 and move the pc forward by
- +// 4 bytes (to skip the invalid instruction).
- +
- ENTRY artCheckForArmSdivInstruction
- mov r1,#1
- - // depending on the architecture, the assembler will not allow an
- + // Depending on the architecture, the assembler will not allow an
- // sdiv instruction, so we will have to output the bytes directly.
- - // sdiv r0,r1,r1 is two words: 0xfb91 0xf1f0. We need little endian.
- - .byte 0x91,0xfb,0xf1,0xf0
- + // The T32 encoding for sdiv r0,r1,r1 is two 16bit words: 0xfb91 0xf0f1, with little endianness.
- + .byte 0x91,0xfb
- + .byte 0xf1,0xf0
- - // if the divide worked, r0 will have the value #1 (result of sdiv).
- + // If the divide worked, r0 will have the value #1 (result of sdiv).
- // It will have 0 otherwise (set by the signal handler)
- // the value is just returned from this function.
- bx lr
- END artCheckForArmSdivInstruction
- +
- +ENTRY artCheckForArmv8AInstructions
- + // Depending on the architecture, the assembler will not allow a
- + // `vrint` instruction, so we will have to output the bytes directly.
- +
- + // Move `true` into thre result register. The signal handler will set it to 0
- + // if execution of the instruction below fails
- + mov r0,#1
- +
- + // The T32 encoding for vrinta.f32.f32 s0,s0 is two 16bit words: 0xfeb8,0x0a40, with little
- + // endianness.
- + .byte 0xb8,0xfe
- + .byte 0x40,0x0a
- +
- + bx lr
- +END artCheckForArmv8AInstructions
- bionic/.git
- diff --git a/libc/Android.mk b/libc/Android.mk
- index 693f0a2a6..edb4b5205 100644
- --- a/libc/Android.mk
- +++ b/libc/Android.mk
- @@ -1409,10 +1409,6 @@ LOCAL_ADDITIONAL_DEPENDENCIES := \
- $(LOCAL_PATH)/libc.mips.brillo.map \
- $(LOCAL_PATH)/libc.x86.brillo.map \
- -# Leave the symbols in the shared library so that stack unwinders can produce
- -# meaningful name resolution.
- -LOCAL_STRIP_MODULE := keep_symbols
- -
- # Do not pack libc.so relocations; see http://b/20645321 for details.
- LOCAL_PACK_MODULE_RELOCATIONS := false
- diff --git a/libc/arch-arm/cortex-a15/bionic/strlen.S b/libc/arch-arm/cortex-a15/bionic/strlen.S
- index 121d9aca6..4d4ba35f7 100644
- --- a/libc/arch-arm/cortex-a15/bionic/strlen.S
- +++ b/libc/arch-arm/cortex-a15/bionic/strlen.S
- @@ -1,91 +1,145 @@
- +/* Copyright (c) 2010-2011,2013 Linaro Limited
- + All rights reserved.
- +
- + Redistribution and use in source and binary forms, with or without
- + modification, are permitted provided that the following conditions
- + are met:
- +
- + * Redistributions of source code must retain the above copyright
- + notice, this list of conditions and the following disclaimer.
- +
- + * Redistributions in binary form must reproduce the above copyright
- + notice, this list of conditions and the following disclaimer in the
- + documentation and/or other materials provided with the distribution.
- +
- + * Neither the name of Linaro Limited nor the names of its
- + contributors may be used to endorse or promote products derived
- + from this software without specific prior written permission.
- +
- + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- + */
- +
- /*
- - * Copyright (c) 2011 Apple, Inc. All rights reserved.
- - *
- - * @APPLE_LICENSE_HEADER_START@
- - *
- - * This file contains Original Code and/or Modifications of Original Code
- - * as defined in and that are subject to the Apple Public Source License
- - * Version 2.0 (the 'License'). You may not use this file except in
- - * compliance with the License. Please obtain a copy of the License at
- - * http://www.opensource.apple.com/apsl/ and read it before using this
- - * file.
- - *
- - * The Original Code and all software distributed under the License are
- - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- - * Please see the License for the specific language governing rights and
- - * limitations under the License.
- - *
- - * @APPLE_LICENSE_HEADER_END@
- + Assumes:
- + ARMv6T2, AArch32
- +
- + Adapted to Bionic by Bernhard Rosenkränzer <bero@linaro.org>
- */
- #include <private/bionic_asm.h>
- -.syntax unified
- -.code 32
- -
- -#define addr r0
- -#define word r1
- -#define temp r2
- -#define mask r3
- -#define save ip
- -#define indx r0
- -
- -.macro IfWordDoesntContainNUL_SetZ
- -// In each word of the string, we check for NUL bytes via a saturating
- -// unsigned subtraction of each byte from 0x1. The result of this is
- -// non-zero if and only if the corresponding byte in the string is NUL.
- -// Simply using a TST instruction checks all four bytes for NULs in one
- -// go.
- - uqsub8 temp, mask, word
- - tst temp, temp
- -.endm
- -
- -.text
- -.align 4
- -.long 0x0 // padding
- -.long 0x01010101 // mask for use in finding NULs
- +#ifdef __ARMEB__
- +#define S2LO lsl
- +#define S2HI lsr
- +#else
- +#define S2LO lsr
- +#define S2HI lsl
- +#endif
- +
- + .text
- + .thumb
- + .syntax unified
- +
- +/* Parameters and result. */
- +#define srcin r0
- +#define result r0
- +
- +/* Internal variables. */
- +#define src r1
- +#define data1a r2
- +#define data1b r3
- +#define const_m1 r12
- +#define const_0 r4
- +#define tmp1 r4 /* Overlaps const_0 */
- +#define tmp2 r5
- +
- ENTRY(strlen)
- -// Establish stack frame, load mask that we will use to find NUL bytes,
- -// and set aside a copy of the pointer to the string.
- - push {r7,lr}
- - mov r7, sp
- - ldr mask, (strlen-4)
- - add save, addr, #4
- -
- -// Load the aligned word that contains the start of the string, then OR
- -// 0x01 into any bytes that preceed the start of the string to prevent
- -// false positives when we check for NUL bytes.
- - and temp, addr, #3
- - bic addr, addr, #3
- - lsl temp, temp, #3
- - ldr word, [addr], #4
- - rsb temp, temp, #32
- - orr word, word, mask, lsr temp
- -
- -// Check if the string ends in the first word. If so, don't load any
- -// more of the string; instead jump directly to the cleanup code.
- - IfWordDoesntContainNUL_SetZ
- - bne 1f
- -
- -.align 4
- -// Load one word of the string on each iteration, and check it for NUL
- -// bytes. If a NUL is found, fall through into the cleanup code.
- -0: ldr word, [addr], #4
- - IfWordDoesntContainNUL_SetZ
- - beq 0b
- -
- -// The last word that we loaded contained a NUL. Subtracting the saved
- -// pointer from the current pointer gives us the number of bytes from
- -// the start of the string to the word containing the NUL.
- -1: sub indx, addr, save
- -// To that we add the index of the first NUL byte in the word, computed
- -// using REV and CLZ followed by a shift.
- - rev temp, temp
- - clz temp, temp
- - add indx, indx, temp, lsr #3
- - pop {r7,pc}
- -
- -END(strlen)
- + .p2align 6
- + pld [srcin, #0]
- + strd r4, r5, [sp, #-8]!
- + bic src, srcin, #7
- + mvn const_m1, #0
- + ands tmp1, srcin, #7 /* (8 - bytes) to alignment. */
- + pld [src, #32]
- + bne.w .L_misaligned8
- + mov const_0, #0
- + mov result, #-8
- +.L_loop_aligned:
- + /* Bytes 0-7. */
- + ldrd data1a, data1b, [src]
- + pld [src, #64]
- + add result, result, #8
- +.L_start_realigned:
- + uadd8 data1a, data1a, const_m1 /* Saturating GE<0:3> set. */
- + sel data1a, const_0, const_m1 /* Select based on GE<0:3>. */
- + uadd8 data1b, data1b, const_m1
- + sel data1b, data1a, const_m1 /* Only used if d1a == 0. */
- + cbnz data1b, .L_null_found
- +
- + /* Bytes 8-15. */
- + ldrd data1a, data1b, [src, #8]
- + uadd8 data1a, data1a, const_m1 /* Saturating GE<0:3> set. */
- + add result, result, #8
- + sel data1a, const_0, const_m1 /* Select based on GE<0:3>. */
- + uadd8 data1b, data1b, const_m1
- + sel data1b, data1a, const_m1 /* Only used if d1a == 0. */
- + cbnz data1b, .L_null_found
- +
- + /* Bytes 16-23. */
- + ldrd data1a, data1b, [src, #16]
- + uadd8 data1a, data1a, const_m1 /* Saturating GE<0:3> set. */
- + add result, result, #8
- + sel data1a, const_0, const_m1 /* Select based on GE<0:3>. */
- + uadd8 data1b, data1b, const_m1
- + sel data1b, data1a, const_m1 /* Only used if d1a == 0. */
- + cbnz data1b, .L_null_found
- +
- + /* Bytes 24-31. */
- + ldrd data1a, data1b, [src, #24]
- + add src, src, #32
- + uadd8 data1a, data1a, const_m1 /* Saturating GE<0:3> set. */
- + add result, result, #8
- + sel data1a, const_0, const_m1 /* Select based on GE<0:3>. */
- + uadd8 data1b, data1b, const_m1
- + sel data1b, data1a, const_m1 /* Only used if d1a == 0. */
- + cmp data1b, #0
- + beq .L_loop_aligned
- +
- +.L_null_found:
- + cmp data1a, #0
- + itt eq
- + addeq result, result, #4
- + moveq data1a, data1b
- +#ifndef __ARMEB__
- + rev data1a, data1a
- +#endif
- + clz data1a, data1a
- + ldrd r4, r5, [sp], #8
- + add result, result, data1a, lsr #3 /* Bits -> Bytes. */
- + bx lr
- +
- +.L_misaligned8:
- + ldrd data1a, data1b, [src]
- + and tmp2, tmp1, #3
- + rsb result, tmp1, #0
- + lsl tmp2, tmp2, #3 /* Bytes -> bits. */
- + tst tmp1, #4
- + pld [src, #64]
- + S2HI tmp2, const_m1, tmp2
- + orn data1a, data1a, tmp2
- + itt ne
- + ornne data1b, data1b, tmp2
- + movne data1a, const_m1
- + mov const_0, #0
- + b .L_start_realigned
- +END(strlen)
- \ No newline at end of file
- diff --git a/linker/Android.mk b/linker/Android.mk
- index 3d7aacb2f..a8f82b4bf 100644
- --- a/linker/Android.mk
- +++ b/linker/Android.mk
- @@ -78,10 +78,6 @@ LOCAL_MODULE_STEM_32 := linker
- LOCAL_MODULE_STEM_64 := linker64
- LOCAL_MULTILIB := both
- -# Leave the symbols in the shared library so that stack unwinders can produce
- -# meaningful name resolution.
- -LOCAL_STRIP_MODULE := keep_symbols
- -
- # Insert an extra objcopy step to add prefix to symbols. This is needed to prevent gdb
- # looking up symbols in the linker by mistake.
- #
- build/.git
- diff --git a/core/Makefile b/core/Makefile
- index c089e38a6..d1727c102 100644
- --- a/core/Makefile
- +++ b/core/Makefile
- @@ -2015,9 +2015,9 @@ ifeq ($(build_ota_package),true)
- name := $(TARGET_PRODUCT)
- ifeq ($(TARGET_BUILD_TYPE),debug)
- name := $(name)_debug
- - # Assume non-release recoveries skip signature check
- - extra_ota_args := --no_signing
- endif
- +# Assume non-release recoveries skip signature check
- +extra_ota_args := --no_signing
- INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name)-$(ROM_VERSION).zip
- diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
- index 510aae52f..858bb4eca 100644
- --- a/core/combo/TARGET_linux-arm.mk
- +++ b/core/combo/TARGET_linux-arm.mk
- @@ -97,7 +97,6 @@ ifeq ($(FORCE_ARM_DEBUGGING),true)
- endif
- $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
- - -msoft-float \
- -ffunction-sections \
- -fdata-sections \
- -funwind-tables \
- diff --git a/core/main.mk b/core/main.mk
- index c19ab3d99..8efe39d09 100644
- --- a/core/main.mk
- +++ b/core/main.mk
- @@ -371,13 +371,13 @@ endif
- ## user/userdebug ##
- -user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT))
- +user_variant := userdebug
- enable_target_debugging := true
- tags_to_install :=
- ifneq (,$(user_variant))
- # Target is secure in user builds.
- ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1
- - ADDITIONAL_DEFAULT_PROPERTIES += security.perf_harden=1
- + ADDITIONAL_DEFAULT_PROPERTIES += security.perf_harden=0
- ifeq ($(user_variant),user)
- ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1
- build/soong/.git
- diff --git a/cc/arm_device.go b/cc/arm_device.go
- index 7212c4f..dcb8b90 100644
- --- a/cc/arm_device.go
- +++ b/cc/arm_device.go
- @@ -29,7 +29,6 @@ var (
- armCflags = []string{
- "-fno-exceptions", // from build/core/combo/select.mk
- "-Wno-multichar", // from build/core/combo/select.mk
- - "-msoft-float",
- "-ffunction-sections",
- "-fdata-sections",
- "-funwind-tables",
- device/oneplus/oneplus3/.git
- diff --git a/BoardConfig.mk b/BoardConfig.mk
- index c82a8b65..021b8f28 100644
- --- a/BoardConfig.mk
- +++ b/BoardConfig.mk
- @@ -56,7 +56,7 @@ BOARD_USERDATAIMAGE_PARTITION_SIZE := 57436708864
- BOARD_FLASH_BLOCK_SIZE := 262144
- # Kernel
- -BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom ehci-hcd.park=3 lpm_levels.sleep_disabled=1 cma=32M@0-0xffffffff
- +BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom ehci-hcd.park=3 lpm_levels.sleep_disabled=1 cma=32M@0-0xffffffff androidboot.selinux=permissive
- BOARD_KERNEL_BASE := 0x80000000
- BOARD_KERNEL_PAGESIZE := 4096
- BOARD_RAMDISK_OFFSET := 0x01000000
- external/f2fs-tools/.git
- diff --git a/Android.mk b/Android.mk
- index 0dca860..b8b4661 100644
- --- a/Android.mk
- +++ b/Android.mk
- @@ -6,12 +6,6 @@ ifneq (,$(filter linux darwin,$(HOST_OS)))
- # The versions depend on $(LOCAL_PATH)/VERSION
- common_CFLAGS := -DF2FS_MAJOR_VERSION=1 -DF2FS_MINOR_VERSION=8 -DF2FS_TOOLS_VERSION=\"1.8.0\" -DF2FS_TOOLS_DATE=\"2017-02-03\"
- -# fsck.f2fs forces a full file system scan whenever /proc/version changes
- -# Perform this check only when it's a release build
- -ifneq ($(TARGET_BUILD_VARIANT), user)
- - common_CFLAGS += -DDISABLE_VERSION_CHECK
- -endif
- -
- # external/e2fsprogs/lib is needed for uuid/uuid.h
- common_C_INCLUDES := $(LOCAL_PATH)/include external/e2fsprogs/lib/ $(LOCAL_PATH)/mkfs
- external/zlib/.git
- diff --git a/src/deflate.c b/src/deflate.c
- index 1b0bea7..db54bec 100644
- --- a/src/deflate.c
- +++ b/src/deflate.c
- @@ -282,7 +282,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
- #ifdef FASTEST
- if (level != 0) level = 1;
- #else
- - if (level == Z_DEFAULT_COMPRESSION) level = 6;
- + if (level == Z_DEFAULT_COMPRESSION) level = 3;
- #endif
- if (windowBits < 0) { /* suppress zlib wrapper */
- @@ -579,7 +579,7 @@ int ZEXPORT deflateParams(strm, level, strategy)
- #ifdef FASTEST
- if (level != 0) level = 1;
- #else
- - if (level == Z_DEFAULT_COMPRESSION) level = 6;
- + if (level == Z_DEFAULT_COMPRESSION) level = 3;
- #endif
- if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
- return Z_STREAM_ERROR;
- system/core/.git
- diff --git a/adb/Android.mk b/adb/Android.mk
- index 8f56d744e..d0dc19fd5 100644
- --- a/adb/Android.mk
- +++ b/adb/Android.mk
- @@ -327,12 +327,9 @@ LOCAL_CFLAGS := \
- -D_GNU_SOURCE \
- -Wno-deprecated-declarations \
- -LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=$(if $(filter userdebug eng,$(TARGET_BUILD_VARIANT)),1,0)
- -
- -ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
- +LOCAL_CFLAGS += -DALLOW_ADBD_NO_AUTH=1
- LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
- LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1
- -endif
- LOCAL_MODULE := adbd
- diff --git a/adb/daemon/main.cpp b/adb/daemon/main.cpp
- index 4721e2fbb..c857020e7 100644
- --- a/adb/daemon/main.cpp
- +++ b/adb/daemon/main.cpp
- @@ -44,66 +44,11 @@
- static const char* root_seclabel = nullptr;
- static void drop_capabilities_bounding_set_if_needed() {
- -#ifdef ALLOW_ADBD_ROOT
- - char value[PROPERTY_VALUE_MAX];
- - property_get("ro.debuggable", value, "");
- - if (strcmp(value, "1") == 0) {
- - return;
- - }
- -#endif
- - for (int i = 0; prctl(PR_CAPBSET_READ, i, 0, 0, 0) >= 0; i++) {
- - if (i == CAP_SETUID || i == CAP_SETGID) {
- - // CAP_SETUID CAP_SETGID needed by /system/bin/run-as
- - continue;
- - }
- -
- - if (prctl(PR_CAPBSET_DROP, i, 0, 0, 0) == -1) {
- - PLOG(FATAL) << "Could not drop capabilities";
- - }
- - }
- + return;
- }
- static bool should_drop_privileges() {
- -#if defined(ALLOW_ADBD_ROOT)
- - char value[PROPERTY_VALUE_MAX];
- -
- - // The properties that affect `adb root` and `adb unroot` are ro.secure and
- - // ro.debuggable. In this context the names don't make the expected behavior
- - // particularly obvious.
- - //
- - // ro.debuggable:
- - // Allowed to become root, but not necessarily the default. Set to 1 on
- - // eng and userdebug builds.
- - //
- - // ro.secure:
- - // Drop privileges by default. Set to 1 on userdebug and user builds.
- - property_get("ro.secure", value, "1");
- - bool ro_secure = (strcmp(value, "1") == 0);
- -
- - property_get("ro.debuggable", value, "");
- - bool ro_debuggable = (strcmp(value, "1") == 0);
- -
- - // Drop privileges if ro.secure is set...
- - bool drop = ro_secure;
- -
- - property_get("service.adb.root", value, "");
- - bool adb_root = (strcmp(value, "1") == 0);
- - bool adb_unroot = (strcmp(value, "0") == 0);
- -
- - // ... except "adb root" lets you keep privileges in a debuggable build.
- - if (ro_debuggable && adb_root) {
- - drop = false;
- - }
- -
- - // ... and "adb unroot" lets you explicitly drop privileges.
- - if (adb_unroot) {
- - drop = true;
- - }
- -
- - return drop;
- -#else
- - return true; // "adb root" not allowed, always drop privileges.
- -#endif // ALLOW_ADBD_ROOT
- + return false;
- }
- static void drop_privileges(int server_port) {
- @@ -143,11 +88,6 @@ static void drop_privileges(int server_port) {
- // minijail_enter() will abort if any priv-dropping step fails.
- minijail_enter(jail.get());
- - if (root_seclabel != nullptr) {
- - if (selinux_android_setcon(root_seclabel) < 0) {
- - LOG(FATAL) << "Could not set SELinux context";
- - }
- - }
- std::string error;
- std::string local_name =
- android::base::StringPrintf("tcp:%d", server_port);
- @@ -170,9 +110,7 @@ int adbd_main(int server_port) {
- // descriptor will always be open.
- adbd_cloexec_auth_socket();
- - if (ALLOW_ADBD_NO_AUTH && property_get_bool("ro.adb.secure", 0) == 0) {
- - auth_required = false;
- - }
- + auth_required = false;
- adbd_auth_init();
- diff --git a/init/Android.mk b/init/Android.mk
- index e00589ca8..e099b6ecf 100644
- --- a/init/Android.mk
- +++ b/init/Android.mk
- @@ -4,12 +4,7 @@ LOCAL_PATH:= $(call my-dir)
- # --
- -ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
- init_options += -DALLOW_LOCAL_PROP_OVERRIDE=1 -DALLOW_PERMISSIVE_SELINUX=1
- -else
- -init_options += -DALLOW_LOCAL_PROP_OVERRIDE=0 -DALLOW_PERMISSIVE_SELINUX=0
- -endif
- -
- init_options += -DLOG_UEVENTS=0
- ifneq ($(TARGET_INIT_COLDBOOT_TIMEOUT),)
- vendor/pa/.git
- diff --git a/products/oneplus3/pa.dependencies b/products/oneplus3/pa.dependencies
- index 5991fe8..fb7f5d3 100644
- --- a/products/oneplus3/pa.dependencies
- +++ b/products/oneplus3/pa.dependencies
- @@ -1,20 +1,38 @@
- [
- {
- + "remote": "github-ssh",
- + "repository": "TheCrazyLex/op3-device",
- + "target_path": "device/oneplus/oneplus3",
- + "revision": "nougat-mr1"
- + },
- + {
- + "remote": "github-ssh",
- + "repository": "TheCrazyLex/kernel_oneplus_msm8996",
- + "target_path": "kernel/oneplus/msm8996",
- + "revision": "nougat-mr1"
- + },
- + {
- + "remote": "github-ssh",
- + "repository": "TheCrazyLex/vendor_oneplus-b",
- + "target_path": "vendor/oneplus",
- + "revision": "nougat-mr2"
- + },
- + {
- "remote": "github",
- "repository": "AOSPA/android_hardware_qcom_audio",
- "target_path": "hardware/qcom/audio",
- - "revision": "nougat-mr1-8996"
- + "revision": "nougat-mr2-8996"
- },
- {
- "remote": "github",
- "repository": "AOSPA/android_hardware_qcom_display",
- "target_path": "hardware/qcom/display",
- - "revision": "nougat-mr1-8996"
- + "revision": "nougat-mr2-8996"
- },
- {
- "remote": "github",
- "repository": "AOSPA/android_hardware_qcom_media",
- "target_path": "hardware/qcom/media",
- - "revision": "nougat-mr1-8996"
- + "revision": "nougat-mr2-8996"
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement