From 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:41:38 +0200 Subject: Adding upstream version 1.0.1. Signed-off-by: Daniel Baumann --- .../215 source set realistic example/devices/meson.build | 3 +++ .../devices/virtio-mmio.cc | 16 ++++++++++++++++ .../devices/virtio-pci.cc | 16 ++++++++++++++++ .../215 source set realistic example/devices/virtio.cc | 6 ++++++ .../215 source set realistic example/devices/virtio.h | 10 ++++++++++ 5 files changed, 51 insertions(+) create mode 100644 test cases/common/215 source set realistic example/devices/meson.build create mode 100644 test cases/common/215 source set realistic example/devices/virtio-mmio.cc create mode 100644 test cases/common/215 source set realistic example/devices/virtio-pci.cc create mode 100644 test cases/common/215 source set realistic example/devices/virtio.cc create mode 100644 test cases/common/215 source set realistic example/devices/virtio.h (limited to 'test cases/common/215 source set realistic example/devices') diff --git a/test cases/common/215 source set realistic example/devices/meson.build b/test cases/common/215 source set realistic example/devices/meson.build new file mode 100644 index 0000000..68ee68e --- /dev/null +++ b/test cases/common/215 source set realistic example/devices/meson.build @@ -0,0 +1,3 @@ +specific.add(when: 'CONFIG_VIRTIO', if_true: files('virtio.cc')) +common.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci.cc')) +common.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mmio.cc')) diff --git a/test cases/common/215 source set realistic example/devices/virtio-mmio.cc b/test cases/common/215 source set realistic example/devices/virtio-mmio.cc new file mode 100644 index 0000000..5dab97e --- /dev/null +++ b/test cases/common/215 source set realistic example/devices/virtio-mmio.cc @@ -0,0 +1,16 @@ +#include +#include "common.h" +#include "virtio.h" + +struct VirtioMMIODevice: VirtioDevice { + void say_hello(); +}; + +void VirtioMMIODevice::say_hello() +{ + some_virtio_thing(); + std::cout << ANSI_START << "virtio-mmio is available" + << ANSI_END << std::endl; +} + +static VirtioMMIODevice virtio_mmio; diff --git a/test cases/common/215 source set realistic example/devices/virtio-pci.cc b/test cases/common/215 source set realistic example/devices/virtio-pci.cc new file mode 100644 index 0000000..7df7a82 --- /dev/null +++ b/test cases/common/215 source set realistic example/devices/virtio-pci.cc @@ -0,0 +1,16 @@ +#include +#include "common.h" +#include "virtio.h" + +struct VirtioPCIDevice: VirtioDevice { + void say_hello(); +}; + +void VirtioPCIDevice::say_hello() +{ + some_virtio_thing(); + std::cout << ANSI_START << "virtio-pci is available" + << ANSI_END << std::endl; +} + +static VirtioPCIDevice virtio_pci; diff --git a/test cases/common/215 source set realistic example/devices/virtio.cc b/test cases/common/215 source set realistic example/devices/virtio.cc new file mode 100644 index 0000000..fc51275 --- /dev/null +++ b/test cases/common/215 source set realistic example/devices/virtio.cc @@ -0,0 +1,6 @@ +#include +#include "common.h" +#include "virtio.h" + +void VirtioDevice::some_virtio_thing() { +} diff --git a/test cases/common/215 source set realistic example/devices/virtio.h b/test cases/common/215 source set realistic example/devices/virtio.h new file mode 100644 index 0000000..a157731 --- /dev/null +++ b/test cases/common/215 source set realistic example/devices/virtio.h @@ -0,0 +1,10 @@ +#ifndef VIRTIO_H +#define VIRTIO_H 1 + +#include "common.h" + +struct VirtioDevice: Device { + void some_virtio_thing(); +}; + +#endif -- cgit v1.2.3