Extend the scope of #ifndef LOCORE to also cover the prototype of

ktr_tracepoint() and the macros using it. This allows this header
to be included in .S files for obtaining the KTR_* class macros
directly and providing a default value for KTR_COMPILE in case it's
not specified in the kernel config file including defining it to 0
when not using 'options KTR' at all.

Requested by:	ru
Reviewed by:	ru
This commit is contained in:
Marius Strobl 2005-12-06 16:37:01 +00:00
parent 81ee234642
commit 3e4e0e14f6

View File

@ -86,9 +86,14 @@
#define KTR_CT8 0x80000000
/* Trace classes to compile in */
#ifdef KTR
#ifndef KTR_COMPILE
#define KTR_COMPILE (KTR_ALL)
#endif
#else /* !KTR */
#undef KTR_COMPILE
#define KTR_COMPILE 0
#endif /* KTR */
/* Trace classes that can not be used with KTR_ALQ */
#define KTR_ALQ_MASK (KTR_WITNESS)
@ -121,7 +126,6 @@ extern int ktr_verbose;
extern volatile int ktr_idx;
extern struct ktr_entry ktr_buf[];
#endif /* !LOCORE */
#ifdef KTR
void ktr_tracepoint(u_int mask, const char *file, int line,
@ -141,8 +145,6 @@ void ktr_tracepoint(u_int mask, const char *file, int line,
#define CTR4(m, format, p1, p2, p3, p4) CTR6(m, format, p1, p2, p3, p4, 0, 0)
#define CTR5(m, format, p1, p2, p3, p4, p5) CTR6(m, format, p1, p2, p3, p4, p5, 0)
#else /* KTR */
#undef KTR_COMPILE
#define KTR_COMPILE 0
#define CTR0(m, d)
#define CTR1(m, d, p1)
#define CTR2(m, d, p1, p2)
@ -184,4 +186,6 @@ void ktr_tracepoint(u_int mask, const char *file, int line,
#define ITR6(d, p1, p2, p3, p4, p5, p6)
#endif
#endif /* !LOCORE */
#endif /* !_SYS_KTR_H_ */