hal: Add hal-log.h file to hal directory 86/113286/1
authorWook Song <wook16.song@samsung.com>
Tue, 7 Feb 2017 01:56:51 +0000 (10:56 +0900)
committerWook Song <wook16.song@samsung.com>
Tue, 7 Feb 2017 05:44:19 +0000 (14:44 +0900)
This patch creates the hal-log.h file in the hal directory. This header
contains useful macros to display dlog messages and is used for the pass
hal.

Change-Id: I0cdd1c96c7c1d40aae2dc73715f9f71ac8c7a67b
Signed-off-by: Wook Song <wook16.song@samsung.com>
src/hal/hal-log.h [new file with mode: 0644]
src/hal/hal.c

diff --git a/src/hal/hal-log.h b/src/hal/hal-log.h
new file mode 100644 (file)
index 0000000..3590ab5
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * PASS (Power Aware System Service)
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HAL_LOG_H__
+#define __HAL_LOG_H__
+
+#include <dlog.h>
+#ifdef LOG_TAG
+#undef LOG_TAG
+#define LOG_TAG "PASS"
+#endif /* LOG_TAG */
+
+
+#define _D(fmt, arg...)                do { SLOGD(fmt, ##arg); } while(0)
+#define _I(fmt, arg...)                do { SLOGI(fmt, ##arg); } while(0)
+#define _W(fmt, arg...)                do { SLOGW(fmt, ##arg); } while(0)
+#define _E(fmt, arg...)                do { SLOGE(fmt, ##arg); } while(0)
+#define _SD(fmt, arg...)       do { SECURE_SLOGD(fmt, ##arg); } while(0)
+#define _SI(fmt, arg...)       do { SECURE_SLOGI(fmt, ##arg); } while(0)
+#define _SW(fmt, arg...)       do { SECURE_SLOGW(fmt, ##arg); } while(0)
+#define _SE(fmt, arg...)       do { SECURE_SLOGE(fmt, ##arg); } while(0)
+
+#endif /* __HAL_LOG_H__ */
index 7f8bee643e3c88873139b72e79be6e27b51cc225..831b4b8c9179227df0a215f99f712383287c424e 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/limits.h>
 
 #include "hal.h"
-#include "shared/log.h"
+#include "hal-log.h"
 
 #ifndef EXPORT
 #define EXPORT __attribute__ ((visibility("default")))