Skip to content

Commit c927297

Browse files
committed
🚀 Add NXGetLocalArchInfo
1 parent 02f2707 commit c927297

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,20 @@ static inline uint64_t WDTGetSysCtl64BySpecifier(char* specifier) {
359359
360360
### CPU Type
361361
362-
我们知道 iPhone 使用的处理器架构都是 ARM 的,而 ARM 又分为 ARMV7、ARMV7S 和 ARM64等。而想要获取设备具体的处理器架构则需要使用 `NXGetLocalArchInfo()` 函数。
362+
我们知道 iPhone 使用的处理器架构都是 ARM 的,而 ARM 又分为 ARMV7、ARMV7S 和 ARM64等。而想要获取设备具体的处理器架构则需要使用 `NXGetLocalArchInfo()` 函数。这个函数的返回值是 `NXArchInfo` 结构体类型,如下:
363+
364+
``` c
365+
typedef struct {
366+
const char *name;
367+
cpu_type_t cputype;
368+
cpu_subtype_t cpusubtype;
369+
enum NXByteOrder byteorder;
370+
const char *description;
371+
} NXArchInfo;
372+
```
373+
374+
`NXArchInfo` 结构体成员变量中就包含我们需要的信息:`cputype``cputype`,这两个变量类型的定义在 `mach/machine.h` 头文件中给出,本质上都是 `int` 类型 `typedef` 得到的。
375+
363376

364377
``` objective-c
365378
+ (NSInteger)cpuType {

0 commit comments

Comments
 (0)