A share buffer infrastructure In Linux kernel through ION

This artical impl. a mecahins after ION, process`s communication could be held through the machism.just a demo.

the principle diagram:

A share buffer infrastructure In Linux kernel through ION_第1张图片

code:

ion.c

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include "./uapi/ion.h"

struct ion_data {
	int npages;
	int counter;
	struct page *pages[];
};

struct ion_import_fd {
	int src_pid;
	int fd;
	int newfd;
};

static int ion_attach(struct dma_buf *dmabuf, struct dma_buf_attachment *attachment)
{
	pr_info("ion attach called.\n");
	return 0;
}

static void ion_detach(struct dma_buf *dmabuf, struct dma_buf_a

你可能感兴趣的:(Linux,GPGPU,linux,运维,服务器)