| dnl Run "m4 genfs_contexts" to test |
| dnl # $1 = pci prefix |
| dnl # $2 = pci ID start (hex) |
| dnl # $3 = virtio ID start (decimal) |
| pushdef(`cf_pci_block_device', `dnl |
| genfscon sysfs $1/0000:00:eval($2 + 0, 16, 2).0/virtio`'eval($3 + 0)`'/block u:object_r:sysfs_devices_block:s0 # vda |
| genfscon sysfs $1/0000:00:eval($2 + 1, 16, 2).0/virtio`'eval($3 + 1)`'/block u:object_r:sysfs_devices_block:s0 # vdb |
| genfscon sysfs $1/0000:00:eval($2 + 2, 16, 2).0/virtio`'eval($3 + 2)`'/block u:object_r:sysfs_devices_block:s0 # vdc |
| genfscon sysfs $1/0000:00:eval($2 + 3, 16, 2).0/virtio`'eval($3 + 3)`'/ndbus0 u:object_r:sysfs_devices_block:s0 # pmem0 |
| dnl')dnl |
| dnl |
| dnl # $1 = pci prefix |
| dnl # $2 = pci ID start (hex) |
| pushdef(`cf_pci_gpu_device', `dnl |
| genfscon sysfs $1/0000:00:eval($2, 16, 2).0/device u:object_r:sysfs_gpu:s0 |
| genfscon sysfs $1/0000:00:eval($2, 16, 2).0/subsystem_device u:object_r:sysfs_gpu:s0 |
| genfscon sysfs $1/0000:00:eval($2, 16, 2).0/subsystem_vendor u:object_r:sysfs_gpu:s0 |
| genfscon sysfs $1/0000:00:eval($2, 16, 2).0/uevent u:object_r:sysfs_gpu:s0 |
| genfscon sysfs $1/0000:00:eval($2, 16, 2).0/vendor u:object_r:sysfs_gpu:s0 |
| dnl')dnl |
| dnl |
| dnl # $1 = rtc prefix |
| dnl # $2 = rtc number (decimal) |
| dnl # $3 = rtc wakeup offset (decimal) |
| pushdef(`cf_rtc_wakeup_alarmtimer', `dnl |
| genfscon sysfs $1/wakeup u:object_r:sysfs_wakeup:s0 |
| genfscon sysfs $1/rtc/rtc$2/wakeup`'eval($3 + 1)`' u:object_r:sysfs_wakeup:s0 # <= 5.5 |
| genfscon sysfs $1/rtc/rtc$2/alarmtimer.0.auto/wakeup u:object_r:sysfs_wakeup:s0 # >5.5 |
| dnl')dnl |
| dnl |
| # crosvm (x86) |
| cf_pci_block_device(/devices/pci0000:00, 0x6, 5) |
| cf_pci_gpu_device(/devices/pci0000:00, 0x11) |
| ## find /sys/devices/platform/* -type d -name 'rtc[0-9]' | sed 's,/rtc[0-9],,' |
| genfscon sysfs /devices/platform/rtc_cmos/rtc u:object_r:sysfs_rtc:s0 |
| ## find /sys/devices/platform/* -type d -name 'wakeup[0-9]' |
| genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/wakeup u:object_r:sysfs_wakeup:s0 |
| cf_rtc_wakeup_alarmtimer(/devices/platform/rtc_cmos, 0, 1) |
| ## currently disabled |
| #genfscon sysfs /devices/LNXSYSTM:00/GFSH0001:00/wakeup u:object_r:sysfs_wakeup:s0 |
| |
| # crosvm (arm64) |
| cf_pci_block_device(/devices/platform/10000.pci, 0x6, 4) |
| cf_pci_gpu_device(/devices/platform/10000.pci/pci0000:00, 0x11) |
| ## find /sys/devices/platform/* -type d -name 'rtc[0-9]' | sed 's,/rtc[0-9],,' |
| genfscon sysfs /devices/platform/2000.rtc/rtc u:object_r:sysfs_rtc:s0 |
| ## find /sys/devices/platform/* -type d -name 'wakeup[0-9]' |
| ## arm64 2000.rtc on crosvm does not currently expose a wakeup node |
| |
| # qemu (x86) |
| cf_pci_block_device(/devices/pci0000:00, 0x7, 5) |
| ## find /sys/devices/platform/* -type d -name 'rtc[0-9]' | sed 's,/rtc[0-9],,' |
| genfscon sysfs /devices/pnp0/00:04/rtc u:object_r:sysfs_rtc:s0 |
| ## find /sys/devices/platform/* -type d -name 'wakeup[0-9][0-9]' |
| cf_rtc_wakeup_alarmtimer(/devices/pnp0/00:04, 0, 19) |
| |
| # qemu (arm64) |
| cf_pci_block_device(/devices/platform/4010000000.pcie/pci0000:00, 0x6, 4) |
| cf_pci_gpu_device(/devices/platform/4010000000.pcie/pci0000:00, 0x10) |
| ## find /sys/devices/platform/* -type d -name 'rtc[0-9]' | sed 's,/rtc[0-9],,' |
| genfscon sysfs /devices/platform/9010000.pl031/rtc u:object_r:sysfs_rtc:s0 |
| ## find /sys/devices/platform/* -type d -name 'wakeup[0-9]' |
| cf_rtc_wakeup_alarmtimer(/devices/platform/9010000.pl031, 0, 0) |
| |
| # qemu (arm) |
| cf_pci_block_device(/devices/platform/3f000000.pcie/pci0000:00, 0x6, 4) |
| cf_pci_gpu_device(/devices/platform/3f000000.pcie/pci0000:00, 0xf) |
| |
| # common on all platforms / vm managers |
| genfscon sysfs /devices/platform/rtc-test.0/rtc u:object_r:sysfs_rtc:s0 |
| genfscon sysfs /devices/platform/rtc-test.1/rtc u:object_r:sysfs_rtc:s0 |
| genfscon sysfs /devices/platform/rtc-test.2/rtc u:object_r:sysfs_rtc:s0 |
| genfscon sysfs /bus/iio/devices u:object_r:sysfs_iio_devices:s0 |
| cf_rtc_wakeup_alarmtimer(/devices/platform/rtc-test.1, 2, 0) |
| genfscon sysfs /devices/platform/rtc-test.2/wakeup u:object_r:sysfs_wakeup:s0 |
| dnl |
| popdef(`cf_pci_block_device')dnl |
| popdef(`cf_pci_gpu_device')dnl |
| popdef(`cf_rtc_wakeup_alarmtimer')dnl |