File: arch_test_handle_binary.h

package info (click to toggle)
criu 4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,500 kB
  • sloc: ansic: 139,280; python: 7,484; sh: 3,824; java: 2,799; makefile: 2,659; asm: 1,137; perl: 206; xml: 117; exp: 45
file content (24 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef __ARCH_TEST_HANDLE_BINARY__
#define __ARCH_TEST_HANDLE_BINARY__

#include <string.h>

#include "uapi/elf64-types.h"
#define arch_run_tests(mem) __run_tests(mem, "")
extern int __run_tests(void *mem, const char *msg);

static __maybe_unused void arch_test_set_elf_hdr_ident(void *mem)
{
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
	memcpy(mem, elf_ident_64_le, sizeof(elf_ident_64_le));
#else
	memcpy(mem, elf_ident_64_be, sizeof(elf_ident_64_be));
#endif
}

static __maybe_unused void arch_test_set_elf_hdr_machine(Ehdr_t *hdr)
{
	hdr->e_machine = EM_PPC64;
}

#endif /* __ARCH_TEST_HANDLE_BINARY__ */