debug.h: merge both instances into ihk/debug.h
We do not need two debug.h files. Take Fujitsu's STATIC_ASSERT over BUILD_BUG_ON because it is more used Change-Id: If04c17fbb7406ab15fe86267fed8d6da460cec62 Fujitsu: POSTK_DEBUG_ARCH_DEP_9
This commit is contained in:
committed by
Dominique Martinet
parent
06e96005a6
commit
9ec0aeeab5
@ -1,6 +1,5 @@
|
||||
/* cpu.c COPYRIGHT FUJITSU LIMITED 2015-2018 */
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
@ -30,7 +29,7 @@
|
||||
#include <debug-monitors.h>
|
||||
#include <sysreg.h>
|
||||
#include <cpufeature.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <hwcap.h>
|
||||
#include <virt.h>
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
#include <cputype.h>
|
||||
#include <irqflags.h>
|
||||
#include <ihk/context.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <debug-monitors.h>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
#include <prctl.h>
|
||||
#include <cpufeature.h>
|
||||
#include <kmalloc.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <process.h>
|
||||
#include <bitmap.h>
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#define __ASM_TRAP_H
|
||||
|
||||
#include <types.h>
|
||||
#include <arch-lock.h>
|
||||
|
||||
struct pt_regs;
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include <memory.h>
|
||||
#include <affinity.h>
|
||||
#include <syscall.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <arch-timer.h>
|
||||
#include <cls.h>
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include <cputype.h>
|
||||
#include <process.h>
|
||||
#include <syscall.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <arch-timer.h>
|
||||
#include <cls.h>
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
/* memory.c COPYRIGHT FUJITSU LIMITED 2015-2018 */
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <types.h>
|
||||
#include <memory.h>
|
||||
@ -14,7 +13,7 @@
|
||||
#include <context.h>
|
||||
#include <kmalloc.h>
|
||||
#include <vdso.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <rusage_private.h>
|
||||
#include <cputype.h>
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
#include <ihk/perfctr.h>
|
||||
#include <errno.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <debug.h>
|
||||
#include <sysreg.h>
|
||||
#include <virt.h>
|
||||
#include <bitops.h>
|
||||
|
||||
@ -18,10 +18,9 @@
|
||||
#include <psci.h>
|
||||
#include <errno.h>
|
||||
#include <ihk/types.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <compiler.h>
|
||||
#include <lwk/compiler.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_PSCI
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
#include <hwcap.h>
|
||||
#include <string.h>
|
||||
#include <thread_info.h>
|
||||
#include <debug.h>
|
||||
#include <ptrace.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_SC
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
#include <limits.h>
|
||||
#include <uio.h>
|
||||
#include <syscall.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
void terminate_mcexec(int, int);
|
||||
extern void ptrace_report_signal(struct thread *thread, int sig);
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include <cputype.h>
|
||||
#include <irq.h>
|
||||
#include <arch-timer.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_TIMER
|
||||
|
||||
|
||||
@ -11,10 +11,9 @@
|
||||
#include <process.h>
|
||||
#include <string.h>
|
||||
#include <syscall.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ikc/queue.h>
|
||||
#include <vdso.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_VDSO
|
||||
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
@ -32,7 +31,7 @@
|
||||
#include <prctl.h>
|
||||
#include <page.h>
|
||||
#include <kmalloc.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
#define LAPIC_ID 0x020
|
||||
#define LAPIC_TIMER 0x320
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <types.h>
|
||||
#include <memory.h>
|
||||
@ -26,7 +25,7 @@
|
||||
#include <cls.h>
|
||||
#include <kmalloc.h>
|
||||
#include <rusage_private.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG
|
||||
|
||||
|
||||
@ -12,12 +12,11 @@
|
||||
#include <march.h>
|
||||
#include <errno.h>
|
||||
#include <cls.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/cpu.h>
|
||||
#include <registers.h>
|
||||
#include <mc_perf_event.h>
|
||||
#include <config.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
extern unsigned int *x86_march_perfmap;
|
||||
extern int running_on_kvm(void);
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <cls.h>
|
||||
#include <cpulocal.h>
|
||||
#include <syscall.h>
|
||||
@ -32,7 +31,7 @@
|
||||
#include <page.h>
|
||||
#include <limits.h>
|
||||
#include <syscall.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
void terminate_mcexec(int, int);
|
||||
extern long do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact);
|
||||
|
||||
2
ihk
2
ihk
Submodule ihk updated: 7828636f98...9d63ef81c7
@ -21,7 +21,6 @@
|
||||
#include <kmsg.h>
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <process.h>
|
||||
#include <init.h>
|
||||
#include <march.h>
|
||||
@ -29,7 +28,7 @@
|
||||
#include <time.h>
|
||||
#include <syscall.h>
|
||||
#include <rusage_private.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_AP
|
||||
|
||||
|
||||
@ -13,13 +13,13 @@
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <kmsg.h>
|
||||
#include <ihk/ihk_debug.h>
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/lock.h>
|
||||
#include <ihk/monitor.h>
|
||||
#include <errno.h>
|
||||
#include <sysfs.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <limits.h>
|
||||
|
||||
struct ihk_kmsg_buf *kmsg_buf;
|
||||
|
||||
@ -11,32 +11,16 @@
|
||||
* HISTORY:
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#include <ihk/cpu.h>
|
||||
#endif
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/lock.h>
|
||||
#if 0
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/types.h>
|
||||
#include <cls.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
#include <kmalloc.h>
|
||||
#if 0
|
||||
#include <kmsg.h>
|
||||
#endif
|
||||
#include <memobj.h>
|
||||
#if 0
|
||||
#include <memory.h>
|
||||
#endif
|
||||
#include <page.h> /* for allocate_pages() */
|
||||
#include <pager.h>
|
||||
#include <string.h>
|
||||
#include <syscall.h>
|
||||
#include <process.h>
|
||||
#include <rusage_private.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_DEVOBJ
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/lock.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/types.h>
|
||||
@ -27,7 +26,7 @@
|
||||
#include <string.h>
|
||||
#include <syscall.h>
|
||||
#include <rusage_private.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <mman.h>
|
||||
|
||||
//#define DEBUG_PRINT_FILEOBJ
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
#include <cls.h>
|
||||
#include <kmsg.h>
|
||||
#include <timer.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <syscall.h>
|
||||
|
||||
//#define DEBUG_PRINT_FUTEX
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
#include <kmsg.h>
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/ikc.h>
|
||||
#include <ikc/master.h>
|
||||
#include <cls.h>
|
||||
@ -34,7 +33,7 @@
|
||||
#include <sysfs.h>
|
||||
#include <ihk/perfctr.h>
|
||||
#include <rusage_private.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_HOST
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
#include <kmsg.h>
|
||||
#include <kmalloc.h>
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
#if DEBUG_HUGEFILEOBJ
|
||||
#undef DDEBUG_DEFAULT
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
|
||||
#include "lwk/compiler.h"
|
||||
|
||||
void panic(const char *);
|
||||
|
||||
/* when someone has a lot of time, add attribute __printf(1, 2) to kprintf */
|
||||
int kprintf(const char *format, ...);
|
||||
|
||||
struct ddebug {
|
||||
const char *file;
|
||||
const char *func;
|
||||
const char *fmt;
|
||||
unsigned int line:24;
|
||||
unsigned int flags:8;
|
||||
} __aligned(8);
|
||||
|
||||
#define DDEBUG_NONE 0x0
|
||||
#define DDEBUG_PRINT 0x1
|
||||
|
||||
#define DDEBUG_DEFAULT DDEBUG_NONE
|
||||
|
||||
#define DDEBUG_SYMBOL() \
|
||||
static struct ddebug __aligned(8) \
|
||||
__attribute__((section("__verbose"))) ddebug = { \
|
||||
.file = __FILE__, \
|
||||
.func = __func__, \
|
||||
.line = __LINE__, \
|
||||
.flags = DDEBUG_DEFAULT, \
|
||||
}
|
||||
|
||||
#define DDEBUG_TEST ddebug.flags
|
||||
|
||||
|
||||
|
||||
#define dkprintf(fmt, args...) \
|
||||
do { \
|
||||
DDEBUG_SYMBOL(); \
|
||||
if (DDEBUG_TEST) \
|
||||
kprintf(fmt, ##args); \
|
||||
} while (0)
|
||||
#define ekprintf(fmt, args...) kprintf(fmt, ##args)
|
||||
|
||||
#define BUG_ON(condition) do { \
|
||||
if (condition) { \
|
||||
kprintf("PANIC: %s: %s(line:%d)\n", \
|
||||
__FILE__, __func__, __LINE__); \
|
||||
panic(""); \
|
||||
} \
|
||||
} while (0)
|
||||
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
|
||||
|
||||
#endif
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#include "ihk/mm.h"
|
||||
#include "cls.h"
|
||||
#include "debug.h"
|
||||
#include <ihk/debug.h>
|
||||
|
||||
#define kmalloc(size, flag) ({\
|
||||
void *r = _kmalloc(size, flag, __FILE__, __LINE__);\
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
#include <memobj.h>
|
||||
#include <rusage.h>
|
||||
#include <ihk/ihk_monitor.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
#ifdef ENABLE_RUSAGE
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
#include <mc_xpmem.h>
|
||||
#include <xpmem.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
#define XPMEM_CURRENT_VERSION 0x00026003
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
#include <kmalloc.h>
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/dma.h>
|
||||
#include <ihk/perfctr.h>
|
||||
#include <process.h>
|
||||
@ -32,7 +31,7 @@
|
||||
#include <syscall.h>
|
||||
#include <sysfs.h>
|
||||
#include <ihk/monitor.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <rusage.h>
|
||||
|
||||
//#define IOCTL_FUNC_EXTENSION
|
||||
|
||||
@ -15,11 +15,10 @@
|
||||
#include <kmsg.h>
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/ikc.h>
|
||||
#include <ikc/master.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_LISTENERS
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
#include <kmalloc.h>
|
||||
#include <string.h>
|
||||
#include <ihk/cpu.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/lock.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/page_alloc.h>
|
||||
@ -44,7 +43,7 @@
|
||||
#include <process.h>
|
||||
#include <limits.h>
|
||||
#include <sysfs.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_MEM
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include <ihk/cpu.h>
|
||||
#include <cpulocal.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/ikc.h>
|
||||
#include <errno.h>
|
||||
#include <cls.h>
|
||||
@ -22,7 +21,7 @@
|
||||
#include <kmalloc.h>
|
||||
#include <process.h>
|
||||
#include <swapfmt.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
#define O_RDONLY 00000000
|
||||
#define O_WRONLY 00000001
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
#include <errno.h>
|
||||
#include <kmalloc.h>
|
||||
#include <cls.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <page.h>
|
||||
#include <cpulocal.h>
|
||||
#include <auxvec.h>
|
||||
@ -36,7 +35,7 @@
|
||||
#include <xpmem.h>
|
||||
#include <rusage_private.h>
|
||||
#include <ihk/monitor.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_PROCESS
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
#include <ihk/cpu.h>
|
||||
#include <cpulocal.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/ikc.h>
|
||||
#include <errno.h>
|
||||
#include <cls.h>
|
||||
@ -39,7 +38,7 @@
|
||||
#include <limits.h>
|
||||
#include <march.h>
|
||||
#include <process.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
extern char *syscall_name[];
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
*/
|
||||
|
||||
#include <ihk/atomic.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/lock.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <errno.h>
|
||||
@ -23,7 +22,7 @@
|
||||
#include <shm.h>
|
||||
#include <string.h>
|
||||
#include <rusage_private.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
|
||||
static LIST_HEAD(shmobj_list_head);
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
#include <ihk/cpu.h>
|
||||
#include <cpulocal.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/ikc.h>
|
||||
#include <errno.h>
|
||||
#include <cls.h>
|
||||
@ -59,7 +58,7 @@
|
||||
#include <rusage_private.h>
|
||||
#include <ihk/monitor.h>
|
||||
#include <profile.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
#include "../executer/include/uti.h"
|
||||
|
||||
/* Headers taken from kitten LWK */
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include <sysfs.h>
|
||||
#include <sysfs_msg.h>
|
||||
#include <vsprintf.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
static size_t sysfs_data_bufsize;
|
||||
static void *sysfs_data_buf;
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include <ihk/cpu.h>
|
||||
#include <cpulocal.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/ikc.h>
|
||||
#include <errno.h>
|
||||
#include <cls.h>
|
||||
@ -32,7 +31,7 @@
|
||||
#include <futex.h>
|
||||
#include <bitops.h>
|
||||
#include <timer.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
//#define DEBUG_PRINT_TIMER
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
*/
|
||||
|
||||
#include <ihk/atomic.h>
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/lock.h>
|
||||
#include <ihk/mm.h>
|
||||
#include <errno.h>
|
||||
@ -21,7 +20,7 @@
|
||||
#include <memory.h>
|
||||
#include <page.h>
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
struct zeroobj {
|
||||
struct memobj memobj; /* must be first */
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <bitmap.h>
|
||||
#include <debug.h>
|
||||
#include <ihk/debug.h>
|
||||
|
||||
#define EXPORT_SYMBOL(x)
|
||||
|
||||
|
||||
@ -1,43 +1,65 @@
|
||||
/* debug.h COPYRIGHT FUJITSU LIMITED 2015-2016 */
|
||||
/**
|
||||
* \file debug.h
|
||||
* License details are found in the file LICENSE.
|
||||
* \brief
|
||||
* Declare types and functions to print debug message (kmsg).
|
||||
* \author Taku Shimosawa <shimosawa@is.s.u-tokyo.ac.jp> \par
|
||||
* Copyright (C) 2011 - 2012 Taku Shimosawa
|
||||
*/
|
||||
/*
|
||||
* HISTORY
|
||||
*/
|
||||
|
||||
#ifndef IHK_DEBUG_H
|
||||
#define IHK_DEBUG_H
|
||||
|
||||
#include <arch-lock.h>
|
||||
#include <ihk/memconst.h>
|
||||
#include <ihk/ihk_debug.h>
|
||||
#include "lwk/compiler.h"
|
||||
|
||||
#ifdef POSTK_DEBUG_ARCH_DEP_9 /* want to add a static assertion */
|
||||
void panic(const char *);
|
||||
|
||||
/* when someone has a lot of time, add attribute __printf(1, 2) to kprintf */
|
||||
int kprintf(const char *format, ...);
|
||||
unsigned long kprintf_lock(void);
|
||||
void kprintf_unlock(unsigned long irqflags);
|
||||
int __kprintf(const char *format, ...);
|
||||
|
||||
struct ddebug {
|
||||
const char *file;
|
||||
const char *func;
|
||||
const char *fmt;
|
||||
unsigned int line:24;
|
||||
unsigned int flags:8;
|
||||
} __aligned(8);
|
||||
|
||||
#define DDEBUG_NONE 0x0
|
||||
#define DDEBUG_PRINT 0x1
|
||||
|
||||
#define DDEBUG_DEFAULT DDEBUG_NONE
|
||||
|
||||
#define DDEBUG_SYMBOL() \
|
||||
static struct ddebug __aligned(8) \
|
||||
__attribute__((section("__verbose"))) ddebug = { \
|
||||
.file = __FILE__, \
|
||||
.func = __func__, \
|
||||
.line = __LINE__, \
|
||||
.flags = DDEBUG_DEFAULT, \
|
||||
}
|
||||
|
||||
#define DDEBUG_TEST ddebug.flags
|
||||
|
||||
|
||||
|
||||
#define dkprintf(fmt, args...) \
|
||||
do { \
|
||||
DDEBUG_SYMBOL(); \
|
||||
if (DDEBUG_TEST) \
|
||||
kprintf(fmt, ##args); \
|
||||
} while (0)
|
||||
#define ekprintf(fmt, args...) kprintf(fmt, ##args)
|
||||
|
||||
#define BUG_ON(condition) do { \
|
||||
if (condition) { \
|
||||
kprintf("PANIC: %s: %s(line:%d)\n", \
|
||||
__FILE__, __func__, __LINE__); \
|
||||
panic(""); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Force a compilation error if condition is false */
|
||||
#define STATIC_ASSERT(cond) _STATIC_ASSERT(cond, __LINE__)
|
||||
#define _STATIC_ASSERT(cond, line) __STATIC_ASSERT(cond, line)
|
||||
#define __STATIC_ASSERT(cond, line) \
|
||||
static void __static_assert_ ## line (void) { \
|
||||
STATIC_ASSERT_LOCAL(cond); \
|
||||
}
|
||||
|
||||
/* Force a compilation error if condition is false */
|
||||
#define STATIC_ASSERT_LOCAL(cond) ((void)sizeof(struct { int:-!!!(cond); }))
|
||||
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_9 */
|
||||
|
||||
extern int kprintf(const char *format, ...);
|
||||
extern unsigned long kprintf_lock(void);
|
||||
extern void kprintf_unlock(unsigned long irqflags);
|
||||
extern int __kprintf(const char *format, ...);
|
||||
|
||||
extern void panic(const char *msg);
|
||||
|
||||
#endif
|
||||
|
||||
@ -23,9 +23,8 @@
|
||||
//#define DEBUG_PRINT_PAGE_ALLOC
|
||||
|
||||
#ifdef DEBUG_PRINT_PAGE_ALLOC
|
||||
#define dkprintf kprintf
|
||||
#else
|
||||
#define dkprintf(...) do { if (0) kprintf(__VA_ARGS__); } while (0)
|
||||
#undef DDEBUG_DEFAULT
|
||||
#define DDEBUG_DEFAULT DDEBUG_PRINT
|
||||
#endif
|
||||
|
||||
void free_pages(void *, int npages);
|
||||
|
||||
Reference in New Issue
Block a user