Differences From Artifact [9e9c77f12d]:
- File src/OFSystemInfo.m — part of check-in [74fea18d17] at 2023-04-22 19:52:57 on branch trunk — Add OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES define (user: js, size: 22911) [annotate] [blame] [check-ins using]
To Artifact [6c16836067]:
- File
src/OFSystemInfo.m
— part of check-in
[b7a4e61b88]
at
2023-04-22 20:22:08
on branch trunk
— Rename x86_64 to AMD64
It's just a less awkward name and also what the BSDs use. (user: js, size: 22905) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
114 115 116 117 118 119 120 | extern NSSearchPathEnumerationState NSStartSearchPathEnumeration( NSSearchPathDirectory, NSSearchPathDomainMask); extern NSSearchPathEnumerationState NSGetNextSearchPathEnumeration( NSSearchPathEnumerationState, char *); #endif | | | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | extern NSSearchPathEnumerationState NSStartSearchPathEnumeration( NSSearchPathDirectory, NSSearchPathDomainMask); extern NSSearchPathEnumerationState NSGetNextSearchPathEnumeration( NSSearchPathEnumerationState, char *); #endif #if defined(OF_AMD64) || defined(OF_X86) struct X86Regs { uint32_t eax, ebx, ecx, edx; }; #endif #ifdef OF_SYSTEM_INFO_HAS_NETWORK_INTERFACES OFConstantString *const OFNetworkInterfaceAddresses = |
︙ | ︙ | |||
286 287 288 289 290 291 292 | { if (R_SUCCEEDED(fsdevMountTemporaryStorage("tmpfs"))) tmpFSIRI = [[OFIRI alloc] initFileIRIWithPath: @"tmpfs:/" isDirectory: true]; } #endif | | | | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | { if (R_SUCCEEDED(fsdevMountTemporaryStorage("tmpfs"))) tmpFSIRI = [[OFIRI alloc] initFileIRIWithPath: @"tmpfs:/" isDirectory: true]; } #endif #if defined(OF_AMD64) || defined(OF_X86) static OF_INLINE struct X86Regs OF_CONST_FUNC x86CPUID(uint32_t eax, uint32_t ecx) { struct X86Regs regs; # if defined(OF_AMD64) && defined(__GNUC__) __asm__ ( "cpuid" : "=a"(regs.eax), "=b"(regs.ebx), "=c"(regs.ecx), "=d"(regs.edx) : "a"(eax), "c"(ecx) ); # elif defined(OF_X86) && defined(__GNUC__) /* |
︙ | ︙ | |||
651 652 653 654 655 656 657 | #else return nil; #endif } + (OFString *)CPUVendor { | | | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | #else return nil; #endif } + (OFString *)CPUVendor { #if (defined(OF_AMD64) || defined(OF_X86)) && defined(__GNUC__) struct X86Regs regs = x86CPUID(0, 0); uint32_t buffer[3]; if (regs.eax == 0) return nil; buffer[0] = regs.ebx; |
︙ | ︙ | |||
674 675 676 677 678 679 680 | #else return nil; #endif } + (OFString *)CPUModel { | | | 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | #else return nil; #endif } + (OFString *)CPUModel { #if (defined(OF_AMD64) || defined(OF_X86)) && defined(__GNUC__) struct X86Regs regs = x86CPUID(0x80000000, 0); uint32_t buffer[12]; size_t i; if (regs.eax < 0x80000004) return nil; |
︙ | ︙ | |||
733 734 735 736 737 738 739 | else return @"68000"; #else return nil; #endif } | | | 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 | else return @"68000"; #else return nil; #endif } #if defined(OF_AMD64) || defined(OF_X86) + (bool)supportsMMX { return (x86CPUID(1, 0).edx & (1u << 23)); } + (bool)supports3DNow { |
︙ | ︙ |