Lines Matching refs:advbuf
33 static void cleanup_adv(unsigned char *advbuf) in cleanup_adv() argument
39 *(uint32_t *)advbuf = ADV_MAGIC1; in cleanup_adv()
43 csum -= *(uint32_t *)(advbuf + i); in cleanup_adv()
45 *(uint32_t *)(advbuf + 4) = csum; in cleanup_adv()
46 *(uint32_t *)(advbuf + ADV_SIZE - 4) = ADV_MAGIC3; in cleanup_adv()
48 memcpy(advbuf + ADV_SIZE, advbuf, ADV_SIZE); in cleanup_adv()
51 void syslinux_reset_adv(unsigned char *advbuf) in syslinux_reset_adv() argument
54 memset(advbuf + 2 * 4, 0, ADV_LEN); in syslinux_reset_adv()
55 cleanup_adv(advbuf); in syslinux_reset_adv()
78 int syslinux_validate_adv(unsigned char *advbuf) in syslinux_validate_adv() argument
80 if (adv_consistent(advbuf + 0 * ADV_SIZE)) { in syslinux_validate_adv()
81 memcpy(advbuf + ADV_SIZE, advbuf, ADV_SIZE); in syslinux_validate_adv()
83 } else if (adv_consistent(advbuf + 1 * ADV_SIZE)) { in syslinux_validate_adv()
84 memcpy(advbuf, advbuf + ADV_SIZE, ADV_SIZE); in syslinux_validate_adv()
87 syslinux_reset_adv(advbuf); in syslinux_validate_adv()
219 unsigned char *advbuf = syslinux_adv; in efi_adv_write() local
255 cleanup_adv(advbuf); in efi_adv_write()
256 err = syslinux_validate_adv(advbuf) ? -2 : 0; in efi_adv_write()
273 if (efi_xpwrite(fd, advbuf, 2 * ADV_SIZE, in efi_adv_write()