Print this page
10686 Debug macros causes smatch issues


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 




  25 #ifndef _SYS_PCIEB_H
  26 #define _SYS_PCIEB_H
  27 
  28 #ifdef  __cplusplus
  29 extern "C" {
  30 #endif
  31 
  32 #if defined(DEBUG)
  33 #define PCIEB_DEBUG pcieb_dbg
  34 extern void pcieb_dbg(uint_t bit, dev_info_t *dip, char *fmt, ...);
  35 #else /* DEBUG */
  36 #define PCIEB_DEBUG 0 &&
  37 #endif /* DEBUG */
  38 
  39 typedef enum {  /* same sequence as pcieb_debug_sym[] */
  40         /*  0 */ DBG_ATTACH,
  41         /*  1 */ DBG_PWR,
  42         /*  2 */ DBG_INTR
  43 } pcieb_debug_bit_t;
  44 
  45 /*
  46  * Intel specific register offsets with bit definitions.
  47  */
  48 #define PCIEB_PX_CAPABILITY_ID  0x44
  49 #define PCIEB_BRIDGE_CONF               0x40
  50 
  51 /*
  52  * PCI/PCI-E Configuration register specific values.
  53  */
  54 #define PX_PMODE        0x4000          /* PCI/PCIX Mode */
  55 #define PX_PFREQ_66     0x200           /* PCI clock frequency */
  56 #define PX_PFREQ_100    0x400




   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 
  25 /*
  26  * Copyright 2019, Joyent, Inc.
  27  */
  28 
  29 #ifndef _SYS_PCIEB_H
  30 #define _SYS_PCIEB_H
  31 
  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 #if defined(DEBUG)
  37 #define PCIEB_DEBUG pcieb_dbg
  38 extern void pcieb_dbg(uint_t bit, dev_info_t *dip, char *fmt, ...);
  39 #else /* DEBUG */
  40 #define PCIEB_DEBUG(...)
  41 #endif /* DEBUG */
  42 
  43 typedef enum {  /* same sequence as pcieb_debug_sym[] */
  44         /*  0 */ DBG_ATTACH,
  45         /*  1 */ DBG_PWR,
  46         /*  2 */ DBG_INTR
  47 } pcieb_debug_bit_t;
  48 
  49 /*
  50  * Intel specific register offsets with bit definitions.
  51  */
  52 #define PCIEB_PX_CAPABILITY_ID  0x44
  53 #define PCIEB_BRIDGE_CONF               0x40
  54 
  55 /*
  56  * PCI/PCI-E Configuration register specific values.
  57  */
  58 #define PX_PMODE        0x4000          /* PCI/PCIX Mode */
  59 #define PX_PFREQ_66     0x200           /* PCI clock frequency */
  60 #define PX_PFREQ_100    0x400