Use __noinline.

This commit is contained in:
ad 2008-05-31 13:31:25 +00:00
parent 07e5e1909a
commit e10320350c
3 changed files with 11 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_mutex.c,v 1.42 2008/05/31 13:15:21 ad Exp $ */
/* $NetBSD: kern_mutex.c,v 1.43 2008/05/31 13:31:25 ad Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -40,7 +40,7 @@
#define __MUTEX_PRIVATE
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.42 2008/05/31 13:15:21 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.43 2008/05/31 13:31:25 ad Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -306,17 +306,12 @@ mutex_dump(volatile void *cookie)
* generates a lot of machine code in the DIAGNOSTIC case, so
* we ask the compiler to not inline it.
*/
#if __GNUC_PREREQ__(3, 0)
__attribute ((noinline)) __attribute ((noreturn))
#endif
void
void __noinline
mutex_abort(kmutex_t *mtx, const char *func, const char *msg)
{
LOCKDEBUG_ABORT(mtx, (MUTEX_SPIN_P(mtx) ?
&mutex_spin_lockops : &mutex_adaptive_lockops), func, msg);
/* NOTREACHED */
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_rwlock.c,v 1.25 2008/05/31 13:15:21 ad Exp $ */
/* $NetBSD: kern_rwlock.c,v 1.26 2008/05/31 13:31:25 ad Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.25 2008/05/31 13:15:21 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.26 2008/05/31 13:31:25 ad Exp $");
#define __RWLOCK_PRIVATE
@ -182,10 +182,7 @@ rw_dump(volatile void *cookie)
* generates a lot of machine code in the DIAGNOSTIC case, so
* we ask the compiler to not inline it.
*/
#if __GNUC_PREREQ__(3, 0)
__attribute ((noinline))
#endif
static void
static void __noinline
rw_abort(krwlock_t *rw, const char *func, const char *msg)
{

View File

@ -1,7 +1,7 @@
/* $NetBSD: subr_pool.c,v 1.160 2008/04/28 20:24:04 martin Exp $ */
/* $NetBSD: subr_pool.c,v 1.161 2008/05/31 13:31:25 ad Exp $ */
/*-
* Copyright (c) 1997, 1999, 2000, 2002, 2007 The NetBSD Foundation, Inc.
* Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.160 2008/04/28 20:24:04 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.161 2008/05/31 13:31:25 ad Exp $");
#include "opt_ddb.h"
#include "opt_pool.h"
@ -2390,10 +2390,7 @@ pool_cache_cpu_exit(pool_cache_cpu_t *cc, int *s)
KPREEMPT_ENABLE(curlwp);
}
#if __GNUC_PREREQ__(3, 0)
__attribute ((noinline))
#endif
pool_cache_cpu_t *
pool_cache_cpu_t * __noinline
pool_cache_get_slow(pool_cache_cpu_t *cc, int *s, void **objectp,
paddr_t *pap, int flags)
{
@ -2544,10 +2541,7 @@ pool_cache_get_paddr(pool_cache_t pc, int flags, paddr_t *pap)
return object;
}
#if __GNUC_PREREQ__(3, 0)
__attribute ((noinline))
#endif
pool_cache_cpu_t *
pool_cache_cpu_t * __noinline
pool_cache_put_slow(pool_cache_cpu_t *cc, int *s, void *object, paddr_t pa)
{
pcg_t *pcg, *cur;