| ... | @@ -53,10 +53,11 @@ const SparcCpuinfoImpl = struct { | ... | @@ -53,10 +53,11 @@ const SparcCpuinfoImpl = struct { |
| 53 | // At the moment we only support 64bit SPARC systems. | 53 | // At the moment we only support 64bit SPARC systems. |
| 54 | assert(self.is_64bit); | 54 | assert(self.is_64bit); |
| 55 | | 55 | |
| | 56 | const model = self.model orelse Target.Cpu.Model.generic(arch); |
| 56 | return Target.Cpu{ | 57 | return Target.Cpu{ |
| 57 | .arch = arch, | 58 | .arch = arch, |
| 58 | .model = self.model orelse Target.Cpu.Model.generic(arch), | 59 | .model = model, |
| 59 | .features = Target.Cpu.Feature.Set.empty, | 60 | .features = model.features, |
| 60 | }; | 61 | }; |
| 61 | } | 62 | } |
| 62 | }; | 63 | }; |
| ... | @@ -75,6 +76,7 @@ test "cpuinfo: SPARC" { | ... | @@ -75,6 +76,7 @@ test "cpuinfo: SPARC" { |
| 75 | | 76 | |
| 76 | const r = SparcCpuinfoParser.parse(.sparcv9, fbs.reader()) catch unreachable; | 77 | const r = SparcCpuinfoParser.parse(.sparcv9, fbs.reader()) catch unreachable; |
| 77 | testing.expectEqual(&Target.sparc.cpu.niagara2, r.?.model); | 78 | testing.expectEqual(&Target.sparc.cpu.niagara2, r.?.model); |
| | 79 | testing.expect(Target.sparc.cpu.niagara2.features.eql(r.?.features)); |
| 78 | } | 80 | } |
| 79 | | 81 | |
| 80 | // The generic implementation of a /proc/cpuinfo parser. | 82 | // The generic implementation of a /proc/cpuinfo parser. |