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

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2022 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: //
                      8: // メッセージ
                      9: //
                     10: 
                     11: #pragma once
                     12: 
                     13: #include "device.h"
                     14: 
                     15: class MessageID
                     16: {
                     17:  public:
                     18:        enum {
                     19:                NONE = 0,
                     20: 
                     21:                RESET,
                     22:                POWEROFF_EXIT,
                     23:                POWEROFF_RESTART,
1.1.1.2 ! root       24:                POWER_BUTTON,
1.1       root       25: 
                     26:                SCSIDEV_LOAD_0,
                     27:                SCSIDEV_LOAD_1,
                     28:                SCSIDEV_LOAD_2,
                     29:                SCSIDEV_LOAD_3,
                     30:                SCSIDEV_LOAD_4,
                     31:                SCSIDEV_LOAD_5,
                     32:                SCSIDEV_LOAD_6,
                     33:                SCSIDEV_LOAD_7,
                     34:                SCSIDEV_UNLOAD_0,
                     35:                SCSIDEV_UNLOAD_1,
                     36:                SCSIDEV_UNLOAD_2,
                     37:                SCSIDEV_UNLOAD_3,
                     38:                SCSIDEV_UNLOAD_4,
                     39:                SCSIDEV_UNLOAD_5,
                     40:                SCSIDEV_UNLOAD_6,
                     41:                SCSIDEV_UNLOAD_7,
                     42: 
1.1.1.2 ! root       43:                FDD_LOAD_0,
        !            44:                FDD_LOAD_1,
        !            45:                FDD_LOAD_2,
        !            46:                FDD_LOAD_3,
        !            47:                FDD_UNLOAD_0,
        !            48:                FDD_UNLOAD_1,
        !            49:                FDD_UNLOAD_2,
        !            50:                FDD_UNLOAD_3,
        !            51: 
1.1       root       52:                HOSTCOM_RX,
                     53:                HOSTNET_RX,
                     54: 
                     55:                KEY_INPUT,
                     56: 
                     57:                NMI,
                     58: 
                     59:                SCHEDULER_SYNCMODE,
                     60: 
                     61:                MPU_TRACE,
                     62: 
                     63:                MAX,
                     64:        };
                     65: 
                     66:  public:
                     67:        MessageID() {
                     68:                id = NONE;
                     69:        }
                     70:        MessageID(int id_) {
                     71:                id = id_;
                     72:        }
                     73: 
                     74:        MessageID& operator=(int id_) {
                     75:                id = id_;
                     76:                return *this;
                     77:        }
                     78:        operator int() const {
                     79:                return id;
                     80:        }
                     81: 
                     82:        static MessageID SCSIDEV_LOAD(int n) {
                     83:                return MessageID(SCSIDEV_LOAD_0 + n);
                     84:        }
                     85:        static MessageID SCSIDEV_UNLOAD(int n) {
                     86:                return MessageID(SCSIDEV_UNLOAD_0 + n);
                     87:        }
                     88: 
1.1.1.2 ! root       89:        static MessageID FDD_LOAD(int n) {
        !            90:                return MessageID(FDD_LOAD_0 + n);
        !            91:        }
        !            92:        static MessageID FDD_UNLOAD(int n) {
        !            93:                return MessageID(FDD_UNLOAD_0 + n);
        !            94:        }
        !            95: 
1.1       root       96:  private:
                     97:        int id;
                     98: };
                     99: 
                    100: using MessageCallback_t = void (Device::*)(MessageID, uint32);
                    101: #define ToMessageCallback(f) static_cast<MessageCallback_t>(f)

unix.superglobalmegacorp.com

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