]> git.saurik.com Git - apple/xnu.git/blobdiff - libsyscall/wrappers/__get_cpu_capabilities.s
xnu-7195.81.3.tar.gz
[apple/xnu.git] / libsyscall / wrappers / __get_cpu_capabilities.s
index de177986ac276d069a6800cc7113c69152005d16..199ea8ad9436497b26c43ae7529ede0ea8b3b21e 100644 (file)
@@ -47,6 +47,31 @@ __get_cpu_capabilities:
        movl    _COMM_PAGE_CPU_CAPABILITIES64+4, %edx
        ret
 
+#elif defined(__arm__)
+
+       .text
+       .align 2
+       .globl __get_cpu_capabilities
+__get_cpu_capabilities:
+       mov     r0, #(_COMM_PAGE_CPU_CAPABILITIES & 0x000000ff)
+       orr     r0, r0, #(_COMM_PAGE_CPU_CAPABILITIES & 0x0000ff00)
+       orr     r0, r0, #(_COMM_PAGE_CPU_CAPABILITIES & 0x00ff0000)
+       orr     r0, r0, #(_COMM_PAGE_CPU_CAPABILITIES & 0xff000000)
+       ldr     r0, [r0]
+       bx      lr
+
+#elif defined(__arm64__)
+
+       .text
+       .align 2
+       .globl __get_cpu_capabilities
+__get_cpu_capabilities:
+       ldr x0, Lcommpage_cc_addr
+       ldr     x0, [x0]
+       ret
+Lcommpage_cc_addr:
+.quad _COMM_PAGE_CPU_CAPABILITIES64
+
 #else
 #error Unsupported architecture
 #endif