feat[kmpp_ioc]: Add kmpp_ioc module

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I766b0ec68f8ae572a44d96dd6ff059240ebfb698
This commit is contained in:
Herman Chen 2025-09-26 09:38:38 +08:00
parent 1c3881cbac
commit 4db2167ff4
4 changed files with 67 additions and 0 deletions

View file

@ -4,6 +4,7 @@
# add kmpp basic components
# ----------------------------------------------------------------------------
add_library(kmpp_base OBJECT
kmpp_ioc.c
kmpp_obj.c
kmpp_meta.c
kmpp_frame.c

27
kmpp/base/inc/kmpp_ioc.h Normal file
View file

@ -0,0 +1,27 @@
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
/*
* Copyright (c) 2025 Rockchip Electronics Co., Ltd.
*/
#ifndef __KMPP_IOC_H__
#define __KMPP_IOC_H__
#include "rk_type.h"
typedef void* KmppIoc;
#define KMPP_IOC_ENTRY_TABLE(prefix, ENTRY, STRCT, EHOOK, SHOOK, ALIAS) \
ENTRY(prefix, u32, rk_u32, def, FLAG_NONE, def) \
ENTRY(prefix, u32, rk_u32, cmd, FLAG_NONE, cmd) \
ENTRY(prefix, u32, rk_u32, flags, FLAG_NONE, flags) \
ENTRY(prefix, u32, rk_u32, id, FLAG_NONE, id) \
STRCT(prefix, shm, KmppShmPtr, ctx, FLAG_NONE, ctx) \
STRCT(prefix, shm, KmppShmPtr, in, FLAG_NONE, in) \
STRCT(prefix, shm, KmppShmPtr, out, FLAG_NONE, out)
#define KMPP_OBJ_NAME kmpp_ioc
#define KMPP_OBJ_INTF_TYPE KmppIoc
#define KMPP_OBJ_ENTRY_TABLE KMPP_IOC_ENTRY_TABLE
#include "kmpp_obj_func.h"
#endif /*__KMPP_IOC_H__*/

38
kmpp/base/kmpp_ioc.c Normal file
View file

@ -0,0 +1,38 @@
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
/*
* Copyright (c) 2025 Rockchip Electronics Co., Ltd.
*/
#include "kmpp_ioc.h"
typedef struct KmppIocImpl_t {
/* object defintion index for ioctl functions */
rk_u32 def;
/* object defintion ioctl command */
rk_u32 cmd;
/*
* flags for:
* last in the batch / not last
* block / non-block
* return / non-return
* sync / async
* ack / non-ack
* direct call / timer call
*/
rk_u32 flags;
/* ioc object id for input and output queue match */
rk_u32 id;
/* ioc context object */
KmppShmPtr ctx;
/* input config object */
KmppShmPtr in;
/* output return object */
KmppShmPtr out;
} KmppIocImpl;
#define KMPP_OBJ_NAME kmpp_ioc
#define KMPP_OBJ_INTF_TYPE KmppIoc
#define KMPP_OBJ_IMPL_TYPE KmppIocImpl
#define KMPP_OBJ_SGLN_ID MPP_SGLN_KMPP_IOC
#define KMPP_OBJ_ENTRY_TABLE KMPP_IOC_ENTRY_TABLE
#include "kmpp_obj_helper.h"