program loading: add prog_run() function
The prog_run() function abstracts away what is required for running a given program. Within it, there are 2 calls: 1. platform_prog_run() and 2. arch_prog_run(). The platform_prog_run() allows for a chipset to intercept a program that will be run. This allows for CPU switching as currently needed in t124 and t132. Change-Id: I22a5dd5bfb1018e7e46475e47ac993a0941e2a8c Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8846 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
committed by
Aaron Durbin
parent
3948e5392b
commit
b3847e6424
39
src/lib/prog_ops.c
Normal file
39
src/lib/prog_ops.c
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* This file is part of the coreboot project.
|
||||
*
|
||||
* Copyright (C) 2014 Imagination Technologies
|
||||
* Copyright 2015 Google Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <program_loading.h>
|
||||
|
||||
/* For each segment of a program loaded this function is called*/
|
||||
void __attribute__ ((weak)) arch_segment_loaded(uintptr_t start, size_t size,
|
||||
int flags)
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
void prog_run(struct prog *prog)
|
||||
{
|
||||
platform_prog_run(prog);
|
||||
arch_prog_run(prog);
|
||||
}
|
||||
|
||||
void __attribute__ ((weak)) platform_prog_run(struct prog *prog)
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
Reference in New Issue
Block a user