Lines Matching refs:advbuf
41 static void cleanup_adv(unsigned char *advbuf) in cleanup_adv() argument
47 set_32((uint32_t *) advbuf, ADV_MAGIC1); in cleanup_adv()
51 csum -= get_32((uint32_t *) (advbuf + i)); in cleanup_adv()
53 set_32((uint32_t *) (advbuf + 4), csum); in cleanup_adv()
54 set_32((uint32_t *) (advbuf + ADV_SIZE - 4), ADV_MAGIC3); in cleanup_adv()
56 memcpy(advbuf + ADV_SIZE, advbuf, ADV_SIZE); in cleanup_adv()
129 void syslinux_reset_adv(unsigned char *advbuf) in syslinux_reset_adv() argument
132 memset(advbuf + 2 * 4, 0, ADV_LEN); in syslinux_reset_adv()
133 cleanup_adv(advbuf); in syslinux_reset_adv()
156 int syslinux_validate_adv(unsigned char *advbuf) in syslinux_validate_adv() argument
158 if (adv_consistent(advbuf + 0 * ADV_SIZE)) { in syslinux_validate_adv()
159 memcpy(advbuf + ADV_SIZE, advbuf, ADV_SIZE); in syslinux_validate_adv()
161 } else if (adv_consistent(advbuf + 1 * ADV_SIZE)) { in syslinux_validate_adv()
162 memcpy(advbuf, advbuf + ADV_SIZE, ADV_SIZE); in syslinux_validate_adv()
165 syslinux_reset_adv(advbuf); in syslinux_validate_adv()