Annotation of nono/vm/sysclk.h, revision 1.1.1.8

1.1       root        1: //
                      2: // nono
1.1.1.3   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
1.1.1.8 ! root        7: //
        !             8: // LUNA システムクロック
        !             9: //
        !            10: 
1.1       root       11: #pragma once
                     12: 
1.1.1.8 ! root       13: #include "event.h"
1.1.1.7   root       14: #include "monitor.h"
1.1       root       15: 
1.1.1.7   root       16: class SysClkDevice : public IODevice
1.1       root       17: {
1.1.1.3   root       18:        using inherited = IODevice;
1.1       root       19:  public:
                     20:        SysClkDevice();
1.1.1.5   root       21:        virtual ~SysClkDevice() override;
1.1       root       22: 
1.1.1.3   root       23:        bool Init() override;
1.1.1.8 ! root       24:        void ResetHard(bool poweron) override;
1.1       root       25: 
1.1.1.2   root       26:  protected:
                     27:        // BusIO インタフェース
                     28:        static const uint32 NPORT = 1;
1.1.1.6   root       29:        uint64 Read(uint32 offset);
                     30:        uint64 Write(uint32 offset, uint32 data);
                     31:        uint64 Peek(uint32 offset);
1.1       root       32: 
                     33:  private:
                     34:        // イベントコールバック
1.1.1.4   root       35:        void Callback(Event& ev);
1.1.1.7   root       36: 
                     37:        DECLARE_MONITOR_CALLBACK(MonitorUpdate);
1.1       root       38: 
1.1.1.2   root       39:        // 割り込み状態をレジスタイメージにして返す
                     40:        uint8 GetInt() const;
                     41: 
1.1       root       42:        // システムクロック割り込み有りなら true。
1.1.1.4   root       43:        bool sysint {};
1.1       root       44: 
                     45:        // 割り込みイベント
1.1.1.7   root       46:        Event event { this };
                     47: 
                     48:        // 本来のイベント間隔。機種によって異なる。
                     49:        uint period {};
                     50: 
                     51:        // システムクロックが刻んでいる時刻
                     52:        uint64 stime {};
                     53: 
                     54:        // システムクロックを実時間に同期する場合 true
                     55:        bool sync_rt {};
                     56: 
                     57:        Monitor monitor { this };
1.1       root       58: };
1.1.1.5   root       59: 
1.1.1.8 ! root       60: extern SysClkDevice *gSysClk;

unix.superglobalmegacorp.com

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