Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
Re: repair sparc64 BUS_SPACE_DEBUG include
To:
tech@openbsd.org
Date:
Tue, 22 Oct 2024 13:28:52 +0200

Download raw body.

Thread
On Tue, Oct 22, 2024 at 03:04:41PM +1100, Jonathan Gray wrote:
> used to be __SYSTM_H__ before bus.h rev 1.26
> 
> or alternatively drop the ifndef around the include?

I would go for that. sys/systm.h has a guard to not double include so why
do it here.
 
> Building a kernel with BUS_SPACE_DEBUG requires -Wno-format
> as busop.c debug format strings aren't right.
> 
> Index: sys/arch/sparc64/include/bus.h
> ===================================================================
> RCS file: /cvs/src/sys/arch/sparc64/include/bus.h,v
> diff -u -p -U21 -r1.37 bus.h
> --- sys/arch/sparc64/include/bus.h	24 Dec 2023 11:12:34 -0000	1.37
> +++ sys/arch/sparc64/include/bus.h	22 Oct 2024 03:44:24 -0000
> @@ -67,43 +67,43 @@
>  #define _MACHINE_BUS_H_
>  
>  #include <sys/atomic.h>
>  
>  #ifdef _KERNEL
>  
>  /*
>   * Debug hooks
>   */
>  
>  #define	BSDB_ACCESS	0x01
>  #define BSDB_MAP	0x02
>  #define BSDB_ASSERT	0x04
>  #define BSDB_MAPDETAIL	0x08
>  #define	BSDB_ALL_ACCESS	0x10
>  extern int bus_space_debug;
>  
>  #define BSHDB_ACCESS	0x01
>  #define BSHDB_NO_ACCESS	0x02
>  
>  #if defined(BUS_SPACE_DEBUG)
> -#ifndef _MACHINE_BUS_H_
> +#ifndef __SYSTM_H__
>  #include <sys/systm.h>
>  #endif
>  #define BUS_SPACE_PRINTF(l, s) do {				\
>  	if(bus_space_debug & (l)) printf s;			\
>  } while(0)
>  #define BUS_SPACE_TRACE(t, h, s) do {				\
>  	if ( (((bus_space_debug & BSDB_ALL_ACCESS) != 0) &&	\
>  		(((h).bh_flags & BSHDB_NO_ACCESS) == 0)) ||	\
>  	     (((bus_space_debug & BSDB_ACCESS) != 0) &&		\
>  		(((h).bh_flags & BSHDB_ACCESS) != 0)))		\
>  		printf s;					\
>  	} while(0)
>  #define BUS_SPACE_SET_FLAGS(t, h, f) ((h).bh_flags |= (f))
>  #define BUS_SPACE_CLEAR_FLAGS(t, h, f) ((h).bh_flags &= ~(f))
>  #define BUS_SPACE_FLAG_DECL(s)	int s
>  #define BUS_SPACE_SAVE_FLAGS(t, h, s) (s = (h).bh_flags)
>  #define BUS_SPACE_RESTORE_FLAGS(t, h, s) (s = (h).bh_flags)
>  #define BUS_SPACE_ASSERT(t, h, o, n) do {			\
>  	if (bus_space_debug & BSDB_ASSERT)			\
>  		bus_space_assert(t, &(h), o, n);		\
>  	} while(0)
> 

-- 
:wq Claudio