diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-09-11 13:49:07 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-09-11 20:42:05 -0700 |
commit | 2374b2f3bc869ffaa5e027a41aff76a3612c9e23 (patch) | |
tree | abb7a41ae03bb0b7cfd5809e16de2092cfadbf34 /meta-initramfs | |
parent | fe91ebe55c13c4fd15ded2f7da50fc4e0a475422 (diff) | |
download | meta-openembedded-2374b2f3bc869ffaa5e027a41aff76a3612c9e23.tar.gz |
kexec-tools-klibc: Fix type mismatch in calls to dtb_set_initrd on mips
Fixes
kexec-elf-mips.c:163:42: error: incompatible pointer to integer conversion passing 'char *' to p
arameter of type 'off_t' (aka 'long long') [-Wint-conversion]
| dtb_set_initrd(&dtb_buf, &dtb_length, initrd_buf, initrd_buf + initrd_size);
| ^~~~~~~~~~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-initramfs')
-rw-r--r-- | meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/140-mips_disable_devicetree_support.patch | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/140-mips_disable_devicetree_support.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/140-mips_disable_devicetree_support.patch index bd728ccb4..6e347c048 100644 --- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/140-mips_disable_devicetree_support.patch +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/140-mips_disable_devicetree_support.patch | |||
@@ -22,8 +22,6 @@ Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | |||
22 | kexec/arch/mips/kexec-mips.h | 1 + | 22 | kexec/arch/mips/kexec-mips.h | 1 + |
23 | 4 files changed, 39 insertions(+), 28 deletions(-) | 23 | 4 files changed, 39 insertions(+), 28 deletions(-) |
24 | 24 | ||
25 | diff --git a/kexec/arch/mips/include/arch/options.h b/kexec/arch/mips/include/arch/options.h | ||
26 | index 416e224..18d2811 100644 | ||
27 | --- a/kexec/arch/mips/include/arch/options.h | 25 | --- a/kexec/arch/mips/include/arch/options.h |
28 | +++ b/kexec/arch/mips/include/arch/options.h | 26 | +++ b/kexec/arch/mips/include/arch/options.h |
29 | @@ -5,6 +5,7 @@ | 27 | @@ -5,6 +5,7 @@ |
@@ -44,11 +42,9 @@ index 416e224..18d2811 100644 | |||
44 | 42 | ||
45 | 43 | ||
46 | #define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR "" | 44 | #define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR "" |
47 | diff --git a/kexec/arch/mips/kexec-elf-mips.c b/kexec/arch/mips/kexec-elf-mips.c | ||
48 | index 849a7ba..5c0e535 100644 | ||
49 | --- a/kexec/arch/mips/kexec-elf-mips.c | 45 | --- a/kexec/arch/mips/kexec-elf-mips.c |
50 | +++ b/kexec/arch/mips/kexec-elf-mips.c | 46 | +++ b/kexec/arch/mips/kexec-elf-mips.c |
51 | @@ -141,35 +141,37 @@ int elf_mips_load(int argc, char **argv, const char *buf, off_t len, | 47 | @@ -141,45 +141,49 @@ int elf_mips_load(int argc, char **argv, |
52 | else | 48 | else |
53 | cmdline_addr = 0; | 49 | cmdline_addr = 0; |
54 | 50 | ||
@@ -63,9 +59,22 @@ index 849a7ba..5c0e535 100644 | |||
63 | - } else { | 59 | - } else { |
64 | - create_flatten_tree(&dtb_buf, &dtb_length, cmdline_buf + strlen(CMDLINE_PREFIX)); | 60 | - create_flatten_tree(&dtb_buf, &dtb_length, cmdline_buf + strlen(CMDLINE_PREFIX)); |
65 | - } | 61 | - } |
66 | 62 | - | |
67 | - if (arch_options.initrd_file) { | 63 | - if (arch_options.initrd_file) { |
68 | - initrd_buf = slurp_file(arch_options.initrd_file, &initrd_size); | 64 | - initrd_buf = slurp_file(arch_options.initrd_file, &initrd_size); |
65 | |||
66 | - /* Create initrd entries in dtb - although at this time | ||
67 | - * they would not point to the correct location */ | ||
68 | - dtb_set_initrd(&dtb_buf, &dtb_length, initrd_buf, initrd_buf + initrd_size); | ||
69 | - | ||
70 | - initrd_base = add_buffer(info, initrd_buf, initrd_size, | ||
71 | - initrd_size, sizeof(void *), | ||
72 | - _ALIGN_UP(kernel_addr + kernel_size + dtb_length, | ||
73 | - pagesize), 0x0fffffff, 1); | ||
74 | - | ||
75 | - /* Now that the buffer for initrd is prepared, update the dtb | ||
76 | - * with an appropriate location */ | ||
77 | - dtb_set_initrd(&dtb_buf, &dtb_length, initrd_base, initrd_base + initrd_size); | ||
69 | + if (!arch_options.no_dtb) { | 78 | + if (!arch_options.no_dtb) { |
70 | + /* MIPS systems that have been converted to use device tree | 79 | + /* MIPS systems that have been converted to use device tree |
71 | + * passed through UHI will use commandline in the DTB and | 80 | + * passed through UHI will use commandline in the DTB and |
@@ -78,39 +87,29 @@ index 849a7ba..5c0e535 100644 | |||
78 | + } else { | 87 | + } else { |
79 | + create_flatten_tree(&dtb_buf, &dtb_length, cmdline_buf + strlen(CMDLINE_PREFIX)); | 88 | + create_flatten_tree(&dtb_buf, &dtb_length, cmdline_buf + strlen(CMDLINE_PREFIX)); |
80 | + } | 89 | + } |
81 | 90 | + | |
82 | - /* Create initrd entries in dtb - although at this time | ||
83 | - * they would not point to the correct location */ | ||
84 | - dtb_set_initrd(&dtb_buf, &dtb_length, initrd_buf, initrd_buf + initrd_size); | ||
85 | + if (arch_options.initrd_file) { | 91 | + if (arch_options.initrd_file) { |
86 | + initrd_buf = slurp_file(arch_options.initrd_file, &initrd_size); | 92 | + initrd_buf = slurp_file(arch_options.initrd_file, &initrd_size); |
87 | 93 | + | |
88 | - initrd_base = add_buffer(info, initrd_buf, initrd_size, | ||
89 | - initrd_size, sizeof(void *), | ||
90 | - _ALIGN_UP(kernel_addr + kernel_size + dtb_length, | ||
91 | - pagesize), 0x0fffffff, 1); | ||
92 | + /* Create initrd entries in dtb - although at this time | 94 | + /* Create initrd entries in dtb - although at this time |
93 | + * they would not point to the correct location */ | 95 | + * they would not point to the correct location */ |
94 | + dtb_set_initrd(&dtb_buf, &dtb_length, initrd_buf, initrd_buf + initrd_size); | 96 | + dtb_set_initrd(&dtb_buf, &dtb_length, (off_t)initrd_buf, (off_t)initrd_buf + initrd_size); |
95 | 97 | + | |
96 | - /* Now that the buffer for initrd is prepared, update the dtb | ||
97 | - * with an appropriate location */ | ||
98 | - dtb_set_initrd(&dtb_buf, &dtb_length, initrd_base, initrd_base + initrd_size); | ||
99 | - } | ||
100 | + initrd_base = add_buffer(info, initrd_buf, initrd_size, | 98 | + initrd_base = add_buffer(info, initrd_buf, initrd_size, |
101 | + initrd_size, sizeof(void *), | 99 | + initrd_size, sizeof(void *), |
102 | + _ALIGN_UP(kernel_addr + kernel_size + dtb_length, | 100 | + _ALIGN_UP(kernel_addr + kernel_size + dtb_length, |
103 | + pagesize), 0x0fffffff, 1); | 101 | + pagesize), 0x0fffffff, 1); |
104 | 102 | + | |
105 | + /* Now that the buffer for initrd is prepared, update the dtb | 103 | + /* Now that the buffer for initrd is prepared, update the dtb |
106 | + * with an appropriate location */ | 104 | + * with an appropriate location */ |
107 | + dtb_set_initrd(&dtb_buf, &dtb_length, initrd_base, initrd_base + initrd_size); | 105 | + dtb_set_initrd(&dtb_buf, &dtb_length, initrd_base, initrd_base + initrd_size); |
108 | + } | 106 | + } |
109 | + } | 107 | } |
110 | 108 | ||
109 | - | ||
111 | /* This is a legacy method for commandline passing used | 110 | /* This is a legacy method for commandline passing used |
112 | * currently by Octeon CPUs only */ | 111 | * currently by Octeon CPUs only */ |
113 | @@ -177,9 +179,11 @@ int elf_mips_load(int argc, char **argv, const char *buf, off_t len, | 112 | add_buffer(info, cmdline_buf, sizeof(cmdline_buf), |
114 | sizeof(cmdline_buf), sizeof(void *), | 113 | sizeof(cmdline_buf), sizeof(void *), |
115 | cmdline_addr, 0x0fffffff, 1); | 114 | cmdline_addr, 0x0fffffff, 1); |
116 | 115 | ||
@@ -125,8 +124,6 @@ index 849a7ba..5c0e535 100644 | |||
125 | 124 | ||
126 | return 0; | 125 | return 0; |
127 | } | 126 | } |
128 | diff --git a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c | ||
129 | index 415c2ed..e557f8b 100644 | ||
130 | --- a/kexec/arch/mips/kexec-mips.c | 127 | --- a/kexec/arch/mips/kexec-mips.c |
131 | +++ b/kexec/arch/mips/kexec-mips.c | 128 | +++ b/kexec/arch/mips/kexec-mips.c |
132 | @@ -89,6 +89,7 @@ void arch_usage(void) | 129 | @@ -89,6 +89,7 @@ void arch_usage(void) |
@@ -137,7 +134,7 @@ index 415c2ed..e557f8b 100644 | |||
137 | ); | 134 | ); |
138 | } | 135 | } |
139 | 136 | ||
140 | @@ -121,6 +122,9 @@ int arch_process_options(int argc, char **argv) | 137 | @@ -121,6 +122,9 @@ int arch_process_options(int argc, char |
141 | case OPT_RAMDISK: | 138 | case OPT_RAMDISK: |
142 | arch_options.initrd_file = optarg; | 139 | arch_options.initrd_file = optarg; |
143 | break; | 140 | break; |
@@ -147,8 +144,6 @@ index 415c2ed..e557f8b 100644 | |||
147 | default: | 144 | default: |
148 | break; | 145 | break; |
149 | } | 146 | } |
150 | diff --git a/kexec/arch/mips/kexec-mips.h b/kexec/arch/mips/kexec-mips.h | ||
151 | index 222c815..90b21c3 100644 | ||
152 | --- a/kexec/arch/mips/kexec-mips.h | 147 | --- a/kexec/arch/mips/kexec-mips.h |
153 | +++ b/kexec/arch/mips/kexec-mips.h | 148 | +++ b/kexec/arch/mips/kexec-mips.h |
154 | @@ -22,6 +22,7 @@ struct arch_options_t { | 149 | @@ -22,6 +22,7 @@ struct arch_options_t { |