Annotation of nono/vm/sysctlr.h, revision 1.1.1.5

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: // LUNA88K のシステムコントローラのような何か
                      8: 
                      9: #pragma once
                     10: 
                     11: #include "device.h"
1.1.1.3   root       12: #include "interrupt.h"
1.1       root       13: 
1.1.1.4   root       14: class SysCtlrDevice : public InterruptDevice
1.1       root       15: {
1.1.1.3   root       16:        using inherited = InterruptDevice;
                     17: 
                     18:        // 割り込みマップ                            76543210
                     19:        static const uint32 IntmapNMI           = 0x80000000;
                     20:        static const uint32 IntmapSysClk        = 0x08000000;
                     21:        static const uint32 IntmapSIO           = 0x00800000;
                     22:        static const uint32 IntmapLance         = 0x00080000;
                     23:        static const uint32 IntmapSPC           = 0x00008000;
                     24:        static const uint32 IntmapSoft3         = 0x00000080;
                     25:        static const uint32 IntmapSoft2         = 0x00000040;
                     26:        static const uint32 IntmapSoft1         = 0x00000020;
                     27:        static const uint32 IntmapSoft0         = 0x00000010;
                     28: 
1.1       root       29:  public:
                     30:        SysCtlrDevice();
1.1.1.3   root       31:        virtual ~SysCtlrDevice() override;
                     32: 
                     33:        void ResetHard() override;
1.1       root       34: 
                     35:        uint64 Read32(uint32 addr) override;
                     36:        uint64 Write32(uint32 addr, uint32 data) override;
                     37:        uint64 Peek8(uint32 addr) override;
                     38: 
1.1.1.3   root       39:        // InterruptDevice インタフェース
                     40:        int InterruptAcknowledge(int lv) override;
                     41: 
1.1       root       42:  private:
1.1.1.3   root       43:        // デバイスから Intmap 値を引く
1.1.1.5 ! root       44:        uint32 GetIntmap(Device *source) const override;
1.1.1.3   root       45: 
                     46:        // 割り込み状態を更新
1.1.1.5 ! root       47:        void ChangeInterrupt() override;
1.1.1.3   root       48: 
                     49:        // マスク設定レジスタの書き込み値から内部用マスクを作成
                     50:        static uint32 MakeIntMask(uint32 data, int n);
                     51: 
1.1.1.4   root       52:        DECLARE_MONITOR_CALLBACK(MonitorUpdate);
                     53: 
1.1.1.3   root       54:        // CPU ごとのパラメータ
                     55:        struct {
                     56:                // 割り込みマスク (設定値)
                     57:                // 書き込み時の値をそのまま保持しておくので bit31-26 のみ有効。他は %0。
                     58:                uint32 maskval;
                     59: 
                     60:                // 内部用 intmap に対する割り込みマスク
                     61:                uint32 intmask;
                     62: 
                     63:                // 現在の最高位の割り込みレベル
                     64:                int ipl;
                     65:        } cpu[4] {};
1.1.1.4   root       66: 
                     67:        Monitor monitor { this };
1.1       root       68: };
                     69: 
1.1.1.3   root       70: // グローバルインスタンスはここではなく gInterrupt を使用する
                     71: // (LUNA88K ではこれがメインの割り込みコントローラなので)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.