build.c (b618d31f112bea3d2daea19190d63e567f32a4db) build.c (2e765c02dcbfc2a8a4527c621a84b9502f6b9bd2)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright (C) 1997 Martin Mares
5 * Copyright (C) 2007 H. Peter Anvin
6 */
7
8/*

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

54#else
55#define PECOFF_COMPAT_RESERVE 0x0
56#endif
57
58static unsigned long efi32_stub_entry;
59static unsigned long efi64_stub_entry;
60static unsigned long efi_pe_entry;
61static unsigned long efi32_pe_entry;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright (C) 1997 Martin Mares
5 * Copyright (C) 2007 H. Peter Anvin
6 */
7
8/*

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

54#else
55#define PECOFF_COMPAT_RESERVE 0x0
56#endif
57
58static unsigned long efi32_stub_entry;
59static unsigned long efi64_stub_entry;
60static unsigned long efi_pe_entry;
61static unsigned long efi32_pe_entry;
62static unsigned long kernel_info;
63static unsigned long _end;
64
65/*----------------------------------------------------------------------*/
66
67static const u32 crctab32[] = {
68 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
69 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
70 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,

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

332
333 p = (char *)buf;
334
335 while (p && *p) {
336 PARSE_ZOFS(p, efi32_stub_entry);
337 PARSE_ZOFS(p, efi64_stub_entry);
338 PARSE_ZOFS(p, efi_pe_entry);
339 PARSE_ZOFS(p, efi32_pe_entry);
62static unsigned long _end;
63
64/*----------------------------------------------------------------------*/
65
66static const u32 crctab32[] = {
67 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
68 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
69 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,

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

331
332 p = (char *)buf;
333
334 while (p && *p) {
335 PARSE_ZOFS(p, efi32_stub_entry);
336 PARSE_ZOFS(p, efi64_stub_entry);
337 PARSE_ZOFS(p, efi_pe_entry);
338 PARSE_ZOFS(p, efi32_pe_entry);
340 PARSE_ZOFS(p, kernel_info);
341 PARSE_ZOFS(p, _end);
342
343 p = strchr(p, '\n');
344 while (p && (*p == '\r' || *p == '\n'))
345 p++;
346 }
347}
348

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

414
415 /* Patch the setup code with the appropriate size parameters */
416 buf[0x1f1] = setup_sectors-1;
417 put_unaligned_le32(sys_size, &buf[0x1f4]);
418
419 update_pecoff_text(setup_sectors * 512, i + (sys_size * 16));
420
421 efi_stub_entry_update();
339 PARSE_ZOFS(p, _end);
340
341 p = strchr(p, '\n');
342 while (p && (*p == '\r' || *p == '\n'))
343 p++;
344 }
345}
346

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

412
413 /* Patch the setup code with the appropriate size parameters */
414 buf[0x1f1] = setup_sectors-1;
415 put_unaligned_le32(sys_size, &buf[0x1f4]);
416
417 update_pecoff_text(setup_sectors * 512, i + (sys_size * 16));
418
419 efi_stub_entry_update();
422 /* Update kernel_info offset. */
423 put_unaligned_le32(kernel_info, &buf[0x268]);
424
425 crc = partial_crc32(buf, i, crc);
426 if (fwrite(buf, 1, i, dest) != i)
427 die("Writing setup failed");
428
429 /* Copy the kernel code */
430 crc = partial_crc32(kernel, sz, crc);
431 if (fwrite(kernel, 1, sz, dest) != sz)

--- 23 unchanged lines hidden ---
420
421 crc = partial_crc32(buf, i, crc);
422 if (fwrite(buf, 1, i, dest) != i)
423 die("Writing setup failed");
424
425 /* Copy the kernel code */
426 crc = partial_crc32(kernel, sz, crc);
427 if (fwrite(kernel, 1, sz, dest) != sz)

--- 23 unchanged lines hidden ---