bootinfo64.c (56e53cb8ef000c3ef72337a4095987a932cdedef) bootinfo64.c (c1418270b28edf9b99044181e9f48dfc0a7dc160)
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

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

37#include <machine/psl.h>
38#include <machine/specialreg.h>
39#include "bootstrap.h"
40#include "libi386.h"
41#include "btxv86.h"
42
43#ifdef LOADER_GELI_SUPPORT
44#include "geliboot.h"
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

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

37#include <machine/psl.h>
38#include <machine/specialreg.h>
39#include "bootstrap.h"
40#include "libi386.h"
41#include "btxv86.h"
42
43#ifdef LOADER_GELI_SUPPORT
44#include "geliboot.h"
45
46static const size_t keybuf_size = sizeof(struct keybuf) +
47 (GELI_MAX_KEYS * sizeof(struct keybuf_ent));
48#endif
49
50/*
51 * Copy module-related data into the load area, where it can be
52 * used as a directory for loaded modules.
53 *
54 * Module data is presented in a self-describing format. Each datum
55 * is preceded by a 32-bit identifier and a 32-bit size field.

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

191 struct i386_devdesc *rootdev;
192 struct file_metadata *md;
193 uint64_t kernend;
194 uint64_t envp;
195 uint64_t module;
196 vm_offset_t size;
197 char *rootdevname;
198 int howto;
45#endif
46
47/*
48 * Copy module-related data into the load area, where it can be
49 * used as a directory for loaded modules.
50 *
51 * Module data is presented in a self-describing format. Each datum
52 * is preceded by a 32-bit identifier and a 32-bit size field.

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

188 struct i386_devdesc *rootdev;
189 struct file_metadata *md;
190 uint64_t kernend;
191 uint64_t envp;
192 uint64_t module;
193 vm_offset_t size;
194 char *rootdevname;
195 int howto;
199#ifdef LOADER_GELI_SUPPORT
200 char buf[keybuf_size];
201 struct keybuf *keybuf = (struct keybuf *)buf;
202#endif
203
204 if (!bi_checkcpu()) {
205 printf("CPU doesn't support long mode\n");
206 return (EINVAL);
207 }
208
209 howto = bi_getboothowto(args);
210

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

243 panic("can't find kernel file");
244 kernend = 0; /* fill it in later */
245 file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto);
246 file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp);
247 file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend);
248 file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof module, &module);
249 if (add_smap != 0)
250 bios_addsmapdata(kfp);
196
197 if (!bi_checkcpu()) {
198 printf("CPU doesn't support long mode\n");
199 return (EINVAL);
200 }
201
202 howto = bi_getboothowto(args);
203

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

236 panic("can't find kernel file");
237 kernend = 0; /* fill it in later */
238 file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto);
239 file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp);
240 file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend);
241 file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof module, &module);
242 if (add_smap != 0)
243 bios_addsmapdata(kfp);
251
252#ifdef LOADER_GELI_SUPPORT
244#ifdef LOADER_GELI_SUPPORT
253 geli_fill_keybuf(keybuf);
254 file_addmetadata(kfp, MODINFOMD_KEYBUF, keybuf_size, buf);
255 bzero(buf, sizeof(buf));
245 geli_export_key_metadata(kfp);
256#endif
257
258 size = bi_copymodules64(0);
259
260 /* copy our environment */
261 envp = roundup(addr + size, PAGE_SIZE);
262 addr = bi_copyenv(envp);
263

--- 17 unchanged lines hidden ---
246#endif
247
248 size = bi_copymodules64(0);
249
250 /* copy our environment */
251 envp = roundup(addr + size, PAGE_SIZE);
252 addr = bi_copyenv(envp);
253

--- 17 unchanged lines hidden ---