use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};
pub const MAGMA_API_VERSION: u32 = 3;
pub const MAGMA_VENDOR_ID_MALI: u32 = 5045;
pub const MAGMA_VENDOR_ID_INTEL: u32 = 32902;
pub type magma_query_t = u64;
pub type magma_status_t = i32;
pub type magma_cache_operation_t = u32;
pub type magma_cache_policy_t = u32;
pub type magma_format_t = u32;
pub type magma_format_modifier_t = u64;
pub type magma_colorspace_t = u32;
pub type magma_coherency_domain_t = u32;
pub type magma_buffer_range_op_t = u32;
pub type magma_bool_t = u8;
pub type magma_device_t = u64;
pub type magma_buffer_t = u64;
pub type magma_semaphore_t = u64;
pub type magma_perf_count_pool_t = u64;
pub type magma_connection_t = u64;
pub type magma_sysmem_connection_t = u64;
pub type magma_handle_t = u32;
pub type magma_buffer_id_t = u64;
pub type magma_semaphore_id_t = u64;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct magma_poll_item {
pub __bindgen_anon_1: magma_poll_item__bindgen_ty_1,
pub type_: u32,
pub condition: u32,
pub result: u32,
pub unused: u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union magma_poll_item__bindgen_ty_1 {
pub semaphore: magma_semaphore_t,
pub handle: magma_handle_t,
}
impl Default for magma_poll_item__bindgen_ty_1 {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
impl Default for magma_poll_item {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type magma_poll_item_t = magma_poll_item;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_exec_resource {
pub buffer_id: magma_buffer_id_t,
pub offset: u64,
pub length: u64,
}
pub type magma_exec_resource_t = magma_exec_resource;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_exec_command_buffer {
pub resource_index: u32,
pub unused: u32,
pub start_offset: u64,
}
pub type magma_exec_command_buffer_t = magma_exec_command_buffer;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct magma_command_descriptor {
pub resource_count: u32,
pub command_buffer_count: u32,
pub wait_semaphore_count: u32,
pub signal_semaphore_count: u32,
pub resources: *mut magma_exec_resource,
pub command_buffers: *mut magma_exec_command_buffer,
pub semaphore_ids: *mut u64,
pub flags: u64,
}
impl Default for magma_command_descriptor {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type magma_command_descriptor_t = magma_command_descriptor;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct magma_inline_command_buffer {
pub data: *mut ::std::os::raw::c_void,
pub size: u64,
pub semaphore_ids: *mut u64,
pub semaphore_count: u32,
pub __bindgen_padding_0: [u8; 4usize],
}
impl Default for magma_inline_command_buffer {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type magma_inline_command_buffer_t = magma_inline_command_buffer;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_total_time_query_result {
pub gpu_time_ns: u64,
pub monotonic_time_ns: u64,
}
pub type magma_total_time_query_result_t = magma_total_time_query_result;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_buffer_offset {
pub buffer_id: u64,
pub offset: u64,
pub length: u64,
}
pub type magma_buffer_offset_t = magma_buffer_offset;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_buffer_info {
pub committed_byte_count: u64,
pub size: u64,
}
pub type magma_buffer_info_t = magma_buffer_info;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_image_create_info {
pub drm_format: u64,
pub drm_format_modifiers: [u64; 16usize],
pub width: u32,
pub height: u32,
pub flags: u64,
}
pub type magma_image_create_info_t = magma_image_create_info;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct magma_image_info {
pub plane_strides: [u64; 4usize],
pub plane_offsets: [u32; 4usize],
pub drm_format_modifier: u64,
pub coherency_domain: u32,
pub unused: u32,
}
pub type magma_image_info_t = magma_image_info;
extern "C" {
#[doc = "\n \\brief Imports and takes ownership of a channel to a device. Takes ownership of |device_channel|\n on both success and failure.\n \\param device_channel A channel connecting to a gpu class device.\n \\param device_out Returned device.\n"]
pub fn magma_device_import(
device_channel: magma_handle_t,
device_out: *mut magma_device_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Releases a handle to a device\n \\param device An open device.\n"]
pub fn magma_device_release(device: magma_device_t);
}
extern "C" {
#[doc = "\n \\brief Performs a query synchronously. On MAGMA_STATUS_OK, a given query |id| will return either\n a buffer in |result_buffer_out|, or a value in |result_out|. A NULL pointer may be\n provided for whichever result parameter is not needed.\n \\param device An open device.\n \\param id A vendor-specific ID.\n \\param result_buffer_out Handle to the returned buffer.\n \\param result_out Pointer to a uint64 result.\n"]
pub fn magma_device_query(
device: magma_device_t,
id: u64,
result_buffer_out: *mut magma_handle_t,
result_out: *mut u64,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Opens a connection to a device.\n \\param device An open device\n \\param connection_out Returned connection.\n"]
pub fn magma_device_create_connection(
device: magma_device_t,
connection_out: *mut magma_connection_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Releases the given connection.\n \\param connection An open connection.\n"]
pub fn magma_connection_release(connection: magma_connection_t);
}
extern "C" {
#[doc = "\n \\brief If a system driver error occurs, the connection will be closed, and this interface will\n eventually return the error. This interface does not flush messages that may be pending\n (see magma_connection_flush).\n \\param connection An open connection.\n"]
pub fn magma_connection_get_error(connection: magma_connection_t) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Creates a context on the given connection.\n \\param connection An open connection.\n \\param context_id_out The returned context id.\n"]
pub fn magma_connection_create_context(
connection: magma_connection_t,
context_id_out: *mut u32,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Releases the context associated with the given id.\n \\param connection An open connection.\n \\param context_id A valid context id.\n"]
pub fn magma_connection_release_context(connection: magma_connection_t, context_id: u32);
}
extern "C" {
#[doc = "\n \\brief Creates a memory buffer of at least the given size.\n \\param connection An open connection.\n \\param size Requested buffer size.\n \\param size_out The returned buffer's actual size.\n \\param buffer_out The returned buffer.\n \\param id_out The buffer id of the buffer.\n"]
pub fn magma_connection_create_buffer(
connection: magma_connection_t,
size: u64,
size_out: *mut u64,
buffer_out: *mut magma_buffer_t,
id_out: *mut magma_buffer_id_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Releases the given memory buffer.\n \\param connection An open connection.\n \\param buffer A valid buffer.\n"]
pub fn magma_connection_release_buffer(connection: magma_connection_t, buffer: magma_buffer_t);
}
extern "C" {
#[doc = "\n \\brief Imports and takes ownership of the buffer referred to by the given handle. Takes\n ownership of |buffer_handle| on both success and failure.\n \\param connection An open connection.\n \\param buffer_handle A valid handle.\n \\param size_out The size of the buffer in bytes.\n \\param buffer_out The returned buffer.\n \\param id_out The buffer id of the buffer.\n"]
pub fn magma_connection_import_buffer(
connection: magma_connection_t,
buffer_handle: magma_handle_t,
size_out: *mut u64,
buffer_out: *mut magma_buffer_t,
id_out: *mut magma_buffer_id_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Creates a semaphore.\n \\param connection An open connection.\n \\param semaphore_out The returned semaphore.\n \\param id_out The id of the semaphore.\n"]
pub fn magma_connection_create_semaphore(
connection: magma_connection_t,
semaphore_out: *mut magma_semaphore_t,
id_out: *mut magma_semaphore_id_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Releases the given semaphore.\n \\param connection An open connection.\n \\param semaphore A valid semaphore.\n"]
pub fn magma_connection_release_semaphore(
connection: magma_connection_t,
semaphore: magma_semaphore_t,
);
}
extern "C" {
#[doc = "\n \\brief Imports and takes ownership of the semaphore referred to by the given handle. Takes\n ownership of |semaphore_handle| on both success and failure.\n \\param connection An open connection.\n \\param semaphore_handle A valid semaphore handle.\n \\param flags Pass MAGMA_IMPORT_SEMAPHORE_ONESHOT to prevent auto-reset after wait.\n \\param semaphore_out The returned semaphore.\n \\param id_out The id of the semaphore.\n"]
pub fn magma_connection_import_semaphore2(
connection: magma_connection_t,
semaphore_handle: magma_handle_t,
flags: u64,
semaphore_out: *mut magma_semaphore_t,
id_out: *mut magma_semaphore_id_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Perform an operation on a range of a buffer\n \\param connection An open connection.\n \\param buffer A valid buffer.\n \\param options Options for the operation.\n \\param start_offset Byte offset into the buffer.\n \\param length Length (in bytes) of the region to operate on.\n"]
pub fn magma_connection_perform_buffer_op(
connection: magma_connection_t,
buffer: magma_buffer_t,
options: u32,
start_offset: u64,
length: u64,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Maps a buffer range onto the hardware in the connection's address space at the given\n address. Depending on the MSD this may automatically commit and populate that range.\n \\param connection An open connection.\n \\param hw_va Destination virtual address for the mapping.\n \\param buffer A valid buffer.\n \\param offset Offset into the buffer.\n \\param length Length in bytes of the range to map.\n \\param map_flags A valid MAGMA_MAP_FLAGS value.\n"]
pub fn magma_connection_map_buffer(
connection: magma_connection_t,
hw_va: u64,
buffer: magma_buffer_t,
offset: u64,
length: u64,
map_flags: u64,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Releases the mapping at the given hardware address.\n \\param connection An open connection.\n \\param hw_va A hardware virtual address associated with an existing mapping of the given buffer.\n \\param buffer A valid buffer.\n"]
pub fn magma_connection_unmap_buffer(
connection: magma_connection_t,
hw_va: u64,
buffer: magma_buffer_t,
);
}
extern "C" {
#[doc = "\n \\brief Submits command buffers for execution on the hardware.\n \\param connection An open connection.\n \\param context_id A valid context id.\n \\param descriptor A pointer to the command descriptor.\n"]
pub fn magma_connection_execute_command(
connection: magma_connection_t,
context_id: u32,
descriptor: *mut magma_command_descriptor_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Submits a series of commands for execution on the hardware without using a command\n buffer.\n \\param connection An open connection.\n \\param context_id A valid context ID.\n \\param command_count The number of commands in the provided buffer.\n \\param command_buffers An array of command_count magma_inline_command_buffer structs.\n"]
pub fn magma_connection_execute_immediate_commands(
connection: magma_connection_t,
context_id: u32,
command_count: u64,
command_buffers: *mut magma_inline_command_buffer_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Incurs a round-trip to the system driver, used to ensure all previous messages have been\n observed, but not necessarily completed. If a system driver error occurs, the connection\n will be closed, and this interface will return the error.\n \\param connection An open connection.\n"]
pub fn magma_connection_flush(connection: magma_connection_t) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Returns a handle that can be waited on to determine when the connection has data in the\n notification channel. This channel has the same lifetime as the connection and must not\n be closed by the client.\n \\param connection An open connection.\n"]
pub fn magma_connection_get_notification_channel_handle(
connection: magma_connection_t,
) -> magma_handle_t;
}
extern "C" {
#[doc = "\n \\brief Reads a notification from the channel into the given buffer. Message sizes may vary\n depending on the MSD. If the buffer provided is too small for the message,\n MAGMA_STATUS_INVALID_ARGS will be returned and the size of message will be returned in\n the buffer_size_out parameter.\n \\param connection An open connection.\n \\param buffer Buffer into which to read notification data.\n \\param buffer_size Size of the given buffer.\n \\param buffer_size_out Returned size of the notification data written to the buffer, or 0 if\n there are no messages pending.\n \\param more_data_out True if there is more notification data waiting.\n"]
pub fn magma_connection_read_notification_channel(
connection: magma_connection_t,
buffer: *mut ::std::os::raw::c_void,
buffer_size: u64,
buffer_size_out: *mut u64,
more_data_out: *mut magma_bool_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Cleans, and optionally invalidates, the cache for the region of memory specified by the\n given buffer, offset, and size, and write the contents to ram.\n \\param buffer A valid buffer.\n \\param offset An offset into the buffer. Must be less than or equal to the buffer's size.\n \\param size Size of region to be cleaned. Offset + size must be less than or equal to the\n buffer's size.\n \\param operation One of MAGMA_CACHE_OPERATION_CLEAN or MAGMA_CACHE_OPERATION_CLEAN_INVALIDATE.\n"]
pub fn magma_buffer_clean_cache(
buffer: magma_buffer_t,
offset: u64,
size: u64,
operation: magma_cache_operation_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Configures the cache for the given buffer.\n \\param buffer A valid buffer.\n \\param policy One of MAGMA_CACHE_POLICY_[CACHED|WRITE_COMBINING|UNCACHED].\n"]
pub fn magma_buffer_set_cache_policy(
buffer: magma_buffer_t,
policy: magma_cache_policy_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Queries the cache policy for a buffer.\n \\param buffer A valid buffer.\n \\param cache_policy_out The returned cache policy.\n"]
pub fn magma_buffer_get_cache_policy(
buffer: magma_buffer_t,
cache_policy_out: *mut magma_cache_policy_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Sets a name for the buffer for use in debugging tools.\n \\param buffer A valid buffer.\n \\param name The 0-terminated name of the buffer. May be truncated.\n"]
pub fn magma_buffer_set_name(
buffer: magma_buffer_t,
name: *const ::std::os::raw::c_char,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Get information on a magma buffer\n \\param buffer A valid buffer.\n \\param info_out Pointer to struct that receives the buffer info.\n"]
pub fn magma_buffer_get_info(
buffer: magma_buffer_t,
info_out: *mut magma_buffer_info_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Gets a platform handle for the given buffer. This can be used to perform a CPU mapping of\n the buffer using the standard syscall. The handle may be released without invalidating\n such CPU mappings.\n \\param buffer A valid buffer.\n \\param handle_out Pointer to the returned handle.\n"]
pub fn magma_buffer_get_handle(
buffer: magma_buffer_t,
handle_out: *mut magma_handle_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Exports the given buffer, returning a handle that may be imported into a connection.\n \\param buffer A valid buffer.\n \\param buffer_handle_out The returned handle.\n"]
pub fn magma_buffer_export(
buffer: magma_buffer_t,
buffer_handle_out: *mut magma_handle_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Signals the given semaphore.\n \\param semaphore A valid semaphore.\n"]
pub fn magma_semaphore_signal(semaphore: magma_semaphore_t);
}
extern "C" {
#[doc = "\n \\brief Resets the given semaphore.\n \\param semaphore A valid semaphore.\n"]
pub fn magma_semaphore_reset(semaphore: magma_semaphore_t);
}
extern "C" {
#[doc = "\n \\brief Exports the given semaphore, returning a handle that may be imported into a connection\n \\param semaphore A valid semaphore.\n \\param semaphore_handle_out The returned handle.\n"]
pub fn magma_semaphore_export(
semaphore: magma_semaphore_t,
semaphore_handle_out: *mut magma_handle_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Waits for at least one of the given items to meet a condition. Does not reset any\n semaphores. When MAGMA_STATUS_OK is returned, results are returned in the items array.\n MAGMA_STATUS_TIMED_OUT is returned if no conditions are met before the given timeout\n expires. If the notification channel handle is included in the item list, and the magma\n connection is closed, then MAGMA_STATUS_CONNECTION_LOST is returned.\n \\param items Array of poll items. Type should be either MAGMA_POLL_TYPE_SEMAPHORE or\n MAGMA_POLL_TYPE_HANDLE. Condition may be set to MAGMA_POLL_CONDITION_SIGNALED OR\n MAGMA_POLL_CONDITION_READABLE. If condition is 0 the item is ignored. Item results are\n set to the condition that was satisfied, otherwise 0. If the same item is given twice the\n behavior is undefined.\n \\param count Number of poll items in the array.\n \\param timeout_ns Time in ns to wait before returning MAGMA_STATUS_TIMED_OUT.\n"]
pub fn magma_poll(items: *mut magma_poll_item_t, count: u32, timeout_ns: u64)
-> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Initializes tracing. This should be called on Fuchsia; on other platforms it's not needed\n and will just close the given handle.\n \\param channel An open connection to a tracing provider.\n"]
pub fn magma_initialize_tracing(channel: magma_handle_t) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Initializes logging, used for debug and some exceptional error reporting. This should be\n called on Fuchsia; on other platforms it's not needed and will just close the given\n handle.\n \\param channel An open connection to the syslog service.\n"]
pub fn magma_initialize_logging(channel: magma_handle_t) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Tries to enable access to performance counters. Returns MAGMA_STATUS_OK if counters were\n successfully enabled or MAGMA_STATUS_ACCESS_DENIED if channel is for the wrong device and\n counters were not successfully enabled previously.\n \\param connection An open connection to a device.\n \\param channel A handle to a channel to a gpu-performance-counter device.\n"]
pub fn magma_connection_enable_performance_counter_access(
connection: magma_connection_t,
channel: magma_handle_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Enables a set of performance counters (the precise definition depends on the driver).\n Disables enabled performance counters that are not in the new set. Performance counters\n will also be automatically disabled on connection close. Performance counter access must\n have been enabled using magma_connection_enable_performance_counter_access before calling\n this method.\n \\param connection An open connection to a device.\n \\param counters An implementation-defined list of counters.\n \\param counters_count The number of entries in |counters|.\n"]
pub fn magma_connection_enable_performance_counters(
connection: magma_connection_t,
counters: *mut u64,
counters_count: u64,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Create a pool of buffers that performance counters can be dumped into. Performance\n counter access must have been enabled using\n magma_connection_enable_performance_counter_access before calling this method.\n \\param connection An open connection to a device.\n \\param pool_id_out A new pool id. Must not currently be in use.\n \\param notification_handle_out A handle that should be waited on.\n"]
pub fn magma_connection_create_performance_counter_buffer_pool(
connection: magma_connection_t,
pool_id_out: *mut magma_perf_count_pool_t,
notification_handle_out: *mut magma_handle_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Releases a pool of performance counter buffers. Performance counter access must have been\n enabled using magma_connection_enable_performance_counter_access before calling this\n method.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool id.\n"]
pub fn magma_connection_release_performance_counter_buffer_pool(
connection: magma_connection_t,
pool_id: magma_perf_count_pool_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Adds a an array of buffers + offset to the pool. |offsets[n].buffer_id| is the koid of a\n buffer that was previously imported using ImportBuffer(). The same buffer may be added to\n multiple pools. The pool will hold on to a reference to the buffer even after\n ReleaseBuffer is called. When dumped into this entry, counters will be written starting\n at |offsets[n].offset| bytes into the buffer, and up to |offsets[n].offset| +\n |offsets[n].size|. |offsets[n].size| must be large enough to fit all enabled counters.\n Performance counter access must have been enabled using\n magma_connection_enable_performance_counter_access before calling this method.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool.\n \\param offsets An array of offsets to add.\n \\param offsets_count The number of elements in offsets.\n"]
pub fn magma_connection_add_performance_counter_buffer_offsets_to_pool(
connection: magma_connection_t,
pool_id: magma_perf_count_pool_t,
offsets: *const magma_buffer_offset_t,
offsets_count: u64,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Removes every offset of a buffer from the pool. Performance counter access must have been\n enabled using magma_connection_enable_performance_counter_access before calling this\n method.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool.\n \\param buffer A magma_buffer\n"]
pub fn magma_connection_remove_performance_counter_buffer_from_pool(
connection: magma_connection_t,
pool_id: magma_perf_count_pool_t,
buffer: magma_buffer_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Triggers dumping of the performance counters into a buffer pool. May fail silently if\n there are no buffers in the pool. |trigger_id| is an arbitrary ID assigned by the client\n that can be returned in OnPerformanceCounterReadCompleted. Performance counter access\n must have been enabled using magma_connection_enable_performance_counter_access before\n calling this method.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool\n \\param trigger_id An arbitrary ID assigned by the client that will be returned in\n OnPerformanceCounterReadCompleted.\n"]
pub fn magma_connection_dump_performance_counters(
connection: magma_connection_t,
pool_id: magma_perf_count_pool_t,
trigger_id: u32,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Sets the values of all listed performance counters to 0. May not be supported by some\n hardware. Performance counter access must have been enabled using\n magma_connection_enable_performance_counter_access before calling this method.\n \\param connection An open connection to a device.\n \\param counters An implementation-defined list of counters.\n \\param counters_count The number of entries in |counters|.\n"]
pub fn magma_connection_clear_performance_counters(
connection: magma_connection_t,
counters: *mut u64,
counters_count: u64,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Reads one performance counter completion event, if available.\n \\param connection An open connection to a device.\n \\param pool_id An existing pool.\n \\param trigger_id_out The trigger ID for this event.\n \\param buffer_id_out The buffer ID for this event.\n \\param buffer_offset_out The buffer offset for this event.\n \\param time_out The monotonic time this event happened.\n \\param result_flags_out A set of flags giving more information about this event.\n"]
pub fn magma_connection_read_performance_counter_completion(
connection: magma_connection_t,
pool_id: magma_perf_count_pool_t,
trigger_id_out: *mut u32,
buffer_id_out: *mut u64,
buffer_offset_out: *mut u32,
time_out: *mut u64,
result_flags_out: *mut u32,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Creates an image buffer backed by a buffer collection given a DRM format and optional\n modifier, as specified in the create info.\n \\param connection An open connection.\n \\param create_info Input parameters describing the image.\n \\param size_out The size of the image buffer in bytes\n \\param image_out The image buffer.\n \\param buffer_id_out The ID of the image buffer.\n"]
pub fn magma_virt_connection_create_image(
connection: magma_connection_t,
create_info: *mut magma_image_create_info_t,
size_out: *mut u64,
image_out: *mut magma_buffer_t,
buffer_id_out: *mut magma_buffer_id_t,
) -> magma_status_t;
}
extern "C" {
#[doc = "\n \\brief Returns parameters for an image created with virtmagma_create_image.\n \\param connection An open connection.\n \\param image The image buffer.\n \\param image_info_out Output parameters describing the image.\n"]
pub fn magma_virt_connection_get_image_info(
connection: magma_connection_t,
image: magma_buffer_t,
image_info_out: *mut magma_image_info_t,
) -> magma_status_t;
}
pub type __u32 = ::std::os::raw::c_uint;
pub type __u64 = ::std::os::raw::c_ulonglong;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_ioctl_args_handshake {
pub handshake_inout: __u32,
pub version_out: __u32,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_ioctl_args_magma_command {
pub request_address: __u64,
pub request_size: __u64,
pub response_address: __u64,
pub response_size: __u64,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_command_descriptor {
pub descriptor_size: __u64,
pub descriptor: __u64,
pub resource_size: __u64,
pub resources: __u64,
pub command_buffer_size: __u64,
pub command_buffers: __u64,
pub semaphore_size: __u64,
pub semaphores: __u64,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_create_image_wrapper {
pub create_info: __u64,
pub create_info_size: __u64,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_get_image_info_wrapper {
pub image_info_out: __u64,
pub image_info_size: __u64,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtmagma_buffer_set_name_wrapper {
pub name_address: __u64,
pub name_size: __u64,
}
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_config {
pub dummy: u64,
}
pub type virtio_magma_config_t = virtio_magma_config;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_DEVICE_IMPORT: virtio_magma_ctrl_type = 4142;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_DEVICE_RELEASE: virtio_magma_ctrl_type = 4143;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_DEVICE_QUERY: virtio_magma_ctrl_type = 4177;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_DEVICE_CREATE_CONNECTION: virtio_magma_ctrl_type =
4146;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE: virtio_magma_ctrl_type = 4100;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_GET_ERROR: virtio_magma_ctrl_type =
4101;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CREATE_CONTEXT:
virtio_magma_ctrl_type = 4102;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE_CONTEXT:
virtio_magma_ctrl_type = 4103;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CREATE_BUFFER: virtio_magma_ctrl_type =
4181;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE_BUFFER:
virtio_magma_ctrl_type = 4105;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_IMPORT_BUFFER: virtio_magma_ctrl_type =
4180;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CREATE_SEMAPHORE:
virtio_magma_ctrl_type = 4185;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE_SEMAPHORE:
virtio_magma_ctrl_type = 4131;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_IMPORT_SEMAPHORE2:
virtio_magma_ctrl_type = 4187;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_PERFORM_BUFFER_OP:
virtio_magma_ctrl_type = 4161;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_MAP_BUFFER: virtio_magma_ctrl_type =
4178;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_UNMAP_BUFFER: virtio_magma_ctrl_type =
4179;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_EXECUTE_COMMAND:
virtio_magma_ctrl_type = 4176;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_EXECUTE_IMMEDIATE_COMMANDS:
virtio_magma_ctrl_type = 4129;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_FLUSH: virtio_magma_ctrl_type = 4175;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_GET_NOTIFICATION_CHANNEL_HANDLE:
virtio_magma_ctrl_type = 4138;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_READ_NOTIFICATION_CHANNEL:
virtio_magma_ctrl_type = 4166;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_CLEAN_CACHE: virtio_magma_ctrl_type = 4110;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_SET_CACHE_POLICY: virtio_magma_ctrl_type =
4111;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_GET_CACHE_POLICY: virtio_magma_ctrl_type =
4112;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_SET_NAME: virtio_magma_ctrl_type = 4160;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_GET_INFO: virtio_magma_ctrl_type = 4162;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_GET_HANDLE: virtio_magma_ctrl_type = 4171;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_BUFFER_EXPORT: virtio_magma_ctrl_type = 4183;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_SEMAPHORE_SIGNAL: virtio_magma_ctrl_type = 4133;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_SEMAPHORE_RESET: virtio_magma_ctrl_type = 4134;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_SEMAPHORE_EXPORT: virtio_magma_ctrl_type = 4184;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_POLL: virtio_magma_ctrl_type = 4148;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INITIALIZE_TRACING: virtio_magma_ctrl_type = 4141;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INITIALIZE_LOGGING: virtio_magma_ctrl_type = 4147;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_ENABLE_PERFORMANCE_COUNTER_ACCESS:
virtio_magma_ctrl_type = 4149;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_ENABLE_PERFORMANCE_COUNTERS:
virtio_magma_ctrl_type = 4152;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CREATE_PERFORMANCE_COUNTER_BUFFER_POOL : virtio_magma_ctrl_type = 4153 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_RELEASE_PERFORMANCE_COUNTER_BUFFER_POOL : virtio_magma_ctrl_type = 4154 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_ADD_PERFORMANCE_COUNTER_BUFFER_OFFSETS_TO_POOL : virtio_magma_ctrl_type = 4155 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_REMOVE_PERFORMANCE_COUNTER_BUFFER_FROM_POOL : virtio_magma_ctrl_type = 4156 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_DUMP_PERFORMANCE_COUNTERS:
virtio_magma_ctrl_type = 4157;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_CLEAR_PERFORMANCE_COUNTERS:
virtio_magma_ctrl_type = 4158;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_CONNECTION_READ_PERFORMANCE_COUNTER_COMPLETION:
virtio_magma_ctrl_type = 4159;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_VIRT_CONNECTION_CREATE_IMAGE:
virtio_magma_ctrl_type = 4182;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_VIRT_CONNECTION_GET_IMAGE_INFO:
virtio_magma_ctrl_type = 4168;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INTERNAL_RELEASE_HANDLE: virtio_magma_ctrl_type =
4172;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INTERNAL_MAP: virtio_magma_ctrl_type = 4173;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_CMD_INTERNAL_UNMAP: virtio_magma_ctrl_type = 4174;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_DEVICE_IMPORT: virtio_magma_ctrl_type = 8238;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_DEVICE_RELEASE: virtio_magma_ctrl_type = 8239;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_DEVICE_QUERY: virtio_magma_ctrl_type = 8273;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_DEVICE_CREATE_CONNECTION:
virtio_magma_ctrl_type = 8242;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE: virtio_magma_ctrl_type =
8196;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_GET_ERROR: virtio_magma_ctrl_type =
8197;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CREATE_CONTEXT:
virtio_magma_ctrl_type = 8198;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE_CONTEXT:
virtio_magma_ctrl_type = 8199;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CREATE_BUFFER:
virtio_magma_ctrl_type = 8277;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE_BUFFER:
virtio_magma_ctrl_type = 8201;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_IMPORT_BUFFER:
virtio_magma_ctrl_type = 8276;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CREATE_SEMAPHORE:
virtio_magma_ctrl_type = 8281;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE_SEMAPHORE:
virtio_magma_ctrl_type = 8227;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_IMPORT_SEMAPHORE2:
virtio_magma_ctrl_type = 8283;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_PERFORM_BUFFER_OP:
virtio_magma_ctrl_type = 8257;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_MAP_BUFFER: virtio_magma_ctrl_type =
8274;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_UNMAP_BUFFER: virtio_magma_ctrl_type =
8275;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_EXECUTE_COMMAND:
virtio_magma_ctrl_type = 8272;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_EXECUTE_IMMEDIATE_COMMANDS:
virtio_magma_ctrl_type = 8225;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_FLUSH: virtio_magma_ctrl_type = 8271;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_GET_NOTIFICATION_CHANNEL_HANDLE:
virtio_magma_ctrl_type = 8234;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_READ_NOTIFICATION_CHANNEL:
virtio_magma_ctrl_type = 8262;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_CLEAN_CACHE: virtio_magma_ctrl_type =
8206;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_SET_CACHE_POLICY: virtio_magma_ctrl_type =
8207;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_GET_CACHE_POLICY: virtio_magma_ctrl_type =
8208;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_SET_NAME: virtio_magma_ctrl_type = 8256;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_GET_INFO: virtio_magma_ctrl_type = 8258;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_GET_HANDLE: virtio_magma_ctrl_type = 8267;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_BUFFER_EXPORT: virtio_magma_ctrl_type = 8279;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_SEMAPHORE_SIGNAL: virtio_magma_ctrl_type = 8229;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_SEMAPHORE_RESET: virtio_magma_ctrl_type = 8230;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_SEMAPHORE_EXPORT: virtio_magma_ctrl_type = 8280;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_POLL: virtio_magma_ctrl_type = 8244;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INITIALIZE_TRACING: virtio_magma_ctrl_type =
8237;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INITIALIZE_LOGGING: virtio_magma_ctrl_type =
8243;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_ENABLE_PERFORMANCE_COUNTER_ACCESS:
virtio_magma_ctrl_type = 8245;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_ENABLE_PERFORMANCE_COUNTERS:
virtio_magma_ctrl_type = 8248;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CREATE_PERFORMANCE_COUNTER_BUFFER_POOL : virtio_magma_ctrl_type = 8249 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_RELEASE_PERFORMANCE_COUNTER_BUFFER_POOL : virtio_magma_ctrl_type = 8250 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_ADD_PERFORMANCE_COUNTER_BUFFER_OFFSETS_TO_POOL : virtio_magma_ctrl_type = 8251 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_REMOVE_PERFORMANCE_COUNTER_BUFFER_FROM_POOL : virtio_magma_ctrl_type = 8252 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_DUMP_PERFORMANCE_COUNTERS:
virtio_magma_ctrl_type = 8253;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_CLEAR_PERFORMANCE_COUNTERS:
virtio_magma_ctrl_type = 8254;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_CONNECTION_READ_PERFORMANCE_COUNTER_COMPLETION : virtio_magma_ctrl_type = 8255 ;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_VIRT_CONNECTION_CREATE_IMAGE:
virtio_magma_ctrl_type = 8278;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_VIRT_CONNECTION_GET_IMAGE_INFO:
virtio_magma_ctrl_type = 8264;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INTERNAL_RELEASE_HANDLE: virtio_magma_ctrl_type =
8268;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INTERNAL_MAP: virtio_magma_ctrl_type = 8269;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_INTERNAL_UNMAP: virtio_magma_ctrl_type = 8270;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_UNIMPLEMENTED: virtio_magma_ctrl_type =
12289;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_INTERNAL: virtio_magma_ctrl_type = 12290;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_HOST_DISCONNECTED: virtio_magma_ctrl_type =
12291;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_OUT_OF_MEMORY: virtio_magma_ctrl_type =
12292;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_INVALID_COMMAND: virtio_magma_ctrl_type =
12293;
pub const virtio_magma_ctrl_type_VIRTIO_MAGMA_RESP_ERR_INVALID_ARGUMENT: virtio_magma_ctrl_type =
12294;
pub type virtio_magma_ctrl_type = ::std::os::raw::c_ushort;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_ctrl_hdr {
pub type_: u32,
pub flags: u32,
}
pub type virtio_magma_ctrl_hdr_t = virtio_magma_ctrl_hdr;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_import_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub device_channel: u32,
}
pub type virtio_magma_device_import_ctrl_t = virtio_magma_device_import_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_import_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub device_out: u64,
pub result_return: u64,
}
pub type virtio_magma_device_import_resp_t = virtio_magma_device_import_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_release_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub device: u64,
}
pub type virtio_magma_device_release_ctrl_t = virtio_magma_device_release_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_release_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_device_release_resp_t = virtio_magma_device_release_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_query_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub device: u64,
pub id: u64,
}
pub type virtio_magma_device_query_ctrl_t = virtio_magma_device_query_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_query_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_buffer_out: u64,
pub result_out: u64,
pub result_return: u64,
}
pub type virtio_magma_device_query_resp_t = virtio_magma_device_query_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_create_connection_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub device: u64,
}
pub type virtio_magma_device_create_connection_ctrl_t = virtio_magma_device_create_connection_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_device_create_connection_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection_out: u64,
pub result_return: u64,
}
pub type virtio_magma_device_create_connection_resp_t = virtio_magma_device_create_connection_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
}
pub type virtio_magma_connection_release_ctrl_t = virtio_magma_connection_release_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_release_resp_t = virtio_magma_connection_release_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_get_error_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
}
pub type virtio_magma_connection_get_error_ctrl_t = virtio_magma_connection_get_error_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_get_error_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_get_error_resp_t = virtio_magma_connection_get_error_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_context_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
}
pub type virtio_magma_connection_create_context_ctrl_t =
virtio_magma_connection_create_context_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_context_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub context_id_out: u64,
pub result_return: u64,
}
pub type virtio_magma_connection_create_context_resp_t =
virtio_magma_connection_create_context_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_context_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub context_id: u32,
}
pub type virtio_magma_connection_release_context_ctrl_t =
virtio_magma_connection_release_context_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_context_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_release_context_resp_t =
virtio_magma_connection_release_context_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_buffer_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub size: u64,
}
pub type virtio_magma_connection_create_buffer_ctrl_t = virtio_magma_connection_create_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_buffer_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub size_out: u64,
pub buffer_out: u64,
pub id_out: u64,
pub result_return: u64,
}
pub type virtio_magma_connection_create_buffer_resp_t = virtio_magma_connection_create_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_buffer_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub buffer: u64,
}
pub type virtio_magma_connection_release_buffer_ctrl_t =
virtio_magma_connection_release_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_buffer_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_release_buffer_resp_t =
virtio_magma_connection_release_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_import_buffer_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub buffer_handle: u32,
}
pub type virtio_magma_connection_import_buffer_ctrl_t = virtio_magma_connection_import_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_import_buffer_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub size_out: u64,
pub buffer_out: u64,
pub id_out: u64,
pub result_return: u64,
}
pub type virtio_magma_connection_import_buffer_resp_t = virtio_magma_connection_import_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_semaphore_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
}
pub type virtio_magma_connection_create_semaphore_ctrl_t =
virtio_magma_connection_create_semaphore_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_semaphore_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub semaphore_out: u64,
pub id_out: u64,
pub result_return: u64,
}
pub type virtio_magma_connection_create_semaphore_resp_t =
virtio_magma_connection_create_semaphore_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_semaphore_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub semaphore: u64,
}
pub type virtio_magma_connection_release_semaphore_ctrl_t =
virtio_magma_connection_release_semaphore_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_semaphore_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_release_semaphore_resp_t =
virtio_magma_connection_release_semaphore_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_import_semaphore2_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub semaphore_handle: u32,
pub flags: u64,
}
pub type virtio_magma_connection_import_semaphore2_ctrl_t =
virtio_magma_connection_import_semaphore2_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_import_semaphore2_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub semaphore_out: u64,
pub id_out: u64,
pub result_return: u64,
}
pub type virtio_magma_connection_import_semaphore2_resp_t =
virtio_magma_connection_import_semaphore2_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_perform_buffer_op_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub buffer: u64,
pub options: u32,
pub start_offset: u64,
pub length: u64,
}
pub type virtio_magma_connection_perform_buffer_op_ctrl_t =
virtio_magma_connection_perform_buffer_op_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_perform_buffer_op_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_perform_buffer_op_resp_t =
virtio_magma_connection_perform_buffer_op_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_map_buffer_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub hw_va: u64,
pub buffer: u64,
pub offset: u64,
pub length: u64,
pub map_flags: u64,
}
pub type virtio_magma_connection_map_buffer_ctrl_t = virtio_magma_connection_map_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_map_buffer_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_map_buffer_resp_t = virtio_magma_connection_map_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_unmap_buffer_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub hw_va: u64,
pub buffer: u64,
}
pub type virtio_magma_connection_unmap_buffer_ctrl_t = virtio_magma_connection_unmap_buffer_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_unmap_buffer_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_connection_unmap_buffer_resp_t = virtio_magma_connection_unmap_buffer_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_execute_command_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub context_id: u32,
pub descriptor: u64,
}
pub type virtio_magma_connection_execute_command_ctrl_t =
virtio_magma_connection_execute_command_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_execute_command_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_execute_command_resp_t =
virtio_magma_connection_execute_command_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_execute_immediate_commands_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub context_id: u32,
pub command_count: u64,
pub command_buffers: u64,
}
pub type virtio_magma_connection_execute_immediate_commands_ctrl_t =
virtio_magma_connection_execute_immediate_commands_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_execute_immediate_commands_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_execute_immediate_commands_resp_t =
virtio_magma_connection_execute_immediate_commands_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_flush_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
}
pub type virtio_magma_connection_flush_ctrl_t = virtio_magma_connection_flush_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_flush_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_flush_resp_t = virtio_magma_connection_flush_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_get_notification_channel_handle_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
}
pub type virtio_magma_connection_get_notification_channel_handle_ctrl_t =
virtio_magma_connection_get_notification_channel_handle_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_get_notification_channel_handle_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u32,
}
pub type virtio_magma_connection_get_notification_channel_handle_resp_t =
virtio_magma_connection_get_notification_channel_handle_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_read_notification_channel_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub buffer: u64,
pub buffer_size: u64,
}
pub type virtio_magma_connection_read_notification_channel_ctrl_t =
virtio_magma_connection_read_notification_channel_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_read_notification_channel_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer_size_out: u64,
pub more_data_out: u64,
pub result_return: u64,
}
pub type virtio_magma_connection_read_notification_channel_resp_t =
virtio_magma_connection_read_notification_channel_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_clean_cache_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer: u64,
pub offset: u64,
pub size: u64,
pub operation: u64,
}
pub type virtio_magma_buffer_clean_cache_ctrl_t = virtio_magma_buffer_clean_cache_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_clean_cache_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_buffer_clean_cache_resp_t = virtio_magma_buffer_clean_cache_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_set_cache_policy_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer: u64,
pub policy: u64,
}
pub type virtio_magma_buffer_set_cache_policy_ctrl_t = virtio_magma_buffer_set_cache_policy_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_set_cache_policy_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_buffer_set_cache_policy_resp_t = virtio_magma_buffer_set_cache_policy_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_cache_policy_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer: u64,
}
pub type virtio_magma_buffer_get_cache_policy_ctrl_t = virtio_magma_buffer_get_cache_policy_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_cache_policy_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub cache_policy_out: u64,
pub result_return: u64,
}
pub type virtio_magma_buffer_get_cache_policy_resp_t = virtio_magma_buffer_get_cache_policy_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_set_name_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer: u64,
pub name: u64,
}
pub type virtio_magma_buffer_set_name_ctrl_t = virtio_magma_buffer_set_name_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_set_name_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_buffer_set_name_resp_t = virtio_magma_buffer_set_name_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_info_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer: u64,
pub info_out: u64,
}
pub type virtio_magma_buffer_get_info_ctrl_t = virtio_magma_buffer_get_info_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_info_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_buffer_get_info_resp_t = virtio_magma_buffer_get_info_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_handle_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer: u64,
}
pub type virtio_magma_buffer_get_handle_ctrl_t = virtio_magma_buffer_get_handle_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_get_handle_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub handle_out: u64,
pub result_return: u64,
}
pub type virtio_magma_buffer_get_handle_resp_t = virtio_magma_buffer_get_handle_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_export_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer: u64,
}
pub type virtio_magma_buffer_export_ctrl_t = virtio_magma_buffer_export_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_buffer_export_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer_handle_out: u64,
pub result_return: u64,
}
pub type virtio_magma_buffer_export_resp_t = virtio_magma_buffer_export_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_signal_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub semaphore: u64,
}
pub type virtio_magma_semaphore_signal_ctrl_t = virtio_magma_semaphore_signal_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_signal_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_semaphore_signal_resp_t = virtio_magma_semaphore_signal_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_reset_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub semaphore: u64,
}
pub type virtio_magma_semaphore_reset_ctrl_t = virtio_magma_semaphore_reset_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_reset_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
}
pub type virtio_magma_semaphore_reset_resp_t = virtio_magma_semaphore_reset_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_export_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub semaphore: u64,
}
pub type virtio_magma_semaphore_export_ctrl_t = virtio_magma_semaphore_export_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_semaphore_export_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub semaphore_handle_out: u64,
pub result_return: u64,
}
pub type virtio_magma_semaphore_export_resp_t = virtio_magma_semaphore_export_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_poll_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub items: u64,
pub count: u32,
pub timeout_ns: u64,
}
pub type virtio_magma_poll_ctrl_t = virtio_magma_poll_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_poll_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_poll_resp_t = virtio_magma_poll_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_initialize_tracing_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub channel: u32,
}
pub type virtio_magma_initialize_tracing_ctrl_t = virtio_magma_initialize_tracing_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_initialize_tracing_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_initialize_tracing_resp_t = virtio_magma_initialize_tracing_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_initialize_logging_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub channel: u32,
}
pub type virtio_magma_initialize_logging_ctrl_t = virtio_magma_initialize_logging_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_initialize_logging_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_initialize_logging_resp_t = virtio_magma_initialize_logging_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_enable_performance_counter_access_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub channel: u32,
}
pub type virtio_magma_connection_enable_performance_counter_access_ctrl_t =
virtio_magma_connection_enable_performance_counter_access_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_enable_performance_counter_access_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_enable_performance_counter_access_resp_t =
virtio_magma_connection_enable_performance_counter_access_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_enable_performance_counters_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub counters: u64,
pub counters_count: u64,
}
pub type virtio_magma_connection_enable_performance_counters_ctrl_t =
virtio_magma_connection_enable_performance_counters_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_enable_performance_counters_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_enable_performance_counters_resp_t =
virtio_magma_connection_enable_performance_counters_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_performance_counter_buffer_pool_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
}
pub type virtio_magma_connection_create_performance_counter_buffer_pool_ctrl_t =
virtio_magma_connection_create_performance_counter_buffer_pool_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_create_performance_counter_buffer_pool_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub pool_id_out: u64,
pub notification_handle_out: u64,
pub result_return: u64,
}
pub type virtio_magma_connection_create_performance_counter_buffer_pool_resp_t =
virtio_magma_connection_create_performance_counter_buffer_pool_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_performance_counter_buffer_pool_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub pool_id: u64,
}
pub type virtio_magma_connection_release_performance_counter_buffer_pool_ctrl_t =
virtio_magma_connection_release_performance_counter_buffer_pool_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_release_performance_counter_buffer_pool_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_release_performance_counter_buffer_pool_resp_t =
virtio_magma_connection_release_performance_counter_buffer_pool_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub pool_id: u64,
pub offsets: u64,
pub offsets_count: u64,
}
pub type virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_ctrl_t =
virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_resp_t =
virtio_magma_connection_add_performance_counter_buffer_offsets_to_pool_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_remove_performance_counter_buffer_from_pool_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub pool_id: u64,
pub buffer: u64,
}
pub type virtio_magma_connection_remove_performance_counter_buffer_from_pool_ctrl_t =
virtio_magma_connection_remove_performance_counter_buffer_from_pool_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_remove_performance_counter_buffer_from_pool_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_remove_performance_counter_buffer_from_pool_resp_t =
virtio_magma_connection_remove_performance_counter_buffer_from_pool_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_dump_performance_counters_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub pool_id: u64,
pub trigger_id: u32,
}
pub type virtio_magma_connection_dump_performance_counters_ctrl_t =
virtio_magma_connection_dump_performance_counters_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_dump_performance_counters_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_dump_performance_counters_resp_t =
virtio_magma_connection_dump_performance_counters_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_clear_performance_counters_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub counters: u64,
pub counters_count: u64,
}
pub type virtio_magma_connection_clear_performance_counters_ctrl_t =
virtio_magma_connection_clear_performance_counters_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_clear_performance_counters_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_connection_clear_performance_counters_resp_t =
virtio_magma_connection_clear_performance_counters_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_read_performance_counter_completion_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub pool_id: u64,
}
pub type virtio_magma_connection_read_performance_counter_completion_ctrl_t =
virtio_magma_connection_read_performance_counter_completion_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_connection_read_performance_counter_completion_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub trigger_id_out: u64,
pub buffer_id_out: u64,
pub buffer_offset_out: u64,
pub time_out: u64,
pub result_flags_out: u64,
pub result_return: u64,
}
pub type virtio_magma_connection_read_performance_counter_completion_resp_t =
virtio_magma_connection_read_performance_counter_completion_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_virt_connection_create_image_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub create_info: u64,
}
pub type virtio_magma_virt_connection_create_image_ctrl_t =
virtio_magma_virt_connection_create_image_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_virt_connection_create_image_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub size_out: u64,
pub image_out: u64,
pub buffer_id_out: u64,
pub result_return: u64,
}
pub type virtio_magma_virt_connection_create_image_resp_t =
virtio_magma_virt_connection_create_image_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_virt_connection_get_image_info_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub connection: u64,
pub image: u64,
pub image_info_out: u64,
}
pub type virtio_magma_virt_connection_get_image_info_ctrl_t =
virtio_magma_virt_connection_get_image_info_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_virt_connection_get_image_info_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_virt_connection_get_image_info_resp_t =
virtio_magma_virt_connection_get_image_info_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_release_handle_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub handle: u32,
}
pub type virtio_magma_internal_release_handle_ctrl_t = virtio_magma_internal_release_handle_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_release_handle_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_internal_release_handle_resp_t = virtio_magma_internal_release_handle_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_map_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer: u32,
pub length: u64,
}
pub type virtio_magma_internal_map_ctrl_t = virtio_magma_internal_map_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_map_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub address_out: u64,
pub result_return: u64,
}
pub type virtio_magma_internal_map_resp_t = virtio_magma_internal_map_resp;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_unmap_ctrl {
pub hdr: virtio_magma_ctrl_hdr_t,
pub buffer: u32,
pub address: u64,
}
pub type virtio_magma_internal_unmap_ctrl_t = virtio_magma_internal_unmap_ctrl;
#[repr(C, packed)]
#[derive(Debug, Default, Copy, Clone, IntoBytes, KnownLayout, FromBytes, Immutable)]
pub struct virtio_magma_internal_unmap_resp {
pub hdr: virtio_magma_ctrl_hdr_t,
pub result_return: u64,
}
pub type virtio_magma_internal_unmap_resp_t = virtio_magma_internal_unmap_resp;
pub const MAGMA_STATUS_OK: magma_status_t = 0;
pub const MAGMA_STATUS_INTERNAL_ERROR: magma_status_t = -1;
pub const MAGMA_STATUS_INVALID_ARGS: magma_status_t = -2;
pub const MAGMA_STATUS_MEMORY_ERROR: magma_status_t = -4;
pub const MAGMA_STATUS_TIMED_OUT: magma_status_t = -7;
pub const MAGMA_IMAGE_CREATE_FLAGS_PRESENTABLE: u32 = 1;
pub const MAGMA_IMAGE_CREATE_FLAGS_VULKAN_USAGE: u32 = 2;
pub const MAGMA_MAX_IMAGE_PLANES: u32 = 4;
pub const MAGMA_COHERENCY_DOMAIN_CPU: magma_coherency_domain_t = 0;
pub const MAGMA_COHERENCY_DOMAIN_RAM: magma_coherency_domain_t = 1;
pub const MAGMA_COHERENCY_DOMAIN_INACCESSIBLE: magma_coherency_domain_t = 2;
pub const MAGMA_POLL_TYPE_SEMAPHORE: u32 = 1;
pub const MAGMA_POLL_TYPE_HANDLE: u32 = 2;
pub const MAGMA_POLL_CONDITION_SIGNALED: u32 = 3;
pub const MAGMA_CACHE_POLICY_CACHED: magma_cache_policy_t = 0;
pub const MAGMA_CACHE_POLICY_WRITE_COMBINING: magma_cache_policy_t = 1;
pub const MAGMA_CACHE_POLICY_UNCACHED: magma_cache_policy_t = 2;
pub const MAGMA_QUERY_VENDOR_ID: magma_query_t = 0;
pub const MAGMA_IMPORT_SEMAPHORE_ONE_SHOT: u64 = 1;