File:  [Isaki's NoNo m68k/m88k emulator] / nono / vm / virtio_entropy.h
Revision 1.1.1.3 (vendor branch): download - view: text, annotated - select for diffs
Wed Apr 29 17:06:01 2026 UTC (2 months, 3 weeks ago) by root
Branches: MAIN, Isaki
CVS tags: v027, HEAD
nono 1.7.0

//
// nono
// Copyright (C) 2024 nono project
// Licensed under nono-license.txt
//

//
// VirtIO エントロピーデバイス
//

#pragma once

#include "virtio_base.h"
#include <random>

class VirtIOEntropyDevice : public VirtIODevice
{
	using inherited = VirtIODevice;

 public:
	explicit VirtIOEntropyDevice(uint slot_);
	~VirtIOEntropyDevice() override;

 private:
	DECLARE_MONITOR_SCREEN(MonitorScreen);

	// ディスクリプタを一つ処理する。
	void ProcessDesc(VirtIOReq&) override;

	// デフォルトコンストラクタは実質 /dev/urandom だが
	// こいつにはこれ以上安全な指定方法がない。
	std::random_device rnd {};
};

unix.superglobalmegacorp.com

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