diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2004-08-02 19:55:46 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2004-08-02 19:55:46 +0000 |
commit | d8b873fc52e529230648db830ff883d36312a314 (patch) | |
tree | 5b3fd9cd25d4c43856ea5ae3b9ea4327025f7226 /sys/dev | |
parent | 1fd98a6a45515c773bd7c12a1ad4fd04634dd5ae (diff) |
Use some horrible macros to uninline a few functions that are expensive
when inlined and shave a few k from the kernel size.
The goal here was not to make the nicest diff possible, but the smallest.
deraadt@ drahn@ ok
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/isp_inline.h | 36 | ||||
-rw-r--r-- | sys/dev/ic/isp_openbsd.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/isp_openbsd.h | 7 |
3 files changed, 33 insertions, 14 deletions
diff --git a/sys/dev/ic/isp_inline.h b/sys/dev/ic/isp_inline.h index f00b072cdfd..5c8ead1aa71 100644 --- a/sys/dev/ic/isp_inline.h +++ b/sys/dev/ic/isp_inline.h @@ -1,4 +1,4 @@ -/* $OpenBSD: isp_inline.h,v 1.12 2003/03/03 18:33:49 mjacob Exp $ */ +/* $OpenBSD: isp_inline.h,v 1.13 2004/08/02 19:55:45 art Exp $ */ /* * Qlogic Host Adapter Inline Functions * @@ -32,6 +32,11 @@ #ifndef _ISP_INLINE_H #define _ISP_INLINE_H +#ifndef EXP_INLINE +#define EXP_INLINE static __inline +#define EXPENSIVE_INLINE +#endif + /* * Handle Functions. * For each outstanding command there will be a non-zero handle. @@ -114,10 +119,11 @@ isp_remove_handle(struct ispsoftc *isp, XS_T *xs) isp_destroy_handle(isp, isp_find_handle(isp, xs)); } -static INLINE int +EXP_INLINE int isp_getrqentry(struct ispsoftc *, u_int16_t *, u_int16_t *, void **); -static INLINE int +#ifdef EXPENSIVE_INLINE +EXP_INLINE int isp_getrqentry(struct ispsoftc *isp, u_int16_t *iptrp, u_int16_t *optrp, void **resultp) { @@ -136,6 +142,7 @@ isp_getrqentry(struct ispsoftc *isp, u_int16_t *iptrp, *iptrp = iptr; return (0); } +#endif static INLINE void isp_print_qentry (struct ispsoftc *, char *, int, void *); @@ -248,8 +255,8 @@ isp_fc_runstate(struct ispsoftc *isp, int tval) * (with a few exceptions for efficiency). */ -static INLINE void isp_copy_out_hdr(struct ispsoftc *, isphdr_t *, isphdr_t *); -static INLINE void isp_copy_in_hdr(struct ispsoftc *, isphdr_t *, isphdr_t *); +EXP_INLINE void isp_copy_out_hdr(struct ispsoftc *, isphdr_t *, isphdr_t *); +EXP_INLINE void isp_copy_in_hdr(struct ispsoftc *, isphdr_t *, isphdr_t *); static INLINE int isp_get_response_type(struct ispsoftc *, isphdr_t *); static INLINE void @@ -274,14 +281,14 @@ static INLINE void isp_put_icb(struct ispsoftc *, isp_icb_t *, isp_icb_t *); static INLINE void isp_get_pdb(struct ispsoftc *, isp_pdb_t *, isp_pdb_t *); -static INLINE void +EXP_INLINE void isp_get_ct_hdr(struct ispsoftc *isp, ct_hdr_t *, ct_hdr_t *); static INLINE void isp_put_sns_request(struct ispsoftc *, sns_screq_t *, sns_screq_t *); static INLINE void isp_put_gid_ft_request(struct ispsoftc *, sns_gid_ft_req_t *, sns_gid_ft_req_t *); -static INLINE void +EXP_INLINE void isp_put_gxn_id_request(struct ispsoftc *, sns_gxn_id_req_t *, sns_gxn_id_req_t *); static INLINE void @@ -346,7 +353,9 @@ isp_get_notify_ack_fc(struct ispsoftc *, na_fcentry_t *, na_fcentry_t *); /* * Swizzle/Copy Functions */ -static INLINE void + +#ifdef EXPENSIVE_INLINE +EXP_INLINE void isp_copy_out_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst) { if (ISP_IS_SBUS(isp)) { @@ -370,7 +379,7 @@ isp_copy_out_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst) } } -static INLINE void +EXP_INLINE void isp_copy_in_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst) { if (ISP_IS_SBUS(isp)) { @@ -393,6 +402,7 @@ isp_copy_in_hdr(struct ispsoftc *isp, isphdr_t *hpsrc, isphdr_t *hpdst) hpdst->rqs_flags); } } +#endif static INLINE int isp_get_response_type(struct ispsoftc *isp, isphdr_t *hp) @@ -695,7 +705,8 @@ isp_get_pdb(struct ispsoftc *isp, isp_pdb_t *src, isp_pdb_t *dst) /* * CT_HDR canonicalization- only needed for SNS responses */ -static INLINE void +#ifdef EXPENSIVE_INLINE +EXP_INLINE void isp_get_ct_hdr(struct ispsoftc *isp, ct_hdr_t *src, ct_hdr_t *dst) { ISP_IOXGET_8(isp, &src->ct_revision, dst->ct_revision); @@ -715,6 +726,7 @@ isp_get_ct_hdr(struct ispsoftc *isp, ct_hdr_t *src, ct_hdr_t *dst) ISP_IOXGET_8(isp, &src->ct_explanation, dst->ct_explanation); ISP_IOXGET_8(isp, &src->ct_vunique, dst->ct_vunique); } +#endif /* * Generic SNS request - not particularly useful since the per-command data @@ -753,7 +765,8 @@ isp_put_gid_ft_request(struct ispsoftc *isp, sns_gid_ft_req_t *src, ISP_IOXPUT_32(isp, src->snscb_fc4_type, &dst->snscb_fc4_type); } -static INLINE void +#ifdef EXPENSIVE_INLINE +EXP_INLINE void isp_put_gxn_id_request(struct ispsoftc *isp, sns_gxn_id_req_t *src, sns_gxn_id_req_t *dst) { @@ -770,6 +783,7 @@ isp_put_gxn_id_request(struct ispsoftc *isp, sns_gxn_id_req_t *src, ISP_IOXPUT_32(isp, src->snscb_res3, &dst->snscb_res3); ISP_IOXPUT_32(isp, src->snscb_portid, &dst->snscb_portid); } +#endif /* * Generic SNS response - not particularly useful since the per-command data diff --git a/sys/dev/ic/isp_openbsd.c b/sys/dev/ic/isp_openbsd.c index d5400f07e92..fe4625ee47f 100644 --- a/sys/dev/ic/isp_openbsd.c +++ b/sys/dev/ic/isp_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isp_openbsd.c,v 1.26 2003/10/21 18:58:49 jmc Exp $ */ +/* $OpenBSD: isp_openbsd.c,v 1.27 2004/08/02 19:55:45 art Exp $ */ /* * Platform (OpenBSD) dependent common attachment code for Qlogic adapters. * @@ -40,6 +40,8 @@ * San Francisco, CA, 94131 */ +/* expand expensive inline functions here. */ +#define EXPENSIVE_INLINE #include <dev/ic/isp_openbsd.h> /* diff --git a/sys/dev/ic/isp_openbsd.h b/sys/dev/ic/isp_openbsd.h index af343770bea..edcb0781130 100644 --- a/sys/dev/ic/isp_openbsd.h +++ b/sys/dev/ic/isp_openbsd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: isp_openbsd.h,v 1.25 2004/06/24 19:35:23 tholo Exp $ */ +/* $OpenBSD: isp_openbsd.h,v 1.26 2004/08/02 19:55:45 art Exp $ */ /* * OpenBSD Specific definitions for the Qlogic ISP Host Adapter */ @@ -110,7 +110,10 @@ struct isposinfo { * Required Macros/Defines */ -#define INLINE inline +#define INLINE __inline + +/* We don't want expensive inline functions. */ +#define EXP_INLINE #define ISP2100_SCRLEN 0x800 |