summaryrefstree
path: root/kernel/include/linux/dsms.h
blob: 4bc1c67264db3cdd2fafdbfea0a31a3f6e898792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
 */

#ifndef _LINUX_DSMS_H
#define _LINUX_DSMS_H

#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/types.h>

#define DSMS_SUCCESS (0)
#define DSMS_DENY (-EPERM)
#define DSMS_NOT_IMPLEMENTED (-ENOSYS)

// DSMS Kernel Interface

#ifdef CONFIG_SECURITY_DSMS

extern int noinline dsms_send_message(const char *feature_code,
				      const char *detail, int64_t value);

#else

static inline int dsms_send_message(const char *feature_code,
				    const char *detail,
				    int64_t value)
{
	/* When SEC_PRODUCT_FEATURE_SECURITY_SUPPORT_DSMS=FALSE 
	 * CONFIG_SECURITY_DSMS is disabled and 
	 * DSMS functionality is not implemented. 
	 */
	return DSMS_NOT_IMPLEMENTED;
}

#endif /* CONFIG_SECURITY_DSMS */

#endif /* _LINUX_DSMS_H */