program loading: unify on struct prog
Instead of having different structures for loading ramstage and payload align to using struct prog. This also removes arch_payload_run() in favor of the prog_run() interface. Change-Id: I31483096094eacc713a7433811cd69cc5621c43e Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8849 Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com> Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
		
				
					committed by
					
						 Aaron Durbin
						Aaron Durbin
					
				
			
			
				
	
			
			
			
						parent
						
							b3847e6424
						
					
				
				
					commit
					ce9efe061a
				
			| @@ -123,18 +123,22 @@ static void jmp_payload(void *entry, unsigned long buffer, unsigned long size) | ||||
| 		); | ||||
| } | ||||
|  | ||||
| void arch_payload_run(struct payload *payload) | ||||
| static void try_payload(struct prog *prog) | ||||
| { | ||||
| 	if (IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE)) | ||||
| 		jmp_payload_no_bounce_buffer(prog_entry(&payload->prog)); | ||||
| 	else | ||||
| 		jmp_payload(prog_entry(&payload->prog), | ||||
| 				(uintptr_t)payload->bounce.data, | ||||
| 				payload->bounce.size); | ||||
| 	if (prog->type == PROG_PAYLOAD) { | ||||
| 		if (IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE)) | ||||
| 			jmp_payload_no_bounce_buffer(prog_entry(prog)); | ||||
| 		else | ||||
| 			jmp_payload(prog_entry(prog), | ||||
| 					(uintptr_t)prog_start(prog), | ||||
| 					prog_size(prog)); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| void arch_prog_run(struct prog *prog) | ||||
| { | ||||
| 	if (ENV_RAMSTAGE) | ||||
| 		try_payload(prog); | ||||
| 	__asm__ volatile ( | ||||
| 		"jmp  *%%edi\n" | ||||
| 		:: "D"(prog_entry(prog)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user