162306a36Sopenharmony_ci/* SPDX-License-Identifier: MIT */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright © 2020 Intel Corporation 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#ifndef SHMEM_UTILS_H 762306a36Sopenharmony_ci#define SHMEM_UTILS_H 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#include <linux/types.h> 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_cistruct iosys_map; 1262306a36Sopenharmony_cistruct drm_i915_gem_object; 1362306a36Sopenharmony_cistruct file; 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_cistruct file *shmem_create_from_data(const char *name, void *data, size_t len); 1662306a36Sopenharmony_cistruct file *shmem_create_from_object(struct drm_i915_gem_object *obj); 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_civoid *shmem_pin_map(struct file *file); 1962306a36Sopenharmony_civoid shmem_unpin_map(struct file *file, void *ptr); 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ciint shmem_read_to_iosys_map(struct file *file, loff_t off, 2262306a36Sopenharmony_ci struct iosys_map *map, size_t map_off, size_t len); 2362306a36Sopenharmony_ciint shmem_read(struct file *file, loff_t off, void *dst, size_t len); 2462306a36Sopenharmony_ciint shmem_write(struct file *file, loff_t off, void *src, size_t len); 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci#endif /* SHMEM_UTILS_H */ 27