@@ -31,6 +31,7 @@ static void usage(char *name)
3131 fprintf (stdout , "\t -e build extended manifest\n" );
3232 fprintf (stdout , "\t -y verify signed file\n" );
3333 fprintf (stdout , "\t -q resign binary\n" );
34+ fprintf (stdout , "\t -p set PV bit\n" );
3435}
3536
3637int main (int argc , char * argv [])
@@ -41,10 +42,11 @@ int main(int argc, char *argv[])
4142 int opt , ret , i , first_non_opt ;
4243 int imr_type = MAN_DEFAULT_IMR_TYPE ;
4344 int use_ext_man = 0 ;
45+ unsigned int pv_bit = 0 ;
4446
4547 memset (& image , 0 , sizeof (image ));
4648
47- while ((opt = getopt (argc , argv , "ho:va:s:k:ri:f:b:ec:y:q:" )) != -1 ) {
49+ while ((opt = getopt (argc , argv , "ho:va:s:k:ri:f:b:ec:y:q:p " )) != -1 ) {
4850 switch (opt ) {
4951 case 'o' :
5052 image .out_file = optarg ;
@@ -88,6 +90,9 @@ int main(int argc, char *argv[])
8890 case 'q' :
8991 image .in_file = optarg ;
9092 break ;
93+ case 'p' :
94+ pv_bit = 1 ;
95+ break ;
9196 default :
9297 /* getopt's default error message is good enough */
9398 return 1 ;
@@ -163,15 +168,21 @@ int main(int argc, char *argv[])
163168 return resign_image (& image );
164169 }
165170
166- /* set IMR Type in found machine definition */
167- if (image .adsp -> man_v1_8 )
171+ /* set IMR Type and the PV bit in found machine definition */
172+ if (image .adsp -> man_v1_8 ) {
168173 image .adsp -> man_v1_8 -> adsp_file_ext .imr_type = imr_type ;
174+ image .adsp -> man_v1_8 -> css .reserved0 = pv_bit ;
175+ }
169176
170- if (image .adsp -> man_v2_5 )
177+ if (image .adsp -> man_v2_5 ) {
171178 image .adsp -> man_v2_5 -> adsp_file_ext .imr_type = imr_type ;
179+ image .adsp -> man_v2_5 -> css .reserved0 = pv_bit ;
180+ }
172181
173- if (image .adsp -> man_ace_v1_5 )
182+ if (image .adsp -> man_ace_v1_5 ) {
174183 image .adsp -> man_ace_v1_5 -> adsp_file_ext .imr_type = imr_type ;
184+ image .adsp -> man_ace_v1_5 -> css .reserved0 = pv_bit ;
185+ }
175186
176187 /* parse input ELF files */
177188 image .num_modules = argc - first_non_opt ;
0 commit comments