HV:treewide:C99-friendly per_cpu implementation change the per_cpu method

The current implementation of per_cpu relies on several non-c99 features,
and in additional involves arbitrary pointer arithmetic which is not MIS-
RA C friendly.

This patch introduces struct per_cpu_region which holds all the per_cpu
variables. Allocation of per_cpu data regions and access to per_cpu vari-
ables are greatly simplified, at the cost of making all per_cpu varaibl-
es accessible in files.

Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
This commit is contained in:
Huihuang Shi
2018-06-05 15:25:07 +08:00
committed by lijinxia
parent cbb692d910
commit e591315a65
20 changed files with 95 additions and 130 deletions

View File

@@ -80,15 +80,6 @@ SECTIONS
_ld_bss_end = . ;
} > ram
.discard (NOLOAD):
{
. = ALIGN(4096) ;
_ld_cpu_data_start = .;
*(.cpu_data) ;
. = ALIGN(4096) ;
_ld_cpu_data_end = .;
} > ram
_ld_ram_size = LENGTH(ram) ;
_ld_ram_end = _ld_ram_size + _ld_ram_start ;
}