bootinfo32.c (bca9c87b6104219af35ae5ea4a6af098a1631bca) | bootinfo32.c (5d1531d9d4e7d1b1b706ab23ac3f864416e87522) |
---|---|
1/*- 2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 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 --- 31 unchanged lines hidden (view full) --- 40 41#ifdef LOADER_GELI_SUPPORT 42#include "geliboot.h" 43#endif 44 45static struct bootinfo bi; 46 47/* | 1/*- 2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 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 --- 31 unchanged lines hidden (view full) --- 40 41#ifdef LOADER_GELI_SUPPORT 42#include "geliboot.h" 43#endif 44 45static struct bootinfo bi; 46 47/* |
48 * We have 4 byte alignment for 32-bit targets. This code is compiled as 32-bit 49 * code... 50 */ 51#define MOD_ALIGN(l) roundup(l, sizeof(u_long)) 52 53static vm_offset_t 54bi_copymodules32(vm_offset_t addr) 55{ 56 struct preloaded_file *fp; 57 struct file_metadata *md; 58 int c; 59 60 c = addr != 0; 61 /* start with the first module on the list, should be the kernel */ 62 for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { 63 64 MOD_NAME(addr, fp->f_name, c); /* this field must come first */ 65 MOD_TYPE(addr, fp->f_type, c); 66 if (fp->f_args) 67 MOD_ARGS(addr, fp->f_args, c); 68 MOD_ADDR(addr, fp->f_addr, c); 69 MOD_SIZE(addr, fp->f_size, c); 70 for (md = fp->f_metadata; md != NULL; md = md->md_next) 71 if (!(md->md_type & MODINFOMD_NOCOPY)) 72 MOD_METADATA(addr, md, c); 73 } 74 MOD_END(addr, c); 75 return(addr); 76} 77 78/* | |
79 * Load the information expected by an i386 kernel. 80 * 81 * - The 'boothowto' argument is constructed 82 * - The 'bootdev' argument is constructed 83 * - The 'bootinfo' struct is constructed, and copied into the kernel space. 84 * - The kernel environment is copied into kernel space. 85 * - Module metadata are formatted and placed in kernel space. 86 */ --- 87 unchanged lines hidden (view full) --- 174 bios_addsmapdata(kfp); 175#ifdef LOADER_GELI_SUPPORT 176 geli_export_key_metadata(kfp); 177#endif 178 bi_load_vbe_data(kfp); 179 180 /* Figure out the size and location of the metadata */ 181 *modulep = addr; | 48 * Load the information expected by an i386 kernel. 49 * 50 * - The 'boothowto' argument is constructed 51 * - The 'bootdev' argument is constructed 52 * - The 'bootinfo' struct is constructed, and copied into the kernel space. 53 * - The kernel environment is copied into kernel space. 54 * - Module metadata are formatted and placed in kernel space. 55 */ --- 87 unchanged lines hidden (view full) --- 143 bios_addsmapdata(kfp); 144#ifdef LOADER_GELI_SUPPORT 145 geli_export_key_metadata(kfp); 146#endif 147 bi_load_vbe_data(kfp); 148 149 /* Figure out the size and location of the metadata */ 150 *modulep = addr; |
182 size = bi_copymodules32(0); | 151 size = md_copymodules(0, false); |
183 kernend = roundup(addr + size, PAGE_SIZE); 184 *kernendp = kernend; 185 186 /* patch MODINFOMD_KERNEND */ 187 md = file_findmetadata(kfp, MODINFOMD_KERNEND); 188 bcopy(&kernend, md->md_data, sizeof kernend); 189 190 /* copy module list and metadata */ | 152 kernend = roundup(addr + size, PAGE_SIZE); 153 *kernendp = kernend; 154 155 /* patch MODINFOMD_KERNEND */ 156 md = file_findmetadata(kfp, MODINFOMD_KERNEND); 157 bcopy(&kernend, md->md_data, sizeof kernend); 158 159 /* copy module list and metadata */ |
191 (void)bi_copymodules32(addr); | 160 (void)md_copymodules(addr, false); |
192 193 ssym = esym = 0; 194 md = file_findmetadata(kfp, MODINFOMD_SSYM); 195 if (md != NULL) 196 ssym = *((vm_offset_t *)&(md->md_data)); 197 md = file_findmetadata(kfp, MODINFOMD_ESYM); 198 if (md != NULL) 199 esym = *((vm_offset_t *)&(md->md_data)); --- 30 unchanged lines hidden --- | 161 162 ssym = esym = 0; 163 md = file_findmetadata(kfp, MODINFOMD_SSYM); 164 if (md != NULL) 165 ssym = *((vm_offset_t *)&(md->md_data)); 166 md = file_findmetadata(kfp, MODINFOMD_ESYM); 167 if (md != NULL) 168 esym = *((vm_offset_t *)&(md->md_data)); --- 30 unchanged lines hidden --- |