linux/drivers/tee/amdtee/core.c

// SPDX-License-Identifier: MIT
/*
 * Copyright 2019 Advanced Micro Devices, Inc.
 */

#include <linux/errno.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/device.h>
#include <linux/tee_core.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/uaccess.h>
#include <linux/firmware.h>
#include "amdtee_private.h"
#include <linux/psp-tee.h>

static struct amdtee_driver_data *drv_data;
static DEFINE_MUTEX(session_list_mutex);

static void amdtee_get_version(struct tee_device *teedev,
			       struct tee_ioctl_version_data *vers)
{}

static int amdtee_open(struct tee_context *ctx)
{}

static void release_session(struct amdtee_session *sess)
{}

static void amdtee_release(struct tee_context *ctx)
{}

/**
 * alloc_session() - Allocate a session structure
 * @ctxdata:    TEE Context data structure
 * @session:    Session ID for which 'struct amdtee_session' structure is to be
 *              allocated.
 *
 * Scans the TEE context's session list to check if TA is already loaded in to
 * TEE. If yes, returns the 'session' structure for that TA. Else allocates,
 * initializes a new 'session' structure and adds it to context's session list.
 *
 * The caller must hold a mutex.
 *
 * Returns:
 * 'struct amdtee_session *' on success and NULL on failure.
 */
static struct amdtee_session *alloc_session(struct amdtee_context_data *ctxdata,
					    u32 session)
{}

/* Requires mutex to be held */
static struct amdtee_session *find_session(struct amdtee_context_data *ctxdata,
					   u32 session)
{}

u32 get_buffer_id(struct tee_shm *shm)
{}

static DEFINE_MUTEX(drv_mutex);
static int copy_ta_binary(struct tee_context *ctx, void *ptr, void **ta,
			  size_t *ta_size)
{}

/* mutex must be held by caller */
static void destroy_session(struct kref *ref)
{}

int amdtee_open_session(struct tee_context *ctx,
			struct tee_ioctl_open_session_arg *arg,
			struct tee_param *param)
{}

int amdtee_close_session(struct tee_context *ctx, u32 session)
{}

int amdtee_map_shmem(struct tee_shm *shm)
{}

void amdtee_unmap_shmem(struct tee_shm *shm)
{}

int amdtee_invoke_func(struct tee_context *ctx,
		       struct tee_ioctl_invoke_arg *arg,
		       struct tee_param *param)
{}

int amdtee_cancel_req(struct tee_context *ctx, u32 cancel_id, u32 session)
{}

static const struct tee_driver_ops amdtee_ops =;

static const struct tee_desc amdtee_desc =;

static int __init amdtee_driver_init(void)
{}
module_init();

static void __exit amdtee_driver_exit(void)
{}
module_exit(amdtee_driver_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_VERSION();
MODULE_LICENSE();