Skip to content

Commit 917f137

Browse files
committed
feat: Add ML Replacement macro
1 parent 0a2d0d5 commit 917f137

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

include/linux/kermit.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
/*
3+
* kermit.h - KernMLOps Insertion Interface
4+
*
5+
* Copyright (C) 2025 Aditya Tewari <adityaatewari@gmail.com>
6+
*/
7+
8+
#ifndef _LINUX_KERMIT_H_
9+
#define _LINUX_KERMIT_H_
10+
11+
#define ML_REPLACE_FUNCTION(type, mlfunc, mlinvoke, normal_expression) ({\
12+
type r; \
13+
if (mlfunc) r = (mlinvoke); \
14+
else r = ({normal_expression}); \
15+
r; \
16+
})
17+
18+
#endif //_LINUX_KERMIT_H_

0 commit comments

Comments
 (0)