--- nono/m680x0/m68030mmu.h 2026/04/29 17:04:28 1.1 +++ nono/m680x0/m68030mmu.h 2026/04/29 17:04:54 1.1.1.4 @@ -1,6 +1,7 @@ // // nono -// Copyright (C) 2017 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #pragma once @@ -51,10 +52,10 @@ class m68030TT static const uint32 FCBASE_MASK = 0x00000070; static const uint32 FCMASK_MASK = 0x00000007; - uint32 e = 0; // 00008000 イネーブル - uint32 ci = 0; // 00000400 キャッシュ禁止 - uint64 base = 0; // ベース - uint64 mask = 0; // マスク + uint32 e {}; // 00008000 イネーブル + uint32 ci {}; // 00000400 キャッシュ禁止 + uint64 base {}; // ベース + uint64 mask {}; // マスク // アクセスがこの TT と一致するか調べる。 bool Match(uint64 ssw_laddr); @@ -71,11 +72,11 @@ class m68030TC static const uint32 TC_FCL = 0x01000000; // レジスタの各フィールド - uint32 e = 0; // TC_E の位置 - uint32 sre = 0; // TC_SRE の位置 - uint32 fcl = 0; // TC_FCL の位置 - uint ps = 0; - uint is = 0; + uint32 e {}; // TC_E の位置 + uint32 sre {}; // TC_SRE の位置 + uint32 fcl {}; // TC_FCL の位置 + uint ps {}; + uint is {}; union { uint tix[4] {}; struct { @@ -88,8 +89,8 @@ class m68030TC int shift[4] {}; // TIA-TID の各部分のシフト量 uint32 mask[4] {}; // TIA-TID の各部分のマスク - uint32 lmask = 0; // TIA-TID 全体のマスク - uint32 pgmask = 0; // PS 部分のマスク + uint32 lmask {}; // TIA-TID 全体のマスク + uint32 pgmask {}; // PS 部分のマスク public: void Set(uint32); @@ -170,13 +171,13 @@ struct m68030ATCLine }; // ATC のテーブル -class m68030ATCTable +class m68030ATCTable final { public: static const int LINES = 22; m68030ATCTable(); - virtual ~m68030ATCTable() { } + ~m68030ATCTable() { } #if !defined(ATC_SINGLE) // 空きエントリを取得。 @@ -221,7 +222,7 @@ class m68030ATCTable // ATC_SINGLE ならリストの先頭。 // !ATC_SINGLE なら注目エントリ。 - m68030ATCLine *head = NULL; + m68030ATCLine *head {}; #if !defined(ATC_SINGLE) // LRU 用の更新カウンタ @@ -232,12 +233,12 @@ class m68030ATCTable }; // ATC (Address Translation Cache) -class m68030ATC +class m68030ATC final { - friend class MPUATC; + friend class MPU680x0Device; public: m68030ATC(m68kcpu *); - virtual ~m68030ATC() { } + ~m68030ATC() { } // エントリをサーチ&更新 const m68030ATCLine& fill_fetch(); @@ -261,7 +262,7 @@ class m68030ATC m68030ATCTable tables[1] {}; #endif - m68kcpu *cpu = NULL; + m68kcpu *cpu {}; }; extern bool m68030_mmu_translate_fetch(m68kcpu *cpu);