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

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: 
                      7: #pragma once
                      8: 
                      9: #include "device.h"
                     10: #include <mutex>
                     11: 
1.1.1.5 ! root       12: class ZRAMDevice : public IODevice
1.1       root       13: {
1.1.1.3   root       14:        using inherited = IODevice;
1.1       root       15:  public:
                     16:        ZRAMDevice();
1.1.1.4   root       17:        virtual ~ZRAMDevice() override;
1.1       root       18: 
1.1.1.3   root       19:        uint64 Read8(uint32 addr) override;
                     20:        uint64 Read16(uint32 addr) override;
                     21:        uint64 Read32(uint32 addr) override;
                     22:        uint64 Write8(uint32 addr, uint32 data) override;
                     23:        uint64 Write16(uint32 addr, uint32 data) override;
                     24:        uint64 Write32(uint32 addr, uint32 data) override;
                     25:        uint64 Peek8(uint32 addr) override;
1.1       root       26: 
                     27:  private:
1.1.1.2   root       28:        // アドレスデコーダ
                     29:        uint64 Decoder(uint32 addr) const;
                     30: 
                     31:        std::unique_ptr<uint8[]> ram {};
1.1       root       32: 
                     33:        // アクセス競合を防ぐロック。
                     34:        // Lance は裏スレッドからアクセスにくるので。
                     35:        std::mutex mtx {};
                     36: };
                     37: 
1.1.1.2   root       38: extern std::unique_ptr<ZRAMDevice> gZRAM;

unix.superglobalmegacorp.com

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