From cfda0824dea7aa00a622618401d7b644461527cc Mon Sep 17 00:00:00 2001 From: p-x9 <50244599+p-x9@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:38:40 +0900 Subject: [PATCH] Add cpu family for M4 --- Sources/CPUInfo/Model/CPUFamily.swift | 5 +++++ Sources/CPUInfoC/include/cpu_family.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Sources/CPUInfo/Model/CPUFamily.swift b/Sources/CPUInfo/Model/CPUFamily.swift index 222c603..dc3231d 100644 --- a/Sources/CPUInfo/Model/CPUFamily.swift +++ b/Sources/CPUInfo/Model/CPUFamily.swift @@ -87,6 +87,8 @@ public enum CPUFamily { case arm_coll /// CPUFAMILY_ARM_LOBOS case arm_lobos + /// CPUFAMILY_ARM_DONAN + case arm_donan } extension CPUFamily: RawRepresentable { @@ -132,6 +134,7 @@ extension CPUFamily: RawRepresentable { case RawValue(CPUFAMILY_ARM_PALMA): self = .arm_palma case RawValue(CPUFAMILY_ARM_COLL): self = .arm_coll case RawValue(CPUFAMILY_ARM_LOBOS): self = .arm_lobos + case RawValue(CPUFAMILY_ARM_DONAN): self = .arm_donan default: return nil } } @@ -175,6 +178,7 @@ extension CPUFamily: RawRepresentable { case .arm_palma: RawValue(CPUFAMILY_ARM_PALMA) case .arm_coll: RawValue(CPUFAMILY_ARM_COLL) case .arm_lobos: RawValue(CPUFAMILY_ARM_LOBOS) + case .arm_donan: RawValue(CPUFAMILY_ARM_DONAN) } } } @@ -220,6 +224,7 @@ extension CPUFamily: CustomStringConvertible { case .arm_palma: "CPUFAMILY_ARM_PALMA" case .arm_coll: "CPUFAMILY_ARM_COLL" case .arm_lobos: "CPUFAMILY_ARM_LOBOS" + case .arm_donan: "CPUFAMILY_ARM_DONAN" } } } diff --git a/Sources/CPUInfoC/include/cpu_family.h b/Sources/CPUInfoC/include/cpu_family.h index cdf7d13..769ded1 100644 --- a/Sources/CPUInfoC/include/cpu_family.h +++ b/Sources/CPUInfoC/include/cpu_family.h @@ -23,4 +23,8 @@ #define CPUFAMILY_ARM_LOBOS 0x5f4dea93 #endif +#ifndef CPUFAMILY_ARM_DONAN +#define CPUFAMILY_ARM_DONAN 0x6f5129ac +#endif + #endif /* cpu_family_h */