Files
kernel_common_drivers/include/linux/amlogic/debug_irqflags.h
T
Hanjie Lin e6d82ef16c debug: fix gki10 break issue [2/3]
PD#SWPL-94447

Problem:
debug break gki10

Solution:
1, support amlogic_debug build to module, amlogic_debug module
   includes debug_lockup, cpu_mhz and meson_atrace for now.
2, amlogic_debug some function still build in kernel but not break
   gki10, for example: irq_check function on builtin kernel code,
   module_debug, workqueue debug etc.
3, new config CONFIG_AMLOGIC_HARDLOCKUP_DETECTOR still builtin but
   not break gki.
4, other functions for example iotrace still under developing

Verify:
sc2

Signed-off-by: Hanje Lin <hanjie.lin@amlogic.com>
Change-Id: I9c11465e3e879f999ae6fd13dc12c044efd2417a
2022-10-14 16:53:03 -07:00

46 lines
1.2 KiB
C

/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
*/
#ifndef __AMLOGIC_DEBUG_IRQFLAGS_H
#define __AMLOGIC_DEBUG_IRQFLAGS_H
#ifdef CONFIG_AMLOGIC_DEBUG_LOCKUP
typedef void (*irq_trace_fn_t)(unsigned long flags);
extern irq_trace_fn_t irq_trace_start_hook;
extern irq_trace_fn_t irq_trace_stop_hook;
extern irq_trace_fn_t irq_trace_start_hook_gki_builtin;
extern irq_trace_fn_t irq_trace_stop_hook_gki_builtin;
static inline void __nocfi irq_trace_start_glue(unsigned long flags)
{
#if defined(CONFIG_AMLOGIC_DEBUG) || (defined(CONFIG_AMLOGIC_DEBUG_MODULE) && defined(MODULE))
/* builtin code or gki module */
if (irq_trace_start_hook)
irq_trace_start_hook(flags);
#else
/* gki builtin */
if (irq_trace_start_hook_gki_builtin)
irq_trace_start_hook_gki_builtin(flags);
#endif
}
static inline void __nocfi irq_trace_stop_glue(unsigned long flags)
{
#if defined(CONFIG_AMLOGIC_DEBUG) || (defined(CONFIG_AMLOGIC_DEBUG_MODULE) && defined(MODULE))
/* builtin code or gki module */
if (irq_trace_stop_hook)
irq_trace_stop_hook(flags);
#else
/* gki builtin */
if (irq_trace_stop_hook_gki_builtin)
irq_trace_stop_hook_gki_builtin(flags);
#endif
}
#endif
#endif