Deleted Added
full compact
metadata.c (183198) metadata.c (199534)
1/*-
2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
3 * Copyright (C) 2006 Semihalf, Piotr Kruszynski <ppk@semihalf.com>
4 * Copyright (C) 2007-2008 Semihalf, Rafal Jaworowski <raj@semihalf.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
3 * Copyright (C) 2006 Semihalf, Piotr Kruszynski <ppk@semihalf.com>
4 * Copyright (C) 2007-2008 Semihalf, Rafal Jaworowski <raj@semihalf.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/boot/uboot/common/metadata.c 183198 2008-09-19 19:49:58Z sobomax $");
30__FBSDID("$FreeBSD: head/sys/boot/uboot/common/metadata.c 199534 2009-11-19 16:25:41Z raj $");
31
32#include <stand.h>
33#include <sys/param.h>
34#include <sys/reboot.h>
35#include <sys/linker.h>
36
37#include <machine/elf.h>
38#include <machine/metadata.h>

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

226}
227
228static vm_offset_t
229md_copymodules(vm_offset_t addr)
230{
231 struct preloaded_file *fp;
232 struct file_metadata *md;
233 int c;
31
32#include <stand.h>
33#include <sys/param.h>
34#include <sys/reboot.h>
35#include <sys/linker.h>
36
37#include <machine/elf.h>
38#include <machine/metadata.h>

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

226}
227
228static vm_offset_t
229md_copymodules(vm_offset_t addr)
230{
231 struct preloaded_file *fp;
232 struct file_metadata *md;
233 int c;
234 vm_offset_t a;
234
235 c = addr != 0;
236 /* start with the first module on the list, should be the kernel */
237 for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) {
238
239 MOD_NAME(addr, fp->f_name, c); /* this field must be first */
240 MOD_TYPE(addr, fp->f_type, c);
241 if (fp->f_args)
242 MOD_ARGS(addr, fp->f_args, c);
235
236 c = addr != 0;
237 /* start with the first module on the list, should be the kernel */
238 for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) {
239
240 MOD_NAME(addr, fp->f_name, c); /* this field must be first */
241 MOD_TYPE(addr, fp->f_type, c);
242 if (fp->f_args)
243 MOD_ARGS(addr, fp->f_args, c);
243 MOD_ADDR(addr, fp->f_addr, c);
244 a = fp->f_addr - __elfN(relocation_offset);
245 MOD_ADDR(addr, a, c);
244 MOD_SIZE(addr, fp->f_size, c);
245 for (md = fp->f_metadata; md != NULL; md = md->md_next) {
246 if (!(md->md_type & MODINFOMD_NOCOPY))
247 MOD_METADATA(addr, md, c);
248 }
249 }
250 MOD_END(addr, c);
251 return(addr);

--- 206 unchanged lines hidden ---
246 MOD_SIZE(addr, fp->f_size, c);
247 for (md = fp->f_metadata; md != NULL; md = md->md_next) {
248 if (!(md->md_type & MODINFOMD_NOCOPY))
249 MOD_METADATA(addr, md, c);
250 }
251 }
252 MOD_END(addr, c);
253 return(addr);

--- 206 unchanged lines hidden ---