suspend.c (ecd740c6f2f092b90b95fa35f757973589eaaca2) | suspend.c (18ab7db6b749ac27aac08d572afbbd2f4d937934) |
---|---|
1#include <linux/percpu.h> 2#include <linux/slab.h> 3#include <asm/cacheflush.h> 4#include <asm/cpu_ops.h> 5#include <asm/debug-monitors.h> 6#include <asm/pgtable.h> 7#include <asm/memory.h> 8#include <asm/smp_plat.h> --- 105 unchanged lines hidden (view full) --- 114 local_dbg_restore(flags); 115 116 return ret; 117} 118 119extern struct sleep_save_sp sleep_save_sp; 120extern phys_addr_t sleep_idmap_phys; 121 | 1#include <linux/percpu.h> 2#include <linux/slab.h> 3#include <asm/cacheflush.h> 4#include <asm/cpu_ops.h> 5#include <asm/debug-monitors.h> 6#include <asm/pgtable.h> 7#include <asm/memory.h> 8#include <asm/smp_plat.h> --- 105 unchanged lines hidden (view full) --- 114 local_dbg_restore(flags); 115 116 return ret; 117} 118 119extern struct sleep_save_sp sleep_save_sp; 120extern phys_addr_t sleep_idmap_phys; 121 |
122static int cpu_suspend_init(void) | 122static int __init cpu_suspend_init(void) |
123{ 124 void *ctx_ptr; 125 126 /* ctx_ptr is an array of physical addresses */ 127 ctx_ptr = kcalloc(mpidr_hash_size(), sizeof(phys_addr_t), GFP_KERNEL); 128 129 if (WARN_ON(!ctx_ptr)) 130 return -ENOMEM; 131 132 sleep_save_sp.save_ptr_stash = ctx_ptr; 133 sleep_save_sp.save_ptr_stash_phys = virt_to_phys(ctx_ptr); 134 sleep_idmap_phys = virt_to_phys(idmap_pg_dir); 135 __flush_dcache_area(&sleep_save_sp, sizeof(struct sleep_save_sp)); 136 __flush_dcache_area(&sleep_idmap_phys, sizeof(sleep_idmap_phys)); 137 138 return 0; 139} 140early_initcall(cpu_suspend_init); | 123{ 124 void *ctx_ptr; 125 126 /* ctx_ptr is an array of physical addresses */ 127 ctx_ptr = kcalloc(mpidr_hash_size(), sizeof(phys_addr_t), GFP_KERNEL); 128 129 if (WARN_ON(!ctx_ptr)) 130 return -ENOMEM; 131 132 sleep_save_sp.save_ptr_stash = ctx_ptr; 133 sleep_save_sp.save_ptr_stash_phys = virt_to_phys(ctx_ptr); 134 sleep_idmap_phys = virt_to_phys(idmap_pg_dir); 135 __flush_dcache_area(&sleep_save_sp, sizeof(struct sleep_save_sp)); 136 __flush_dcache_area(&sleep_idmap_phys, sizeof(sleep_idmap_phys)); 137 138 return 0; 139} 140early_initcall(cpu_suspend_init); |