summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-06-01 21:49:55 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-06-01 21:49:55 +0000
commit2c857e286a26062ca542a7a95e993107dc8c82e6 (patch)
tree928db3e4c1a995f06604683bba8c4b549908d0eb
parentb50b4bd1373e9c04c2d7b801ee3d7cd82c347e4a (diff)
De-inline a few functions if option SMALL_KERNEL, and do not compile
ahc_print_scb() unless option AHC_DEBUG. Saves about 3KB on alpha RAMDISK{,B}. ok deraadt@
-rw-r--r--sys/dev/ic/aic7xxx.c9
-rw-r--r--sys/dev/ic/aic7xxx_inline.h42
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.h4
3 files changed, 40 insertions, 15 deletions
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index f9013a61684..ab0f2eeef94 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx.c,v 1.64 2005/04/17 18:54:41 tom Exp $ */
+/* $OpenBSD: aic7xxx.c,v 1.65 2005/06/01 21:49:53 miod Exp $ */
/* $NetBSD: aic7xxx.c,v 1.108 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -40,7 +40,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: aic7xxx.c,v 1.64 2005/04/17 18:54:41 tom Exp $
+ * $Id: aic7xxx.c,v 1.65 2005/06/01 21:49:53 miod Exp $
*/
/*
* Ported from FreeBSD by Pascal Renauld, Network Storage Solutions, Inc. - April 2003
@@ -50,6 +50,9 @@
/* __FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.100 2004/05/11 20:39:46 gibbs Exp $"); */
#include <dev/ic/aic7xxx_openbsd.h>
+#ifdef SMALL_KERNEL
+#define IO_EXPAND
+#endif
#include <dev/ic/aic7xxx_inline.h>
#include <dev/microcode/aic7xxx/aicasm_insformat.h>
@@ -1578,7 +1581,6 @@ ahc_clear_intstat(struct ahc_softc *ahc)
/**************************** Debugging Routines ******************************/
#ifdef AHC_DEBUG
uint32_t ahc_debug = 0; /* AHC_SHOW_MISC|AHC_SHOW_SENSE|AHC_DEBUG_OPTS;*/
-#endif
void
ahc_print_scb(struct scb *scb)
@@ -1612,6 +1614,7 @@ ahc_print_scb(struct scb *scb)
}
}
}
+#endif
/************************* Transfer Negotiation *******************************/
/*
diff --git a/sys/dev/ic/aic7xxx_inline.h b/sys/dev/ic/aic7xxx_inline.h
index 4d61cf86356..02b6e137d40 100644
--- a/sys/dev/ic/aic7xxx_inline.h
+++ b/sys/dev/ic/aic7xxx_inline.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_inline.h,v 1.9 2004/10/24 04:28:33 krw Exp $ */
+/* $OpenBSD: aic7xxx_inline.h,v 1.10 2005/06/01 21:49:54 miod Exp $ */
/* $NetBSD: aic7xxx_inline.h,v 1.4 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -51,6 +51,13 @@
#ifndef _AIC7XXX_INLINE_H_
#define _AIC7XXX_INLINE_H_
+#ifdef SMALL_KERNEL
+#define IO_INLINE
+#else
+#define IO_INLINE static __inline
+#define IO_EXPAND
+#endif
+
/************************* Sequencer Execution Control ************************/
static __inline void ahc_pause_bug_fix(struct ahc_softc *ahc);
static __inline int ahc_is_paused(struct ahc_softc *ahc);
@@ -244,6 +251,7 @@ static __inline struct ahc_initiator_tinfo *
char channel, u_int our_id,
u_int remote_id,
struct ahc_tmode_tstate **tstate);
+
static __inline uint16_t
ahc_inw(struct ahc_softc *ahc, u_int port);
static __inline void ahc_outw(struct ahc_softc *ahc, u_int port,
@@ -256,12 +264,12 @@ static __inline uint64_t
ahc_inq(struct ahc_softc *ahc, u_int port);
static __inline void ahc_outq(struct ahc_softc *ahc, u_int port,
uint64_t value);
-static __inline struct scb*
+IO_INLINE struct scb*
ahc_get_scb(struct ahc_softc *ahc);
-static __inline void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb);
-static __inline void ahc_swap_with_next_hscb(struct ahc_softc *ahc,
+IO_INLINE void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb);
+IO_INLINE void ahc_swap_with_next_hscb(struct ahc_softc *ahc,
struct scb *scb);
-static __inline void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb);
+IO_INLINE void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb);
static __inline struct scsi_sense_data *
ahc_get_sense_buf(struct ahc_softc *ahc,
struct scb *scb);
@@ -360,10 +368,12 @@ ahc_outq(struct ahc_softc *ahc, u_int port, uint64_t value)
ahc_outb(ahc, port+7, (value >> 56) & 0xFF);
}
+#ifdef IO_EXPAND
+
/*
* Get a free scb. If there are none, see if we can allocate a new SCB.
*/
-static __inline struct scb *
+IO_INLINE struct scb *
ahc_get_scb(struct ahc_softc *ahc)
{
struct scb *scb;
@@ -381,7 +391,7 @@ ahc_get_scb(struct ahc_softc *ahc)
/*
* Return an SCB resource to the free list.
*/
-static __inline void
+IO_INLINE void
ahc_free_scb(struct ahc_softc *ahc, struct scb *scb)
{
struct hardware_scb *hscb;
@@ -398,6 +408,8 @@ ahc_free_scb(struct ahc_softc *ahc, struct scb *scb)
ahc_platform_scb_free(ahc, scb);
}
+#endif /* IO_EXPAND */
+
static __inline struct scb *
ahc_lookup_scb(struct ahc_softc *ahc, u_int tag)
{
@@ -410,7 +422,9 @@ ahc_lookup_scb(struct ahc_softc *ahc, u_int tag)
return (scb);
}
-static __inline void
+#ifdef IO_EXPAND
+
+IO_INLINE void
ahc_swap_with_next_hscb(struct ahc_softc *ahc, struct scb *scb)
{
struct hardware_scb *q_hscb;
@@ -450,7 +464,7 @@ ahc_swap_with_next_hscb(struct ahc_softc *ahc, struct scb *scb)
/*
* Tell the sequencer about a new transaction to execute.
*/
-static __inline void
+IO_INLINE void
ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb)
{
ahc_swap_with_next_hscb(ahc, scb);
@@ -494,6 +508,8 @@ ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb)
}
}
+#endif /* IO_EXPAND */
+
static __inline struct scsi_sense_data *
ahc_get_sense_buf(struct ahc_softc *ahc, struct scb *scb)
{
@@ -518,7 +534,7 @@ static __inline void ahc_sync_qoutfifo(struct ahc_softc *ahc, int op);
static __inline void ahc_sync_qinfifo(struct ahc_softc *ahc, int op);
static __inline void ahc_sync_tqinfifo(struct ahc_softc *ahc, int op);
static __inline u_int ahc_check_cmdcmpltqueues(struct ahc_softc *ahc);
-static __inline int ahc_intr(struct ahc_softc *ahc);
+IO_INLINE int ahc_intr(struct ahc_softc *ahc);
static __inline void
ahc_sync_qoutfifo(struct ahc_softc *ahc, int op)
@@ -580,10 +596,12 @@ ahc_check_cmdcmpltqueues(struct ahc_softc *ahc)
return (retval);
}
+#ifdef IO_EXPAND
+
/*
* Catch an interrupt from the adapter
*/
-static __inline int
+IO_INLINE int
ahc_intr(struct ahc_softc *ahc)
{
u_int intstat;
@@ -665,4 +683,6 @@ ahc_intr(struct ahc_softc *ahc)
return (1);
}
+#endif /* IO_EXPAND */
+
#endif /* _AIC7XXX_INLINE_H_ */
diff --git a/sys/dev/ic/aic7xxx_openbsd.h b/sys/dev/ic/aic7xxx_openbsd.h
index f06753dcb25..88c101b88fa 100644
--- a/sys/dev/ic/aic7xxx_openbsd.h
+++ b/sys/dev/ic/aic7xxx_openbsd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.h,v 1.14 2005/02/12 15:32:12 krw Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.h,v 1.15 2005/06/01 21:49:54 miod Exp $ */
/* $NetBSD: aic7xxx_osm.h,v 1.7 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -76,7 +76,9 @@
#define AHC_PCI_CONFIG 1
#endif
+#if 0
#define AHC_DEBUG AHC_SHOW_SENSE | AHC_SHOW_MISC | AHC_SHOW_CMDS
+#endif
#ifdef DEBUG
#define bootverbose 1