diff options
Diffstat (limited to 'src/cpu/amd/car/post_cache_as_ram.c')
-rw-r--r-- | src/cpu/amd/car/post_cache_as_ram.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c index eca7673df3..3fe496e44c 100644 --- a/src/cpu/amd/car/post_cache_as_ram.c +++ b/src/cpu/amd/car/post_cache_as_ram.c @@ -75,11 +75,11 @@ static void vErrata343(void) #endif } +void cache_as_ram_switch_stack(void *resume_backup_memory); + static void post_cache_as_ram(void) { -#if CONFIG_HAVE_ACPI_RESUME - void *resume_backup_memory; -#endif + void *resume_backup_memory = NULL; #if 1 { /* Check value of esp to verify if we have enough room for stack in Cache as RAM */ @@ -92,9 +92,6 @@ static void post_cache_as_ram(void) } #endif - unsigned testx = 0x5a5a5a5a; - print_debug_pcar("testx = ", testx); - /* copy data from cache as ram to ram need to set CONFIG_RAMTOP to 2M and use var mtrr instead. */ @@ -112,21 +109,19 @@ static void post_cache_as_ram(void) vErrata343(); memcopy((void *)((CONFIG_RAMTOP)-CONFIG_DCACHE_RAM_SIZE), (void *)CONFIG_DCACHE_RAM_BASE, CONFIG_DCACHE_RAM_SIZE); //inline + cache_as_ram_switch_stack(resume_backup_memory); +} - __asm__ volatile ( - /* set new esp */ /* before CONFIG_RAMBASE */ - "subl %0, %%esp\n\t" - ::"a"( (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE)- (CONFIG_RAMTOP) ) - /* discard all registers (eax is used for %0), so gcc redoes everything - after the stack is moved */ - : "cc", "memory", "%ebx", "%ecx", "%edx", "%esi", "%edi", "%ebp" - ); +void +cache_as_ram_new_stack (void *resume_backup_memory); +void +cache_as_ram_new_stack (void *resume_backup_memory __attribute__ ((unused))) +{ /* We can put data to stack again */ /* only global variable sysinfo in cache need to be offset */ print_debug("Done\n"); - print_debug_pcar("testx = ", testx); print_debug("Disabling cache as ram now \n"); |