| # Copyright 2022 syzkaller project authors. All rights reserved. |
| # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. |
| |
| # See https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/vdso/system.fidl |
| |
| include <zircon/syscalls.h> |
| include <zircon/types.h> |
| |
| zx_system_get_dcache_line_size(size ptr[out, int32]) |
| zx_system_get_num_cpus(count ptr[out, int32]) |
| zx_system_get_version_string(version ptr[out, zx_system_string_view]) |
| zx_system_get_page_size(size ptr[out, int32]) |
| zx_system_get_physmem(physmem ptr[out, int64]) |
| zx_system_get_features(kind flags[system_feature_opt], features ptr[out, int32]) |
| zx_system_get_event(root_job zx_job, kind flags[system_event_opt], event ptr[out, zx_handle]) |
| zx_system_set_performance_info(res zx_resource, topic flags[system_performance_opt], info ptr[in, array[int8]], count int64) |
| zx_system_get_performance_info(res zx_resource, topic flags[system_performance_opt], count int64, info ptr[out, array[int8]], output_count ptr[out, int64]) |
| # Soft-reboots the system with a new kernel and bootimage; does not return (disabled for now, probably never viable?) |
| zx_system_mexec(res zx_resource, kernel_vmo zx_vmo, bootimage_vmo zx_vmo) (disabled) |
| zx_system_mexec_payload_get(res zx_resource, buffer ptr[out, array[int8, 0:16384]]) |
| # TODO: add variants with specific flags and their corresponding valid args |
| zx_system_powerctl(res zx_resource, cmd flags[system_powerctl_opt], arg ptr[in, zx_system_powerctl_arg]) |
| |
| # System version string is a 40-char git hash with "git-" prefix and possible <=20-char suffix. |
| zx_system_string_view { |
| c_str ptr[out, array[int8, 44:64]] |
| length len[c_str, int8] |
| } |
| |
| zx_system_acpi_transition_s_state { |
| target_s_state int8 |
| sleep_type_a int8 |
| sleep_type_b int8 |
| } |
| |
| zx_system_acpi_transition_s_state_wrapper { |
| acpi zx_system_acpi_transition_s_state |
| padding array[int8, 9] |
| } |
| |
| zx_system_x86_power_limit { |
| power_limit int32 |
| time_window int32 |
| clamp int8 |
| enable int8 |
| } |
| |
| zx_system_powerctl_arg [ |
| acpi zx_system_acpi_transition_s_state_wrapper |
| x86 zx_system_x86_power_limit |
| ] |
| |
| system_feature_opt = ZX_FEATURE_KIND_CPU, ZX_FEATURE_KIND_HW_BREAKPOINT_COUNT, ZX_FEATURE_KIND_HW_WATCHPOINT_COUNT, ZX_FEATURE_KIND_ADDRESS_TAGGING, ZX_FEATURE_KIND_VM |
| system_event_opt = ZX_SYSTEM_EVENT_OUT_OF_MEMORY, ZX_SYSTEM_EVENT_MEMORY_PRESSURE_CRITICAL, ZX_SYSTEM_EVENT_MEMORY_PRESSURE_WARNING, ZX_SYSTEM_EVENT_MEMORY_PRESSURE_NORMAL, ZX_SYSTEM_EVENT_IMMINENT_OUT_OF_MEMORY |
| system_performance_opt = ZX_CPU_PERF_SCALE, ZX_CPU_DEFAULT_PERF_SCALE |
| system_powerctl_opt = ZX_SYSTEM_POWERCTL_ENABLE_ALL_CPUS, ZX_SYSTEM_POWERCTL_DISABLE_ALL_CPUS_BUT_PRIMARY, ZX_SYSTEM_POWERCTL_ACPI_TRANSITION_S_STATE, ZX_SYSTEM_POWERCTL_X86_SET_PKG_PL1, ZX_SYSTEM_POWERCTL_REBOOT, ZX_SYSTEM_POWERCTL_REBOOT_BOOTLOADER, ZX_SYSTEM_POWERCTL_REBOOT_RECOVERY, ZX_SYSTEM_POWERCTL_SHUTDOWN, ZX_SYSTEM_POWERCTL_ACK_KERNEL_INITIATED_REBOOT |