Lines Matching +full:we +full:- +full:off +full:- +full:ns

1 // SPDX-License-Identifier: GPL-2.0-or-later
25 0xffffffff, /* real-mode = true */
26 0x02000000, /* real-base, i.e. where we expect OF to be */
27 0xffffffff, /* real-size */
28 0xffffffff, /* virt-base */
29 0xffffffff, /* virt-size */
30 0x4000, /* load-base */
34 static const char rpaname[] = "IBM,RPA-Client-Config";
49 -1, /* min_load */
64 #define GET_16BE(off) ((buf[off] << 8) + (buf[(off)+1])) argument
65 #define GET_32BE(off) ((GET_16BE(off) << 16U) + GET_16BE((off)+2U)) argument
66 #define GET_64BE(off) ((((unsigned long long)GET_32BE(off)) << 32ULL) + \ argument
67 ((unsigned long long)GET_32BE((off)+4ULL)))
68 #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \ argument
69 buf[(off) + 1] = (v) & 0xff)
70 #define PUT_32BE(off, v)(PUT_16BE((off), (v) >> 16L), PUT_16BE((off) + 2, (v))) argument
71 #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \ argument
72 PUT_32BE((off) + 4, (v))))
74 #define GET_16LE(off) ((buf[off]) + (buf[(off)+1] << 8)) argument
75 #define GET_32LE(off) (GET_16LE(off) + (GET_16LE((off)+2U) << 16U)) argument
76 #define GET_64LE(off) ((unsigned long long)GET_32LE(off) + \ argument
77 (((unsigned long long)GET_32LE((off)+4ULL)) << 32ULL))
78 #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \ argument
79 buf[(off) + 1] = ((v) >> 8) & 0xff)
80 #define PUT_32LE(off, v) (PUT_16LE((off), (v)), PUT_16LE((off) + 2, (v) >> 16L)) argument
81 #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L)) argument
83 #define GET_16(off) (e_data == ELFDATA2MSB ? GET_16BE(off) : GET_16LE(off)) argument
84 #define GET_32(off) (e_data == ELFDATA2MSB ? GET_32BE(off) : GET_32LE(off)) argument
85 #define GET_64(off) (e_data == ELFDATA2MSB ? GET_64BE(off) : GET_64LE(off)) argument
86 #define PUT_16(off, v) (e_data == ELFDATA2MSB ? PUT_16BE(off, v) : \ argument
87 PUT_16LE(off, v))
88 #define PUT_32(off, v) (e_data == ELFDATA2MSB ? PUT_32BE(off, v) : \ argument
89 PUT_32LE(off, v))
90 #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \ argument
91 PUT_64LE(off, v))
119 long nnote, nnote2, ns; in main() local
122 fprintf(stderr, "Usage: %s elf-file\n", av[0]); in main()
168 /* XXX check that the area we want to use is all zeroes */ in main()
174 ns = ph + 2 * ps; in main()
177 PUT_32(ph + PH_OFFSET, ns); in main()
179 PUT_64(ph + PH_OFFSET, ns); in main()
186 /* fill in the note area we point to */ in main()
187 /* XXX we should probably make this a proper section */ in main()
188 PUT_32(ns, strlen(arch) + 1); in main()
189 PUT_32(ns + 4, N_DESCR * 4); in main()
190 PUT_32(ns + 8, 0x1275); in main()
191 strcpy((char *) &buf[ns + 12], arch); in main()
192 ns += 12 + strlen(arch) + 1; in main()
193 for (i = 0; i < N_DESCR; ++i, ns += 4) in main()
194 PUT_32BE(ns, descr[i]); in main()
200 PUT_32(ph + PH_OFFSET, ns); in main()
202 PUT_64(ph + PH_OFFSET, ns); in main()
209 /* fill in the note area we point to */ in main()
210 PUT_32(ns, strlen(rpaname) + 1); in main()
211 PUT_32(ns + 4, sizeof(rpanote)); in main()
212 PUT_32(ns + 8, 0x12759999); in main()
213 strcpy((char *) &buf[ns + 12], rpaname); in main()
214 ns += 12 + ROUNDUP(strlen(rpaname) + 1); in main()
215 for (i = 0; i < N_RPA_DESCR; ++i, ns += 4) in main()
216 PUT_32BE(ns, rpanote[i]); in main()