Lines Matching refs:ex
323 const struct exec *ex; in gethdr() local
343 ex = p; in gethdr()
344 if (hdr->size >= sizeof(struct exec) && !N_BADMAG(*ex)) { in gethdr()
346 x = N_GETMAGIC(*ex); in gethdr()
353 hdr->text = le32toh(ex->a_text); in gethdr()
354 hdr->data = le32toh(ex->a_data); in gethdr()
355 hdr->bss = le32toh(ex->a_bss); in gethdr()
356 hdr->entry = le32toh(ex->a_entry); in gethdr()
357 if (le32toh(ex->a_entry) >= BTX_PGSIZE) in gethdr()
400 struct exec ex; in puthdr() local
405 memset(&ex, 0, sizeof(ex)); in puthdr()
406 N_SETMAGIC(ex, ZMAGIC, MID_I386, 0); in puthdr()
407 hdr->text = N_ALIGN(ex, hdr->text); in puthdr()
408 ex.a_text = htole32(hdr->text); in puthdr()
409 hdr->data = N_ALIGN(ex, hdr->data); in puthdr()
410 ex.a_data = htole32(hdr->data); in puthdr()
411 ex.a_entry = htole32(hdr->entry); in puthdr()
412 writex(fd, &ex, sizeof(ex)); in puthdr()
413 hdr->size = N_ALIGN(ex, sizeof(ex)); in puthdr()