Deleted Added
full compact
kern_linker.c (83366) kern_linker.c (85736)
1/*-
2 * Copyright (c) 1997-2000 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1997-2000 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/kern/kern_linker.c 83366 2001-09-12 08:38:13Z julian $
26 * $FreeBSD: head/sys/kern/kern_linker.c 85736 2001-10-30 15:21:45Z green $
27 */
28
29#include "opt_ddb.h"
30
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/systm.h>
34#include <sys/malloc.h>

--- 1662 unchanged lines hidden (view full) ---

1697 }
1698 }
1699
1700 if (error)
1701 return error;
1702 linker_addmodules(lf, start, stop, 0);
1703 return error;
1704}
27 */
28
29#include "opt_ddb.h"
30
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/systm.h>
34#include <sys/malloc.h>

--- 1662 unchanged lines hidden (view full) ---

1697 }
1698 }
1699
1700 if (error)
1701 return error;
1702 linker_addmodules(lf, start, stop, 0);
1703 return error;
1704}
1705
1706static int
1707sysctl_kern_function_list_iterate(const char *name, void *opaque)
1708{
1709 struct sysctl_req *req;
1710
1711 req = opaque;
1712 return (SYSCTL_OUT(req, name, strlen(name) + 1));
1713}
1714
1715/*
1716 * Export a nul-separated, double-nul-terminated list of all function names
1717 * in the kernel.
1718 */
1719static int
1720sysctl_kern_function_list(SYSCTL_HANDLER_ARGS)
1721{
1722 linker_file_t lf;
1723 int error;
1724
1725 TAILQ_FOREACH(lf, &linker_files, link) {
1726 error = LINKER_EACH_FUNCTION_NAME(lf,
1727 sysctl_kern_function_list_iterate, req);
1728 if (error)
1729 return (error);
1730 }
1731 return (SYSCTL_OUT(req, "", 1));
1732}
1733
1734SYSCTL_PROC(_kern, OID_AUTO, function_list, CTLFLAG_RD,
1735 NULL, 0, sysctl_kern_function_list, "", "kernel function list");