Files
kernel-tenderloin-3.0/arch/arm/mach-msm/include/mach/msm_rtb.h
Laura Abbott aa9b60bb87 printk: Log printk events
Log printk events to the uncached buffer. If a reset occurs
and printk data is still present in the cache, information will
be lost. This doesn't store the actual printk, but it at least
gives information on who the last caller was.

Change-Id: If1bd414a44b19b45c157d23a7ddde8f16b30e780
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Trevor Bourget <tbourget@codeaurora.org>
2012-02-07 09:04:00 -08:00

70 lines
1.7 KiB
C

/*
* Copyright (c) 2012, Code Aurora Forum. 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 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_RTB_H__
#define __MSM_RTB_H__
enum logk_event_type {
LOGK_NONE = 0,
LOGK_READL,
LOGK_WRITEL,
LOGK_LOGBUF,
LOGK_OTHER,
};
#if defined(CONFIG_MSM_RTB)
/*
* returns 1 if data was logged, 0 otherwise
*/
int uncached_logk_pc(enum logk_event_type log_type, void *caller,
void *data);
/*
* returns 1 if data was logged, 0 otherwise
*/
int uncached_logk(enum logk_event_type log_type, void *data);
#define ETB_WAYPOINT do { \
BRANCH_TO_NEXT_ISTR; \
nop(); \
BRANCH_TO_NEXT_ISTR; \
nop(); \
} while (0)
#define BRANCH_TO_NEXT_ISTR asm volatile("b .+4\n" : : : "memory")
/*
* both the mb and the isb are needed to ensure enough waypoints for
* etb tracing
*/
#define LOG_BARRIER do { \
mb(); \
isb();\
} while (0)
#else
static inline int uncached_logk_pc(enum logk_event_type log_type,
void *caller,
void *data) { return 0; }
static inline int uncached_logk(enum logk_event_type log_type,
void *data) { return 0; }
#define ETB_WAYPOINT
#define BRANCH_TO_NEXT_ISTR
/*
* Due to a GCC bug, we need to have a nop here in order to prevent an extra
* read from being generated after the write.
*/
#define LOG_BARRIER nop()
#endif
#endif