// Generated Code - DO NOT EDIT !! // generated by 'emugen' #include #include #include "magma_client_context.h" extern "C" { magma_status_t magma_device_import(magma_handle_t device_channel, magma_device_t* device_out); void magma_device_release(magma_device_t device); magma_status_t magma_device_query(magma_device_t device, uint64_t id, magma_handle_t* result_buffer_out, uint64_t* result_out); magma_status_t magma_device_query_fudge(magma_device_t device, uint64_t id, magma_bool_t host_allocate, uint64_t* result_buffer_mapping_id_inout, uint64_t* result_buffer_size_inout, uint64_t* result_out); magma_status_t magma_device_create_connection(magma_device_t device, magma_connection_t* connection_out); void magma_connection_release(magma_connection_t connection); magma_status_t magma_connection_get_error(magma_connection_t connection); magma_status_t magma_connection_create_context(magma_connection_t connection, uint32_t* context_id_out); void magma_connection_release_context(magma_connection_t connection, uint32_t context_id); magma_status_t magma_connection_create_buffer(magma_connection_t connection, uint64_t size, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out); void magma_connection_release_buffer(magma_connection_t connection, magma_buffer_t buffer); magma_status_t magma_connection_import_buffer(magma_connection_t connection, magma_handle_t buffer_handle, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out); magma_status_t magma_connection_create_semaphore(magma_connection_t connection, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out); void magma_connection_release_semaphore(magma_connection_t connection, magma_semaphore_t semaphore); magma_status_t magma_connection_import_semaphore(magma_connection_t connection, magma_handle_t semaphore_handle, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out); magma_status_t magma_connection_perform_buffer_op(magma_connection_t connection, magma_buffer_t buffer, uint32_t options, uint64_t start_offset, uint64_t length); magma_status_t magma_connection_map_buffer(magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer, uint64_t offset, uint64_t length, uint64_t map_flags); void magma_connection_unmap_buffer(magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer); magma_status_t magma_connection_execute_command(magma_connection_t connection, uint32_t context_id, magma_command_descriptor_t* descriptor); magma_status_t magma_connection_execute_command_fudge(magma_connection_t connection, uint32_t context_id, void* descriptor, uint64_t descriptor_size); magma_status_t magma_connection_execute_immediate_commands(magma_connection_t connection, uint32_t context_id, uint64_t command_count, magma_inline_command_buffer_t* command_buffers); magma_status_t magma_connection_execute_immediate_commands_fudge(magma_connection_t connection, uint32_t context_id, uint64_t command_count, void* command_buffers, uint64_t command_buffers_size, uint64_t* command_buffer_offsets); magma_status_t magma_connection_flush(magma_connection_t connection); magma_handle_t magma_connection_get_notification_channel_handle(magma_connection_t connection); magma_status_t magma_connection_read_notification_channel(magma_connection_t connection, void* buffer, uint64_t buffer_size, uint64_t* buffer_size_out, magma_bool_t* more_data_out); magma_status_t magma_buffer_clean_cache(magma_buffer_t buffer, uint64_t offset, uint64_t size, magma_cache_operation_t operation); magma_status_t magma_buffer_set_cache_policy(magma_buffer_t buffer, magma_cache_policy_t policy); magma_status_t magma_buffer_get_cache_policy(magma_buffer_t buffer, magma_cache_policy_t* cache_policy_out); magma_status_t magma_buffer_set_name(magma_buffer_t buffer, const char* name); magma_status_t magma_buffer_set_name_fudge(magma_buffer_t buffer, void* name, uint64_t name_size); magma_status_t magma_buffer_get_info(magma_buffer_t buffer, magma_buffer_info_t* info_out); magma_status_t magma_buffer_get_handle(magma_buffer_t buffer, magma_handle_t* handle_out); magma_status_t magma_buffer_export(magma_buffer_t buffer, magma_handle_t* buffer_handle_out); void magma_semaphore_signal(magma_semaphore_t semaphore); void magma_semaphore_reset(magma_semaphore_t semaphore); magma_status_t magma_semaphore_export(magma_semaphore_t semaphore, magma_handle_t* semaphore_handle_out); magma_status_t magma_poll(magma_poll_item_t* items, uint32_t count, uint64_t timeout_ns); magma_status_t magma_initialize_tracing(magma_handle_t channel); magma_status_t magma_initialize_logging(magma_handle_t channel); magma_status_t magma_connection_enable_performance_counter_access(magma_connection_t connection, magma_handle_t channel); magma_status_t magma_connection_enable_performance_counters(magma_connection_t connection, uint64_t* counters, uint64_t counters_count); magma_status_t magma_connection_create_performance_counter_buffer_pool(magma_connection_t connection, magma_perf_count_pool_t* pool_id_out, magma_handle_t* notification_handle_out); magma_status_t magma_connection_release_performance_counter_buffer_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id); magma_status_t magma_connection_add_performance_counter_buffer_offsets_to_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id, const magma_buffer_offset_t* offsets, uint64_t offsets_count); magma_status_t magma_connection_remove_performance_counter_buffer_from_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id, magma_buffer_t buffer); magma_status_t magma_connection_dump_performance_counters(magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t trigger_id); magma_status_t magma_connection_clear_performance_counters(magma_connection_t connection, uint64_t* counters, uint64_t counters_count); magma_status_t magma_connection_read_performance_counter_completion(magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t* trigger_id_out, uint64_t* buffer_id_out, uint32_t* buffer_offset_out, uint64_t* time_out, uint32_t* result_flags_out); magma_status_t magma_virt_connection_create_image(magma_connection_t connection, magma_image_create_info_t* create_info, uint64_t* size_out, magma_buffer_t* image_out, magma_buffer_id_t* buffer_id_out); magma_status_t magma_virt_connection_get_image_info(magma_connection_t connection, magma_buffer_t image, magma_image_info_t* image_info_out); }; #ifndef GET_CONTEXT static magma_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL; void magma_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; } #define GET_CONTEXT magma_client_context_t * ctx = getCurrentContext() #endif magma_status_t magma_device_import(magma_handle_t device_channel, magma_device_t* device_out) { GET_CONTEXT; return ctx->magma_device_import(ctx, device_channel, device_out); } void magma_device_release(magma_device_t device) { GET_CONTEXT; ctx->magma_device_release(ctx, device); } magma_status_t magma_device_query(magma_device_t device, uint64_t id, magma_handle_t* result_buffer_out, uint64_t* result_out) { GET_CONTEXT; return ctx->magma_device_query(ctx, device, id, result_buffer_out, result_out); } magma_status_t magma_device_query_fudge(magma_device_t device, uint64_t id, magma_bool_t host_allocate, uint64_t* result_buffer_mapping_id_inout, uint64_t* result_buffer_size_inout, uint64_t* result_out) { GET_CONTEXT; return ctx->magma_device_query_fudge(ctx, device, id, host_allocate, result_buffer_mapping_id_inout, result_buffer_size_inout, result_out); } magma_status_t magma_device_create_connection(magma_device_t device, magma_connection_t* connection_out) { GET_CONTEXT; return ctx->magma_device_create_connection(ctx, device, connection_out); } void magma_connection_release(magma_connection_t connection) { GET_CONTEXT; ctx->magma_connection_release(ctx, connection); } magma_status_t magma_connection_get_error(magma_connection_t connection) { GET_CONTEXT; return ctx->magma_connection_get_error(ctx, connection); } magma_status_t magma_connection_create_context(magma_connection_t connection, uint32_t* context_id_out) { GET_CONTEXT; return ctx->magma_connection_create_context(ctx, connection, context_id_out); } void magma_connection_release_context(magma_connection_t connection, uint32_t context_id) { GET_CONTEXT; ctx->magma_connection_release_context(ctx, connection, context_id); } magma_status_t magma_connection_create_buffer(magma_connection_t connection, uint64_t size, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out) { GET_CONTEXT; return ctx->magma_connection_create_buffer(ctx, connection, size, size_out, buffer_out, id_out); } void magma_connection_release_buffer(magma_connection_t connection, magma_buffer_t buffer) { GET_CONTEXT; ctx->magma_connection_release_buffer(ctx, connection, buffer); } magma_status_t magma_connection_import_buffer(magma_connection_t connection, magma_handle_t buffer_handle, uint64_t* size_out, magma_buffer_t* buffer_out, magma_buffer_id_t* id_out) { GET_CONTEXT; return ctx->magma_connection_import_buffer(ctx, connection, buffer_handle, size_out, buffer_out, id_out); } magma_status_t magma_connection_create_semaphore(magma_connection_t connection, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out) { GET_CONTEXT; return ctx->magma_connection_create_semaphore(ctx, connection, semaphore_out, id_out); } void magma_connection_release_semaphore(magma_connection_t connection, magma_semaphore_t semaphore) { GET_CONTEXT; ctx->magma_connection_release_semaphore(ctx, connection, semaphore); } magma_status_t magma_connection_import_semaphore(magma_connection_t connection, magma_handle_t semaphore_handle, magma_semaphore_t* semaphore_out, magma_semaphore_id_t* id_out) { GET_CONTEXT; return ctx->magma_connection_import_semaphore(ctx, connection, semaphore_handle, semaphore_out, id_out); } magma_status_t magma_connection_perform_buffer_op(magma_connection_t connection, magma_buffer_t buffer, uint32_t options, uint64_t start_offset, uint64_t length) { GET_CONTEXT; return ctx->magma_connection_perform_buffer_op(ctx, connection, buffer, options, start_offset, length); } magma_status_t magma_connection_map_buffer(magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer, uint64_t offset, uint64_t length, uint64_t map_flags) { GET_CONTEXT; return ctx->magma_connection_map_buffer(ctx, connection, hw_va, buffer, offset, length, map_flags); } void magma_connection_unmap_buffer(magma_connection_t connection, uint64_t hw_va, magma_buffer_t buffer) { GET_CONTEXT; ctx->magma_connection_unmap_buffer(ctx, connection, hw_va, buffer); } magma_status_t magma_connection_execute_command(magma_connection_t connection, uint32_t context_id, magma_command_descriptor_t* descriptor) { GET_CONTEXT; return ctx->magma_connection_execute_command(ctx, connection, context_id, descriptor); } magma_status_t magma_connection_execute_command_fudge(magma_connection_t connection, uint32_t context_id, void* descriptor, uint64_t descriptor_size) { GET_CONTEXT; return ctx->magma_connection_execute_command_fudge(ctx, connection, context_id, descriptor, descriptor_size); } magma_status_t magma_connection_execute_immediate_commands(magma_connection_t connection, uint32_t context_id, uint64_t command_count, magma_inline_command_buffer_t* command_buffers) { GET_CONTEXT; return ctx->magma_connection_execute_immediate_commands(ctx, connection, context_id, command_count, command_buffers); } magma_status_t magma_connection_execute_immediate_commands_fudge(magma_connection_t connection, uint32_t context_id, uint64_t command_count, void* command_buffers, uint64_t command_buffers_size, uint64_t* command_buffer_offsets) { GET_CONTEXT; return ctx->magma_connection_execute_immediate_commands_fudge(ctx, connection, context_id, command_count, command_buffers, command_buffers_size, command_buffer_offsets); } magma_status_t magma_connection_flush(magma_connection_t connection) { GET_CONTEXT; return ctx->magma_connection_flush(ctx, connection); } magma_handle_t magma_connection_get_notification_channel_handle(magma_connection_t connection) { GET_CONTEXT; return ctx->magma_connection_get_notification_channel_handle(ctx, connection); } magma_status_t magma_connection_read_notification_channel(magma_connection_t connection, void* buffer, uint64_t buffer_size, uint64_t* buffer_size_out, magma_bool_t* more_data_out) { GET_CONTEXT; return ctx->magma_connection_read_notification_channel(ctx, connection, buffer, buffer_size, buffer_size_out, more_data_out); } magma_status_t magma_buffer_clean_cache(magma_buffer_t buffer, uint64_t offset, uint64_t size, magma_cache_operation_t operation) { GET_CONTEXT; return ctx->magma_buffer_clean_cache(ctx, buffer, offset, size, operation); } magma_status_t magma_buffer_set_cache_policy(magma_buffer_t buffer, magma_cache_policy_t policy) { GET_CONTEXT; return ctx->magma_buffer_set_cache_policy(ctx, buffer, policy); } magma_status_t magma_buffer_get_cache_policy(magma_buffer_t buffer, magma_cache_policy_t* cache_policy_out) { GET_CONTEXT; return ctx->magma_buffer_get_cache_policy(ctx, buffer, cache_policy_out); } magma_status_t magma_buffer_set_name(magma_buffer_t buffer, const char* name) { GET_CONTEXT; return ctx->magma_buffer_set_name(ctx, buffer, name); } magma_status_t magma_buffer_set_name_fudge(magma_buffer_t buffer, void* name, uint64_t name_size) { GET_CONTEXT; return ctx->magma_buffer_set_name_fudge(ctx, buffer, name, name_size); } magma_status_t magma_buffer_get_info(magma_buffer_t buffer, magma_buffer_info_t* info_out) { GET_CONTEXT; return ctx->magma_buffer_get_info(ctx, buffer, info_out); } magma_status_t magma_buffer_get_handle(magma_buffer_t buffer, magma_handle_t* handle_out) { GET_CONTEXT; return ctx->magma_buffer_get_handle(ctx, buffer, handle_out); } magma_status_t magma_buffer_export(magma_buffer_t buffer, magma_handle_t* buffer_handle_out) { GET_CONTEXT; return ctx->magma_buffer_export(ctx, buffer, buffer_handle_out); } void magma_semaphore_signal(magma_semaphore_t semaphore) { GET_CONTEXT; ctx->magma_semaphore_signal(ctx, semaphore); } void magma_semaphore_reset(magma_semaphore_t semaphore) { GET_CONTEXT; ctx->magma_semaphore_reset(ctx, semaphore); } magma_status_t magma_semaphore_export(magma_semaphore_t semaphore, magma_handle_t* semaphore_handle_out) { GET_CONTEXT; return ctx->magma_semaphore_export(ctx, semaphore, semaphore_handle_out); } magma_status_t magma_poll(magma_poll_item_t* items, uint32_t count, uint64_t timeout_ns) { GET_CONTEXT; return ctx->magma_poll(ctx, items, count, timeout_ns); } magma_status_t magma_initialize_tracing(magma_handle_t channel) { GET_CONTEXT; return ctx->magma_initialize_tracing(ctx, channel); } magma_status_t magma_initialize_logging(magma_handle_t channel) { GET_CONTEXT; return ctx->magma_initialize_logging(ctx, channel); } magma_status_t magma_connection_enable_performance_counter_access(magma_connection_t connection, magma_handle_t channel) { GET_CONTEXT; return ctx->magma_connection_enable_performance_counter_access(ctx, connection, channel); } magma_status_t magma_connection_enable_performance_counters(magma_connection_t connection, uint64_t* counters, uint64_t counters_count) { GET_CONTEXT; return ctx->magma_connection_enable_performance_counters(ctx, connection, counters, counters_count); } magma_status_t magma_connection_create_performance_counter_buffer_pool(magma_connection_t connection, magma_perf_count_pool_t* pool_id_out, magma_handle_t* notification_handle_out) { GET_CONTEXT; return ctx->magma_connection_create_performance_counter_buffer_pool(ctx, connection, pool_id_out, notification_handle_out); } magma_status_t magma_connection_release_performance_counter_buffer_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id) { GET_CONTEXT; return ctx->magma_connection_release_performance_counter_buffer_pool(ctx, connection, pool_id); } magma_status_t magma_connection_add_performance_counter_buffer_offsets_to_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id, const magma_buffer_offset_t* offsets, uint64_t offsets_count) { GET_CONTEXT; return ctx->magma_connection_add_performance_counter_buffer_offsets_to_pool(ctx, connection, pool_id, offsets, offsets_count); } magma_status_t magma_connection_remove_performance_counter_buffer_from_pool(magma_connection_t connection, magma_perf_count_pool_t pool_id, magma_buffer_t buffer) { GET_CONTEXT; return ctx->magma_connection_remove_performance_counter_buffer_from_pool(ctx, connection, pool_id, buffer); } magma_status_t magma_connection_dump_performance_counters(magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t trigger_id) { GET_CONTEXT; return ctx->magma_connection_dump_performance_counters(ctx, connection, pool_id, trigger_id); } magma_status_t magma_connection_clear_performance_counters(magma_connection_t connection, uint64_t* counters, uint64_t counters_count) { GET_CONTEXT; return ctx->magma_connection_clear_performance_counters(ctx, connection, counters, counters_count); } magma_status_t magma_connection_read_performance_counter_completion(magma_connection_t connection, magma_perf_count_pool_t pool_id, uint32_t* trigger_id_out, uint64_t* buffer_id_out, uint32_t* buffer_offset_out, uint64_t* time_out, uint32_t* result_flags_out) { GET_CONTEXT; return ctx->magma_connection_read_performance_counter_completion(ctx, connection, pool_id, trigger_id_out, buffer_id_out, buffer_offset_out, time_out, result_flags_out); } magma_status_t magma_virt_connection_create_image(magma_connection_t connection, magma_image_create_info_t* create_info, uint64_t* size_out, magma_buffer_t* image_out, magma_buffer_id_t* buffer_id_out) { GET_CONTEXT; return ctx->magma_virt_connection_create_image(ctx, connection, create_info, size_out, image_out, buffer_id_out); } magma_status_t magma_virt_connection_get_image_info(magma_connection_t connection, magma_buffer_t image, magma_image_info_t* image_info_out) { GET_CONTEXT; return ctx->magma_virt_connection_get_image_info(ctx, connection, image, image_info_out); }