3 #include "xlat/kexec_load_flags.h"
4 #include "xlat/kexec_arch_values.h"
6 #ifndef KEXEC_ARCH_MASK
7 # define KEXEC_ARCH_MASK 0xffff0000
9 #ifndef KEXEC_SEGMENT_MAX
10 # define KEXEC_SEGMENT_MAX 16
14 print_seg(const long seg_buf, const unsigned long seg_bufsz,
15 const long seg_mem, const unsigned long seg_memsz)
19 tprintf(", %lu, ", seg_bufsz);
21 tprintf(", %lu}", seg_memsz);
25 print_kexec_segments(struct tcb *tcp, const unsigned long addr,
26 const unsigned long len)
28 #if SUPPORTED_PERSONALITIES > 1
30 struct { u_int32_t buf, bufsz, mem, memsz; } seg32;
31 struct { u_int64_t buf, bufsz, mem, memsz; } seg64;
34 (current_wordsize == 4 ? sizeof(seg.seg32) : sizeof(seg.seg64))
36 (current_wordsize == 4 ? (uint64_t) seg.seg32.buf : seg.seg64.buf)
38 (current_wordsize == 4 ? (uint64_t) seg.seg32.bufsz : seg.seg64.bufsz)
40 (current_wordsize == 4 ? (uint64_t) seg.seg32.mem : seg.seg64.mem)
42 (current_wordsize == 4 ? (uint64_t) seg.seg32.memsz : seg.seg64.memsz)
50 # define sizeof_seg sizeof(seg)
51 # define seg_buf seg.buf
52 # define seg_bufsz seg.bufsz
53 # define seg_mem seg.mem
54 # define seg_memsz seg.memsz
63 if (len > KEXEC_SEGMENT_MAX) {
68 if (umoven_or_printaddr(tcp, addr, sizeof_seg, &seg))
72 print_seg((unsigned long) seg_buf, seg_bufsz,
73 (unsigned long) seg_mem, seg_memsz);
75 for (i = 1; i < len; ++i) {
77 if (umoven_or_printaddr(tcp, addr + i * sizeof_seg,
80 print_seg((unsigned long) seg_buf, seg_bufsz,
81 (unsigned long) seg_mem, seg_memsz);
91 /* entry, nr_segments */
92 printaddr(tcp->u_arg[0]);
93 tprintf(", %lu, ", tcp->u_arg[1]);
96 print_kexec_segments(tcp, tcp->u_arg[2], tcp->u_arg[1]);
101 printxval(kexec_arch_values, n & KEXEC_ARCH_MASK, "KEXEC_ARCH_???");
102 n &= ~KEXEC_ARCH_MASK;
105 printflags(kexec_load_flags, n, "KEXEC_???");