2 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
17 * These numbers are used from the kernel command line and sysfs
18 * to control filtering. Remove items from here with extreme caution.
20 enum logk_event_type {
33 #define LOGTYPE_NOPC 0x80
35 struct msm_rtb_platform_data {
39 #if defined(CONFIG_QCOM_RTB)
41 * returns 1 if data was logged, 0 otherwise
43 int uncached_logk_pc(enum logk_event_type log_type, void *caller,
47 * returns 1 if data was logged, 0 otherwise
49 int uncached_logk(enum logk_event_type log_type, void *data);
51 #define ETB_WAYPOINT do { \
52 BRANCH_TO_NEXT_ISTR; \
54 BRANCH_TO_NEXT_ISTR; \
58 #define BRANCH_TO_NEXT_ISTR asm volatile("b .+4\n" : : : "memory")
60 * both the mb and the isb are needed to ensure enough waypoints for
63 #define LOG_BARRIER do { \
69 static inline int uncached_logk_pc(enum logk_event_type log_type,
71 void *data) { return 0; }
73 static inline int uncached_logk(enum logk_event_type log_type,
74 void *data) { return 0; }
77 #define BRANCH_TO_NEXT_ISTR
79 * Due to a GCC bug, we need to have a nop here in order to prevent an extra
80 * read from being generated after the write.
82 #define LOG_BARRIER nop()