diff options
author | phk <phk@FreeBSD.org> | 2003-07-22 10:24:41 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-07-22 10:24:41 +0000 |
commit | c4a9334fa698660a5dd1a0c4fddb61ed0893fc58 (patch) | |
tree | 822136a990d18001b2db563f705887b258e810ce /sys | |
parent | b5408a3e8f054d75ddbda2e0f17add2667916d6d (diff) | |
download | FreeBSD-src-c4a9334fa698660a5dd1a0c4fddb61ed0893fc58.zip FreeBSD-src-c4a9334fa698660a5dd1a0c4fddb61ed0893fc58.tar.gz |
Don't attempt to inline large functions mb_alloc() and mb_free(),
it more than doubles the text size of this file.
GCC has wisely ignored us on this previously
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/init_main.c | 5 | ||||
-rw-r--r-- | sys/kern/kern_malloc.c | 9 | ||||
-rw-r--r-- | sys/kern/md5c.c | 1 | ||||
-rw-r--r-- | sys/kern/subr_autoconf.c | 3 | ||||
-rw-r--r-- | sys/kern/subr_clist.c | 2 | ||||
-rw-r--r-- | sys/kern/subr_mbuf.c | 4 | ||||
-rw-r--r-- | sys/kern/subr_prf.c | 20 | ||||
-rw-r--r-- | sys/kern/tty_subr.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_cluster.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 15 |
10 files changed, 48 insertions, 17 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 9af07a9..44e4193 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -211,6 +211,11 @@ restart: if ((*sipp)->subsystem == SI_SUB_DONE) continue; + if (0 && bootverbose) + printf("Sysinit %p(%p) subsys %x order %x\n", + (*sipp)->func, (*sipp)->udata, + (*sipp)->subsystem, (*sipp)->order); + /* Call function */ (*((*sipp)->func))((*sipp)->udata); diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index a90d628..691b211 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -272,14 +272,16 @@ out: * This routine may not block. */ void -free(addr, type) - void *addr; +free(arg, type) + void const *arg; struct malloc_type *type; { register struct malloc_type *ksp = type; uma_slab_t slab; u_long size; + void *addr; + addr = __DECONST(void *, arg); /* free(NULL, ...) does nothing */ if (addr == NULL) return; @@ -387,7 +389,8 @@ reallocf(addr, size, type, flags) { void *mem; - if ((mem = realloc(addr, size, type, flags)) == NULL) + mem = realloc(addr, size, type, flags); + if (mem == NULL) free(addr, type); return (mem); } diff --git a/sys/kern/md5c.c b/sys/kern/md5c.c index af5471c..1181329 100644 --- a/sys/kern/md5c.c +++ b/sys/kern/md5c.c @@ -178,6 +178,7 @@ MD5Update (context, input, inputLen) i = 0; /* Buffer remaining input */ + /*lint -e{669} */ memcpy ((void *)&context->buffer[index], (const void *)&input[i], inputLen-i); } diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index 34c60bc..23c7dc4 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -73,6 +73,9 @@ run_interrupt_driven_config_hooks(dummy) hook_entry != NULL; hook_entry = next_entry) { next_entry = TAILQ_NEXT(hook_entry, ich_links); + printf("IDCH: %p(%p)\n", + hook_entry->ich_func, + hook_entry->ich_arg); (*hook_entry->ich_func)(hook_entry->ich_arg); } diff --git a/sys/kern/subr_clist.c b/sys/kern/subr_clist.c index cc4b32a..f59caf9 100644 --- a/sys/kern/subr_clist.c +++ b/sys/kern/subr_clist.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); static void clist_init(void *); SYSINIT(clist, SI_SUB_CLIST, SI_ORDER_FIRST, clist_init, NULL) -static struct cblock *cfreelist = 0; +static struct cblock *cfreelist = 0; /* XXX: use <sys/queue.h> */ int cfreecount = 0; static int cslushcount; static int ctotcount; diff --git a/sys/kern/subr_mbuf.c b/sys/kern/subr_mbuf.c index 1ab9240..8f24146 100644 --- a/sys/kern/subr_mbuf.c +++ b/sys/kern/subr_mbuf.c @@ -607,7 +607,7 @@ mb_pop_cont(struct mb_lstmngr *mb_list, int how, struct mb_pcpu_list *cnt_lst) * the general container is empty, and we've run out of address space * in our map; then we try to block if we're willing to (M_TRYWAIT). */ -static __inline +static void * mb_alloc(struct mb_lstmngr *mb_list, int how, short type, short persist, int *pers_list) @@ -854,7 +854,7 @@ mb_alloc_wait(struct mb_lstmngr *mb_list, short type) * waiting for the lock; our bucket is in the general container; * our bucket is empty. */ -static __inline +static void mb_free(struct mb_lstmngr *mb_list, void *m, short type, short persist, int *pers_list) diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index d851e60..fa86217 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -237,6 +237,25 @@ log(int level, const char *fmt, ...) msgbuftrigger = 1; } +int +vlog(const char *fmt, va_list ap) +{ + int savintr; + struct putchar_arg pca; + int retval; + + savintr = consintr; /* disable interrupts */ + consintr = 0; + pca.tty = NULL; + pca.flags = log_open ? TOLOG : TOCONS; + pca.pri = -1; + retval = kvprintf(fmt, putchar, &pca, 10, ap); + if (!panicstr) + msgbuftrigger = 1; + consintr = savintr; /* reenable interrupts */ + return (retval); +} + #define CONSCHUNK 128 void @@ -323,6 +342,7 @@ vprintf(const char *fmt, va_list ap) return (retval); } + /* * Print a character on console or users terminal. If destination is * the console then the last bunch of characters are saved in msgbuf for diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index cc4b32a..f59caf9 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); static void clist_init(void *); SYSINIT(clist, SI_SUB_CLIST, SI_ORDER_FIRST, clist_init, NULL) -static struct cblock *cfreelist = 0; +static struct cblock *cfreelist = 0; /* XXX: use <sys/queue.h> */ int cfreecount = 0; static int cslushcount; static int ctotcount; diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index ad0b55d..34dffbb 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -239,7 +239,7 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp) bp->b_ioflags &= ~BIO_ERROR; if ((bp->b_flags & B_ASYNC) || bp->b_iodone != NULL) BUF_KERNPROC(bp); - error = VOP_STRATEGY(vp, bp); + error = BUF_STRATEGY(bp); curproc->p_stats->p_ru.ru_inblock++; if (error) return (error); @@ -293,7 +293,7 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp) rbp->b_ioflags &= ~BIO_ERROR; if ((rbp->b_flags & B_ASYNC) || rbp->b_iodone != NULL) BUF_KERNPROC(rbp); - (void) VOP_STRATEGY(vp, rbp); + BUF_STRATEGY(rbp); curproc->p_stats->p_ru.ru_inblock++; } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index cf0f0fb..25eed7f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3679,14 +3679,13 @@ NDFREE(ndp, flags) * request (obsoleted). Returns 0 on success, or an errno on failure. */ int -vaccess(type, file_mode, file_uid, file_gid, acc_mode, cred, privused) - enum vtype type; - mode_t file_mode; - uid_t file_uid; - gid_t file_gid; - mode_t acc_mode; - struct ucred *cred; - int *privused; +vaccess(enum vtype type, + mode_t file_mode, + uid_t file_uid, + gid_t file_gid, + mode_t acc_mode, + struct ucred *cred, + int *privused) { mode_t dac_granted; #ifdef CAPABILITIES |