Annotation of nono/vm/goldfish_pic.h, revision 1.1.1.2

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2024 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: //
                      8: // Goldfish 割り込みコントローラ
                      9: //
                     10: 
                     11: #pragma once
                     12: 
                     13: #include "interrupt.h"
                     14: 
                     15: class GFPICDevice : public InterruptDevice
                     16: {
                     17:        using inherited = InterruptDevice;
                     18:        friend class Virt68kInterrupt;
                     19: 
1.1.1.2 ! root       20:        static const uint32 STATUS              = 0x00U >> 2;
        !            21:        static const uint32 PENDING             = 0x04U >> 2;   // was NUMBER
        !            22:        static const uint32 CLEAR_ALL   = 0x08U >> 2;   // was DISABLE_ALL
        !            23:        static const uint32 DISABLE             = 0x0cU >> 2;
        !            24:        static const uint32 ENABLE              = 0x10U >> 2;
1.1       root       25: 
                     26:  public:
1.1.1.2 ! root       27:        explicit GFPICDevice(uint id_);
1.1       root       28:        ~GFPICDevice() override;
                     29: 
                     30:        bool Init() override;
                     31:        void ResetHard(bool poweron) override;
                     32: 
                     33:        busdata InterruptAcknowledge(int lv) override;
                     34: 
                     35:        // IRQ の登録。子デバイスが呼ぶ。irq は 1-32。
                     36:        void RegistIRQ(int irq, const char *name, Device *source);
                     37: 
                     38:        // Virt68kInterrupt の下請け
                     39:        void MonitorUpdateSummary(TextScreen& screen, int x, int y);
                     40:        int MonitorUpdateDetail(TextScreen& screen, int y, int lv);
                     41: 
                     42:  protected:
1.1.1.2 ! root       43:        // BusIO インタフェース
        !            44:        static const uint32 NPORT = 0x1000 >> 2;
        !            45:        busdata ReadPort(uint32 offset);
        !            46:        busdata WritePort(uint32 offset, uint32 data);
        !            47:        busdata PeekPort(uint32 offset);
        !            48: 
        !            49:  private:
        !            50:        uint32 GetSTATUS() const;
        !            51:        uint32 GetPENDING() const;
        !            52: 
1.1       root       53:        void ChangeInterrupt() override;
                     54: 
                     55:        InterruptDevice *interrupt {};
                     56: };
                     57: 
                     58: static inline GFPICDevice *GetGFPICDevice(int id_) {
                     59:        return Object::GetObject<GFPICDevice>(OBJ_GFPIC(id_));
                     60: }

unix.superglobalmegacorp.com

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