This patch unifies the use of config options in v2 to all start with CONFIG_
[coreboot.git] / src / cpu / x86 / car / copy_and_run.c
1 /* Copyright (C) 2009 coresystems GmbH
2    (Written by Patrick Georgi <patrick.georgi@coresystems.de> for coresystems GmbH
3 */
4
5 #if CONFIG_CBFS == 1
6 void cbfs_and_run_core(char*, unsigned ebp);
7
8 static void copy_and_run(unsigned cpu_reset)
9 {
10         if (cpu_reset == 1) cpu_reset = -1;
11         else cpu_reset = 0;
12
13 # if CONFIG_USE_FALLBACK_IMAGE == 1
14         cbfs_and_run_core("fallback/coreboot_ram", cpu_reset);
15 # else
16         cbfs_and_run_core("normal/coreboot_ram", cpu_reset);
17 # endif
18 }
19
20 #else
21 void copy_and_run_core(u8 *src, u8 *dst, unsigned long ilen, unsigned ebp);
22
23 extern u8 _liseg, _iseg, _eiseg;
24
25 static void copy_and_run(unsigned cpu_reset)
26 {
27         uint8_t *src, *dst; 
28         unsigned long ilen;
29
30
31         src = &_liseg;
32         dst = &_iseg;
33         ilen = &_eiseg - dst;
34
35         if (cpu_reset == 1) cpu_reset = -1;
36         else cpu_reset = 0;
37
38         copy_and_run_core(src, dst, ilen, cpu_reset);
39 }
40 #endif
41