Replaced with struct sm_instance *.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
}
-VC_VCHI_SM_HANDLE_T vc_vchi_sm_init(VCHI_INSTANCE_T vchi_instance,
+struct sm_instance *vc_vchi_sm_init(VCHI_INSTANCE_T vchi_instance,
VCHI_CONNECTION_T **vchi_connections,
uint32_t num_connections)
{
return NULL;
}
-int vc_vchi_sm_stop(VC_VCHI_SM_HANDLE_T *handle)
+int vc_vchi_sm_stop(struct sm_instance **handle)
{
struct sm_instance *instance;
uint32_t i;
return -EINVAL;
}
-int vc_vchi_sm_send_msg(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_send_msg(struct sm_instance *handle,
enum vc_sm_msg_type msg_id,
void *msg, uint32_t msg_size,
void *result, uint32_t result_size,
return status;
}
-int vc_vchi_sm_alloc(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_alloc_t *msg,
+int vc_vchi_sm_alloc(struct sm_instance *handle, struct vc_sm_alloc_t *msg,
struct vc_sm_alloc_result_t *result,
uint32_t *cur_trans_id)
{
cur_trans_id, 1);
}
-int vc_vchi_sm_free(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_free(struct sm_instance *handle,
struct vc_sm_free_t *msg, uint32_t *cur_trans_id)
{
return vc_vchi_sm_send_msg(handle, VC_SM_MSG_TYPE_FREE,
msg, sizeof(*msg), 0, 0, cur_trans_id, 0);
}
-int vc_vchi_sm_lock(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_lock(struct sm_instance *handle,
struct vc_sm_lock_unlock_t *msg,
struct vc_sm_lock_result_t *result,
uint32_t *cur_trans_id)
cur_trans_id, 1);
}
-int vc_vchi_sm_unlock(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_unlock(struct sm_instance *handle,
struct vc_sm_lock_unlock_t *msg,
uint32_t *cur_trans_id, uint8_t wait_reply)
{
wait_reply);
}
-int vc_vchi_sm_resize(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_resize_t *msg,
+int vc_vchi_sm_resize(struct sm_instance *handle, struct vc_sm_resize_t *msg,
uint32_t *cur_trans_id)
{
return vc_vchi_sm_send_msg(handle, VC_SM_MSG_TYPE_RESIZE,
msg, sizeof(*msg), 0, 0, cur_trans_id, 1);
}
-int vc_vchi_sm_walk_alloc(VC_VCHI_SM_HANDLE_T handle)
+int vc_vchi_sm_walk_alloc(struct sm_instance *handle)
{
return vc_vchi_sm_send_msg(handle, VC_SM_MSG_TYPE_WALK_ALLOC,
0, 0, 0, 0, 0, 0);
}
-int vc_vchi_sm_clean_up(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_clean_up(struct sm_instance *handle,
struct vc_sm_action_clean_t *msg)
{
return vc_vchi_sm_send_msg(handle, VC_SM_MSG_TYPE_ACTION_CLEAN,
msg, sizeof(*msg), 0, 0, 0, 0);
}
-int vc_vchi_sm_import(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_import *msg,
+int vc_vchi_sm_import(struct sm_instance *handle, struct vc_sm_import *msg,
struct vc_sm_import_result *result,
uint32_t *cur_trans_id)
{
/*
* Forward declare.
*/
-typedef struct sm_instance *VC_VCHI_SM_HANDLE_T;
+struct sm_instance;
/*
* Initialize the shared memory service, opens up vchi connection to talk to it.
*/
-VC_VCHI_SM_HANDLE_T vc_vchi_sm_init(VCHI_INSTANCE_T vchi_instance,
+struct sm_instance *vc_vchi_sm_init(VCHI_INSTANCE_T vchi_instance,
VCHI_CONNECTION_T **vchi_connections,
uint32_t num_connections);
/*
* Terminates the shared memory service.
*/
-int vc_vchi_sm_stop(VC_VCHI_SM_HANDLE_T *handle);
+int vc_vchi_sm_stop(struct sm_instance **handle);
/*
* Ask the shared memory service to allocate some memory on videocre and
* return the result of this allocation (which upon success will be a pointer
* to some memory in videocore space).
*/
-int vc_vchi_sm_alloc(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_alloc_t *alloc,
+int vc_vchi_sm_alloc(struct sm_instance *handle, struct vc_sm_alloc_t *alloc,
struct vc_sm_alloc_result_t *alloc_result,
uint32_t *trans_id);
* Ask the shared memory service to free up some memory that was previously
* allocated by the vc_vchi_sm_alloc function call.
*/
-int vc_vchi_sm_free(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_free(struct sm_instance *handle,
struct vc_sm_free_t *free, uint32_t *trans_id);
/*
* Ask the shared memory service to lock up some memory that was previously
* allocated by the vc_vchi_sm_alloc function call.
*/
-int vc_vchi_sm_lock(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_lock(struct sm_instance *handle,
struct vc_sm_lock_unlock_t *lock_unlock,
struct vc_sm_lock_result_t *lock_result,
uint32_t *trans_id);
* Ask the shared memory service to unlock some memory that was previously
* allocated by the vc_vchi_sm_alloc function call.
*/
-int vc_vchi_sm_unlock(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_unlock(struct sm_instance *handle,
struct vc_sm_lock_unlock_t *lock_unlock,
uint32_t *trans_id, uint8_t wait_reply);
* Ask the shared memory service to resize some memory that was previously
* allocated by the vc_vchi_sm_alloc function call.
*/
-int vc_vchi_sm_resize(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_resize(struct sm_instance *handle,
struct vc_sm_resize_t *resize, uint32_t *trans_id);
/*
* show up in the log. This is purely for debug/information and takes no
* specific actions.
*/
-int vc_vchi_sm_walk_alloc(VC_VCHI_SM_HANDLE_T handle);
+int vc_vchi_sm_walk_alloc(struct sm_instance *handle);
/*
* Clean up following a previously interrupted action which left the system
* in a bad state of some sort.
*/
-int vc_vchi_sm_clean_up(VC_VCHI_SM_HANDLE_T handle,
+int vc_vchi_sm_clean_up(struct sm_instance *handle,
struct vc_sm_action_clean_t *action_clean);
/*
* Import a contiguous block of memory and wrap it in a GPU MEM_HANDLE_T.
*/
-int vc_vchi_sm_import(VC_VCHI_SM_HANDLE_T handle, struct vc_sm_import *msg,
+int vc_vchi_sm_import(struct sm_instance *handle, struct vc_sm_import *msg,
struct vc_sm_import_result *result,
uint32_t *cur_trans_id);
*/
struct SM_STATE_T {
struct platform_device *pdev;
- VC_VCHI_SM_HANDLE_T sm_handle; /* Handle for videocore service. */
+ struct sm_instance *sm_handle; /* Handle for videocore service. */
struct dentry *dir_root; /* Debug fs entries root. */
struct dentry *dir_alloc; /* Debug fs entries allocations. */
struct SM_PDE_T dir_stats; /* Debug fs entries statistics sub-tree. */